/* Desktop Layout Styles for Scales of Chords */

/* Reset desktop-specific body styles */
.desktop-layout {
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Desktop App Container */
.desktop-app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden; /* Prevent page-level scrolling */
}

/* Desktop Navigation Bar */
.desktop-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-brand h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.nav-brand p {
    margin: 0.15rem 0 0;
    max-width: 32rem;
    color: #4a5568;
    font-size: 0.78rem;
    line-height: 1.25;
}

.nav-controls {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.nav-utils {
    display: flex;
    gap: 0.75rem;
}

.utility-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(45, 55, 72, 0.8);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.utility-btn:hover {
    background: rgba(45, 55, 72, 1);
    transform: translateY(-1px);
}

/* Desktop Main Layout */
.desktop-main-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 1rem;
    flex: 1;
    padding: 1rem;
    overflow: hidden;
    min-height: 0; /* Allow grid items to shrink below content size */
}

/* Settings Panels */
.desktop-layout .left-settings-panel,
.desktop-layout .right-settings-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    overflow-y: auto !important; /* Use auto for better behavior */
    overflow-x: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 0; /* Allow shrinking */
    max-height: calc(100vh - 120px); /* Constrain height to force scrolling */
    position: static !important; /* Override mobile positioning */
    right: auto !important;
    width: auto !important;
    transform: none !important;
}

/* Custom scrollbar styling for settings panels */
.desktop-layout .left-settings-panel::-webkit-scrollbar,
.desktop-layout .right-settings-panel::-webkit-scrollbar {
    width: 12px;
    background: rgba(0, 0, 0, 0.05);
}

.desktop-layout .left-settings-panel::-webkit-scrollbar-track,
.desktop-layout .right-settings-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    margin: 2px;
}

.desktop-layout .left-settings-panel::-webkit-scrollbar-thumb,
.desktop-layout .right-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.desktop-layout .left-settings-panel::-webkit-scrollbar-thumb:hover,
.desktop-layout .right-settings-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Force scrollbars to always be visible on Firefox */
.desktop-layout .left-settings-panel,
.desktop-layout .right-settings-panel {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(102, 126, 234, 0.6) rgba(0, 0, 0, 0.05) !important;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on touch devices */
}

/* Force content to create scrollable area for testing */
.desktop-layout .left-settings-panel .settings-content,
.desktop-layout .right-settings-panel .settings-content {
    min-height: 100%; /* Ensure content fills the container */
}

.left-settings-panel {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.right-settings-panel {
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

/* Center Content Area */
.center-content {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

/* Content layout adjustments for different modes */
.center-content .main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 0; /* Allow shrinking */
}

/* Optimize vertical fretboard display */
.center-content .main-content .fretboard-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
}

.center-content .main-content #chart-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    padding: 0.25rem 0;
}

.center-content .piano-container {
    flex: none; /* Don't grow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: auto;
    max-height: 70vh; /* Prevent piano from taking too much space */
}

.center-content .horizontal-fretboard-container {
    flex: none; /* Don't grow */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: auto;
    max-height: 60vh; /* Prevent horizontal fretboard from taking too much space */
}

/* Settings Sections */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Setting Groups */
.setting-group {
    margin-bottom: 1rem;
}

.setting-group.compact {
    margin-bottom: 0.75rem;
}

.setting-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.setting-group small {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.setting-group small.is-problem {
    color: #b83232;
    font-weight: 600;
}

/* Form Controls */
.setting-group select,
.setting-group input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s ease;
}

.setting-group select:focus,
.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Checkbox Styling */
.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.1);
}

/* String Voicing Controls */
.string-voicing-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.string-voicing-controls .setting-group {
    margin-bottom: 0.75rem;
}

.string-voicing-controls label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.string-voicing-controls select {
    padding: 0.375rem;
    font-size: 0.8rem;
}

/* Action Buttons */
.action-buttons {
    margin-top: 1.5rem;
}

.action-buttons button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.action-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-buttons button:active {
    transform: translateY(0);
}

.action-buttons button:last-child {
    margin-bottom: 0;
}

/* Range Display Spans */
#volume-display,
#bpm-display,
#click-volume-display {
    font-size: 0.8rem;
    font-weight: 500;
    color: #667eea;
    margin-left: 0.5rem;
}

/* Fretboard Adjustments for Desktop */
#scale-chart {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

/* Note Names Display - Minimize spacing */
#note-names-container,
#interval-names-container {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

#note-names-display,
#interval-names-display {
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.2;
}

/* Remove conflicting styles - these are handled above */

/* Additional layout optimizations */
.center-content.vertical-layout .main-content {
    height: 100%;
    max-height: 100%;
}

.center-content.piano-layout .piano-container {
    background: #f7fafc;
    border-radius: 12px;
    margin: 0.5rem;
    overflow: hidden;
}

.center-content.horizontal-layout .horizontal-fretboard-container {
    background: #f7fafc;
    border-radius: 12px;
    margin: 0.5rem;
    overflow: hidden;
}

/* Ensure piano and staff containers don't add extra space */
.piano-container .staff-container {
    margin: 0;
    padding: 0.5rem 0;
}

/* Optimize fretboard wrapper spacing */
#horizontal-fretboard-wrapper {
    margin: 0;
    padding: 0.5rem;
}

/* Responsive Adjustments for Smaller Desktops */
@media (max-width: 1400px) {
    .desktop-main-layout {
        grid-template-columns: 260px 1fr 260px;
    }
    
    .left-settings-panel,
    .right-settings-panel {
        padding: 1.25rem;
    }
}

@media (max-width: 1200px) {
    .desktop-main-layout {
        grid-template-columns: 240px 1fr 240px;
    }
    
    .settings-section h3 {
        font-size: 1rem;
    }
    
    .setting-group label {
        font-size: 0.8rem;
    }

    .nav-brand p {
        max-width: 24rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 1000px) {
    .desktop-main-layout {
        grid-template-columns: 220px 1fr 220px;
    }
    
    .left-settings-panel,
    .right-settings-panel {
        padding: 1rem;
    }
}

@media (max-width: 900px) {
    .desktop-main-layout {
        grid-template-columns: 200px 1fr 200px;
    }
    
    .left-settings-panel,
    .right-settings-panel {
        padding: 0.75rem;
    }
    
    .settings-section h3 {
        font-size: 0.9rem;
    }
    
    .setting-group label {
        font-size: 0.75rem;
    }

    .nav-brand p {
        display: none;
    }
}

/* Only hide panels when screen is very narrow */
@media (max-width: 800px) {
    .desktop-main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 0.5rem;
    }
    
    .left-settings-panel,
    .right-settings-panel {
        display: none; /* Hide side panels only on very small screens */
    }
    
    .center-content {
        grid-row: 1 / -1; /* Take full height */
    }
}
