/* Terminal styles */
#flasherTerminal::-webkit-scrollbar {
    display: none;
}

.terminal-container {
    position: relative;
    display: none;
    margin-top: 10px;
}

#flasherTerminal {
    background: #1e1e1e;
    color: #0f0;
    font-family: monospace;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 10px;
    text-align: left;
    white-space: pre-wrap;
}

#closeTerminal {
    position: absolute;
    bottom: 0px;
    margin: 8px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #0f0;
    width: calc(100% - 16px);
    font-size: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: monospace;
    display: none;
    z-index: 10;
}

#closeTerminal:hover {
    background: rgba(30, 30, 30, 1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--container-background);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    color: var(--text-color);
}

.modal-content h2 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--accent-color);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}



.label-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -10px;
}

.modal-body input, .modal-body select, .modal-body textarea {
    padding: 10px;
    background-color: var(--input-bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.modal-body textarea {
    height: 150px;
    resize: vertical;
    font-family: monospace;
}

.input-info {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

#constructButton {
    margin-top: 10px;
    padding: 12px;
    font-weight: bold;
    transition: background-color 0.2s, opacity 0.2s;
}

#constructButton:disabled {
    background-color: var(--button-disabled);
    color: var(--button-disabled-text);
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .modal {
        /* padding: 10px; */
        box-sizing: border-box;
        overflow: hidden; /* Prevent background scroll if content scrolls */
    }

    .modal-content {
        margin: 0;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        padding: 15px;
        box-sizing: border-box;
        border: none;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 0 4px;
        margin-bottom: 5px;
        gap: 8px;
    }

    /* Fixed header and footer style in modal on mobile */
    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .close {
        font-size: 32px;
        position: absolute;
        top: 10px;
        right: 15px;
    }

    .modal-body input, .modal-body select, .modal-body textarea {
        padding: 8px;
        font-size: 13px;
    }

    .modal-body textarea {
        height: 100%; /* Give more space for layout */
    }

    .label-group {
        margin-bottom: -8px;
    }

    .label-group label {
        font-size: 13px;
    }

    .input-info {
        font-size: 10px;
    }

    #constructButton {
        flex-shrink: 0;
        margin-top: 5px;
        padding: 14px;
        font-size: 16px;
    }
}
