/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #4a5568;
    background-color: #e5e7eb;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.main-header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    color: #16213e;
    font-weight: 600;
}

.main-header p {
    font-size: 1.1em;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.mobile-filter-toggle {
    display: none; /* Hidden on desktop - FIXED */
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.mobile-filter-toggle:hover {
    background: #f8f9fa;
}

.filter-icon {
    font-size: 1.1em;
}

/* FIXED: AO3-style layout - content on LEFT, filters on RIGHT */
.content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ===== CONTENT AREA (LEFT SIDE) ===== */
.content-area {
    flex: 1;
    min-width: 0;
    order: 1; /* Content comes first (left) */
}

/* ===== FILTERS SIDEBAR (RIGHT SIDE) ===== */
.filters-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    order: 2; /* Filters come second (right) */
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.filters-header h2 {
    font-size: 1.3em;
    color: #16213e;
    font-weight: 600;
}

.mobile-close-filters {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #718096;
}

/* ===== RESULTS INFO ===== */
.results-info {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.results-info p {
    margin: 0;
    color: #718096;
    font-weight: 500;
}

#results-count {
    font-weight: 700;
    color: #667eea;
}

/* ===== FILTER GROUPS ===== */
.filter-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    padding-bottom: 18px;
    border-bottom: 1px solid #edf2f7;
}

.filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-group h3 {
    font-size: 1em;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.expand-toggle {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand-toggle:hover {
    text-decoration: underline;
}

.expand-arrow {
    transition: transform 0.2s;
}

.expand-toggle.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* ===== CHECKBOXES ===== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mood-checkboxes.collapsed {
  max-height: 200px; /* Fixed height when collapsed */
  overflow-y: auto; /* Scrollable when collapsed */
}

/* Remove max-height and overflow when expanded */
.mood-checkboxes:not(.collapsed) {
  max-height: none;
  overflow-y: visible;
}

/* Add scrollbar styling for collapsed mood list */
.mood-checkboxes.collapsed::-webkit-scrollbar {
  width: 6px;
}

.mood-checkboxes.collapsed::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 3px;
}

.mood-checkboxes.collapsed::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.deselect-all-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85em;
    padding: 4px 0;
    margin-bottom: 8px;
}

.deselect-all-btn:hover {
    color: #5568d3;
}

.deselect-all-btn:focus {
    outline: none;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-checkbox:hover {
    background: #f8f9fa;
}

/* Custom Checkbox Styling */
.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* ===== FAMILY PILLS ===== */
.family-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.family-strings {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.family-brass {
    background: #fef5e7;
    color: #744210;
    border: 1px solid #f6e05e;
}

.family-woodwinds {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* ===== CLEAR FILTERS BUTTON ===== */
.clear-filters-btn {
    width: 100%;
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 20px;
}

.clear-filters-btn:hover {
    background: #5568d3;
}

/* ===== BLENDS GRID ===== */
.blends-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ===== BLEND CARDS ===== */
.blend-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s;
    position: relative;
}

.blend-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.blend-card h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
    color: #16213e;
    font-weight: 600;
}

/* ===== CARD METADATA ===== */
.blend-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.card-family-pills {
    display: flex;
    gap: 6px;
}

.card-family-pill {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.card-family-pill.strings {
    background: #c6f6d5;
    color: #22543d;
}

.card-family-pill.brass {
    background: #fef5e7;
    color: #744210;
}

.card-family-pill.woodwinds {
    background: #fed7d7;
    color: #742a2a;
}

.card-register-tags {
    display: flex;
    gap: 4px;
}

.register-tag {
    padding: 2px 6px;
    background: #edf2f7;
    color: #4a5568;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 500;
    text-transform: uppercase;
}

.metadata-separator {
    color: #e2e8f0;
    font-weight: bold;
}

.usage-indicator {
    font-size: 0.8em;
    color: #718096;
    font-weight: 500;
}

/* ===== CARD TAGS ===== */
.card-mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.mood-tag {
    padding: 3px 8px;
    background: #f8f9fa;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

/* ===== AUDIO PLAYERS ===== */
.audio-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audio-player label {
    font-size: 0.85em;
    font-weight: 500;
    color: #4a5568;
}

.audio-player audio {
    width: 100%;
    height: 32px;
}

/* ===== LEARN MORE SECTION ===== */
.learn-more-btn {
    width: 100%;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.learn-more-btn:hover {
    background: #edf2f7;
    border-color: #adb5bd;
}

.learn-more-btn.expanded {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.learn-more-btn.expanded:hover {
    background: #5568d3;
}

.blend-details {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    display: none;
}

.blend-details.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.blend-details p {
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.6;
}

.blend-details p:last-child {
    margin-bottom: 0;
}

.blend-details strong {
    color: #16213e;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.no-results h3 {
    font-size: 1.5em;
    margin-bottom: 12px;
    color: #4a5568;
}

/* ===== FOOTER ===== */
.main-footer {
    margin-top: 60px;
    padding: 36px 0 40px 0;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
    color: #16213e;
}

.footer-content p {
    font-size: 1em;
    color: #718096;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.download-btn {
    padding: 14px 32px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #218838;
}

/* ===== CONTACT FOOTER ===== */
.contact-footer {
    margin-top: 0;
    padding: 30px 20px 15px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
    color: #666;
    font-size: 14px;
    background: white;
}

.contact-footer p {
    margin-bottom: 15px;
}

.contact-footer p:last-child {
    margin-bottom: 0;
}

.contact-footer a {
    color: #667eea;  
    text-decoration: none;
}

.contact-footer a:hover {
    color: #5568d3; 
    text-decoration: underline;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 992px) {
    /* Show mobile filter toggle */
    .mobile-filter-toggle {
        display: flex !important;
    }
    
    /* Stack content vertically on mobile */
    .content-wrapper {
        flex-direction: column;
        gap: 0;
    }
    
    /* Content comes first on mobile */
    .content-area {
        order: 2;
        width: 100%; 
    }
    
    /* Mobile filters */
    .filters-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(-100%);
        transition: transform 0.3s ease-out;
        order: 1;
    }
    
    .filters-sidebar.active {
        transform: translateY(0);
    }
    
    .mobile-close-filters {
        display: block !important;
    }
    
    /* Single column audio players on mobile */
    .audio-players {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Smaller header on mobile */
    .main-header h1 {
        font-size: 1.8em;
    }
    
    .main-header p {
        font-size: 1em;
    }
    
    /* Adjust card padding on mobile */
    .blend-card {
        padding: 20px;
    }

     .blend-card h3 {
        margin: 0;
    }
    
    /* Stack metadata on mobile */
    .blend-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .card-family-pills {
        order: 1;
    }
    
    .card-register-tags {
        order: 2;
    }
    
    .usage-indicator {
        order: 3;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding: 0 16px;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .blend-card {
        padding: 16px;
    }
    
    .blend-card h3 {
        font-size: 1.2em;
    }
}

/* ===== SCROLLBAR STYLING ===== */
.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== FOCUS STYLES ===== */
button:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.filter-checkbox:focus-within {
    background: #f8f9fa;
}


