/* Modal.css - Dedicated styles for modal components including settings modal */
/* This file contains all modal-related styling for the Pixel Audio Studio application */

/* ============================================= */
/* 1. MODAL OVERLAY - Full screen backdrop */
/* ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

/* ============================================= */
/* 2. MODAL STRUCTURE - Base modal container */
/* ============================================= */
.modal {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    width: 400px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 20px;
    position: relative;
}

/* Make modal wider to accommodate four tabs */
.modal-overlay .modal {
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* ============================================= */
/* 3. MODAL HEADER - Title and subtitle area */
/* ============================================= */
.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Fix header vertical alignment - using exact pixelTilemaps styles */
.modal header {
    flex-shrink: 0;
    padding: 20px 20px 40px 20px;
    width: 100%;
    display: block;
    margin-bottom: 20px;
}

/* Modal title styling */
.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a855f7;
    padding: 0px 0px 20px 0px;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    margin-bottom: 15px;
}

/* ============================================= */
/* 4. MODAL CLOSE BUTTON - Top right close button */
/* ============================================= */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--accent-secondary);
    background: rgba(255, 0, 110, 0.1);
}

/* ============================================= */
/* 5. MODAL CONTENT - Scrollable content area */
/* ============================================= */
.modal-content {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px;
}

/* ============================================= */
/* 6. MODAL CONTENT WRAPPER - Main content container */
/* ============================================= */
.modal-content-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: 65vh;
    padding: 0px 20px 20px 20px;
    margin-top: 80px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-dark);
    display: flex;
    flex-direction: column;
}

/* ============================================= */
/* 7. MODAL SCROLLBAR STYLING - Custom scrollbar design */
/* ============================================= */
.modal-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.modal-content-wrapper::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ============================================= */
/* 8. MODAL ACTIONS - Footer button area */
/* ============================================= */
.modal-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-actions .btn {
    min-width: 100px;
}