/* ============================================
   Navigation Bar Styles
   ============================================
   
   PROJECT NOTE: Navigation Dark Mode Support
   - Uses var(--card-bg) instead of hardcoded 'white'
   - All text colors use CSS variables
   - Mobile menu background adapts to theme
   - Theme toggle button in nav-actions
   ============================================ */

.suite-nav {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
    transition: background-color var(--transition-normal);
}

.suite-nav .container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap; /* Prevent wrapping */
    padding: 0 var(--spacing-lg);
    overflow-x: auto; /* Allow horizontal scroll if needed */
    max-width: 100%;
}

.suite-nav .logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0; /* Don't shrink */
}

.suite-nav .logo:hover {
    color: var(--primary-hover);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: nowrap; /* Don't wrap */
    flex-shrink: 1;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-dropdown-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    margin-top: 5px;
    z-index: 1000;
    padding: var(--spacing-xs) 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: 0;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   CRITICAL LAYOUT: DO NOT MODIFY UNLESS DOING LAYOUT WORK
   
   3-COLUMN HORIZONTAL NAVIGATION LAYOUT:
   - Column 1: Font Size Selector
   - Column 2: Theme Group (Brand + Mode stacked vertically)
   - Column 3: Settings Button
   
   nav-actions MUST be flex-direction: row
   theme-selector-group MUST be flex-direction: column
   ============================================ */

.nav-actions {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    align-items: center;
    margin-left: auto; /* Push to right */
    flex-shrink: 0; /* Don't shrink */
}

.theme-selector-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.nav-actions button {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.nav-actions button:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Theme Selector Dropdown */
.theme-selector {
    background: var(--background);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    min-width: 180px;
    white-space: nowrap;
}

.theme-selector:hover {
    background: var(--card-bg);
    border-color: var(--primary);
}

.theme-selector:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--primary);
}

/* Theme Settings Modal */
.theme-settings-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0; /* Don't let it shrink */
    min-width: 40px; /* Ensure minimum width */
}

.theme-settings-btn:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: scale(1.1);
}

.theme-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.theme-settings-modal.active {
    display: flex;
}

.theme-settings-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.theme-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.theme-settings-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

.theme-settings-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    line-height: 1;
}

.theme-settings-close:hover {
    color: var(--primary);
}

.theme-setting-group {
    margin-bottom: var(--spacing-lg);
}

.theme-setting-group:last-child {
    margin-bottom: 0;
}

.theme-setting-group h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1em;
}

.theme-setting-group p {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: var(--spacing-md);
}

.theme-toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.theme-toggle-switch:hover {
    border-color: var(--primary);
}

.theme-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.theme-toggle-label strong {
    color: var(--text-primary);
    font-size: 1em;
}

.theme-toggle-label span {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Mobile Theme Controls - Hidden on Desktop */
.mobile-theme-controls {
    display: none;
}

/* Desktop - Hide mobile controls, show desktop controls */
@media (min-width: 769px) {
    .mobile-theme-controls {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .theme-selector-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px;
        align-items: stretch;
    }
}

/* Mobile - Show mobile controls, hide desktop controls */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-theme-controls {
        display: flex !important;
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-md) 0;
        border-top: 1px solid var(--border);
        margin-top: var(--spacing-md);
    }
    
    .mobile-theme-controls label {
        color: var(--text-secondary);
        font-weight: 500;
        font-size: 0.9em;
    }
    
    .mobile-theme-controls select {
        width: 100%;
        padding: 8px;
        border: 1px solid var(--border);
        background: var(--background);
        color: var(--text-primary);
        border-radius: var(--radius-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .mobile-theme-controls button {
        width: 100%;
        padding: 10px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-weight: 500;
    }
    
    .suite-nav .container {
        padding: 0 var(--spacing-md);
    }
    
    .nav-actions {
        display: none !important;
    }
    
    .theme-selector-group {
        display: none !important;
    }
    
    .theme-settings-content {
        width: 95%;
        padding: var(--spacing-md);
    }
}
