/* FormX3D - Dark Minimalist CAD Design Interface */

:root {
    /* Dark Theme Color Palette */
    --primary-purple: #46CCAF;
    --accent-blue: #3381FF;
    --bg-dark: #0F0F23;
    --bg-darker: #0A0A1B;
    --surface-dark: #1A1A2E;
    --surface-lighter: #252547;
    --text-light: #FEF9EB;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border-dark: #fff370;
    --border-subtle: #1E293B;
    --success-green: #10B981;
    --warning-amber: #F59E0B;
    --danger-red: #EF4444;
    --spacing: 16px;
    
    /* Shadows for dark theme */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    /* OPTION 1: Deep Blue - Subtle professional gradient */
    /* background: radial-gradient(ellipse 120% 100% at 120% 20%, rgba(0, 47, 122, 0.25) 0%, var(--bg-dark) 60%); */
    
    /* OPTION 2: Turquoise - Fresh creative gradient */
    /* background: radial-gradient(ellipse 120% 100% at 120% 20%, rgba(70, 204, 175, 0.20) 0%, var(--bg-dark) 60%); */
    
    /* OPTION 3: Bright Blue - Dynamic energetic gradient */
    background: radial-gradient(ellipse 180% 150% at -10% 85%, rgba(51, 129, 255, 0.25) 0%, var(--bg-dark) 70%);
    background-attachment: fixed;
    
    /* OPTION 4: Deep Blue - Bolder version */
    /* background: radial-gradient(ellipse 130% 110% at 115% 15%, rgba(0, 47, 122, 0.4) 0%, var(--bg-dark) 55%); */
    
    /* OPTION 5: Turquoise - Bolder version from bottom-left */
    /* background: radial-gradient(ellipse 130% 110% at -15% 85%, rgba(70, 204, 175, 0.3) 0%, var(--bg-dark) 55%); */
    
    /* OPTION 6: Bright Blue - Dual offset (top-right + bottom-left) */
    /* background: 
        radial-gradient(ellipse 100% 90% at 120% 20%, rgba(51, 129, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 100% 90% at -20% 80%, rgba(51, 129, 255, 0.15) 0%, transparent 50%),
        var(--bg-dark); */
    
    color: var(--text-light);
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

/* Only hide overflow when in design view */
body.design-view {
    overflow: hidden;
}

/* Allow scrolling in grid view */
body.grid-view {
    overflow-y: auto;
}

/* Header */
.navbar {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-light) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary-purple) !important;
}

.navbar-brand i {
    width: 28px;
    height: 28px;
    color: var(--primary-purple);
}

/* Layout */
.main-content-full {
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Viewer */
.viewer-controls {
    flex-shrink: 0;
    background-color: var(--surface-dark) !important;
    border-bottom: 1px solid var(--border-dark);
    backdrop-filter: blur(20px);
}

.viewer-controls h5 {
    color: var(--text-light);
    font-weight: 600;
}

.viewer-controls small {
    color: var(--text-muted);
}

.viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    background-color: var(--bg-dark);
}

.viewer-3d {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(ellipse at center, var(--surface-dark) 0%, var(--bg-dark) 70%);
}

.viewer-3d canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.viewer-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.viewer-placeholder h4 {
    color: var(--text-muted);
    font-weight: 600;
}

.viewer-placeholder p {
    color: var(--text-dim);
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    color: var(--text-dim);
    margin-bottom: var(--spacing);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1000;
}

.model-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.model-loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Floating Add Button */
.floating-add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-blue) 100%);
    box-shadow: var(--shadow-xl);
    border: none;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-add-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 25px 35px -5px rgba(124, 58, 237, 0.4);
}

.floating-add-btn i {
    width: 24px;
    height: 24px;
    color: white;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-generating {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-processing {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-completed {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-blue) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #8B5CF6 0%, #60A5FA 100%);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
}

.btn-outline-secondary:hover {
    background: var(--surface-lighter);
    color: var(--text-light);
    border-color: var(--primary-purple);
}

.btn-secondary {
    background: var(--surface-lighter);
    color: var(--text-light);
    border: 1px solid var(--border-dark);
}

.btn-secondary:hover {
    background: var(--surface-dark);
    color: var(--text-light);
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-warning {
    background: var(--warning-amber);
    color: white;
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger-red);
    border: 1px solid var(--danger-red);
}

.btn-outline-danger:hover {
    background: var(--danger-red);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-purple);
    border: 1px solid var(--primary-purple);
}

.btn-outline-primary:hover {
    background: var(--primary-purple);
    color: white;
}

/* Cards */
.card {
    background: var(--surface-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing);
    color: var(--text-light);
}

.card-header {
    background-color: var(--surface-lighter);
    border-bottom: 1px solid var(--border-dark);
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
}

.card-header h6 {
    color: var(--text-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    margin: 0;
}

.card-header i {
    width: 18px;
    height: 18px;
    color: var(--primary-purple);
}

.card-body {
    padding: 24px;
}

/* Form Controls */
.form-control {
    background: var(--surface-lighter);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 12px var(--spacing);
    font-size: 0.875rem;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.form-control:focus {
    background: var(--surface-dark);
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    color: var(--text-light);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-label {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 8px;
}

.form-text {
    color: var(--text-dim);
    font-size: 0.8rem;
}

textarea.form-control-lg {
    min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
    height: 100%;
}

.form-select {
    background: var(--surface-lighter);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    color: var(--text-light);
}

.form-select:focus {
    background: var(--surface-dark);
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    color: var(--text-light);
}

/* Generation Page Styles */
.generation-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.generation-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-dark);
    background: var(--surface-dark);
}

.generation-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--surface-dark) 0%, var(--bg-dark) 70%);
}

.generation-status-container {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.generation-status {
    background: var(--surface-dark);
    border-radius: 24px;
    padding: 3rem 2rem;
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-display {
    background: var(--surface-lighter);
    border-radius: 16px;
    padding: 1rem 2rem;
    display: inline-block;
    margin: 0 auto;
}

.timer-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.timer-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.generation-tips {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* Design Grid */
.designs-grid-view {
    background: transparent;
    min-height: 100vh;
}

.designs-grid-view .container-fluid {
    background: transparent;
}

.designs-grid-view h2 {
    color: var(--text-light);
    font-weight: 700;
}

.designs-grid-view p {
    color: var(--text-muted);
}

.design-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 24px;
}

.design-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-purple);
}

.design-card-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.design-card-thumbnail img,
.card-thumbnail-img {
    width: 100%;
    height: auto;
    display: block;
}

.design-card-thumbnail .placeholder-icon {
    width: 48px;
    height: 48px;
    color: var(--text-dim);
}

.featured-star {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.featured-star:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.featured-star i,
.featured-star svg {
    width: 18px;
    height: 18px;
    color: #fff;
    stroke: #fff;
    fill: none;
    transition: all 0.2s ease;
}

.featured-star i.star-filled,
.featured-star svg.star-filled {
    fill: #fbbf24 !important;
    color: #fbbf24;
    stroke: #fbbf24;
}

.design-card-body {
    padding: 20px;
}

.design-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.design-card-prompt {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.design-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide footer only on explore page */
[data-page="explore"] .design-card-footer {
    display: none;
}

.design-card-date {
    font-size: 12px;
    color: var(--text-dim);
}

.design-card-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.design-view {
    height: 100vh;
    background: var(--bg-dark);
}

/* Modal styles */
.modal-content {
    background: var(--surface-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    color: var(--text-light);
}

.modal-header {
    border-bottom: 1px solid var(--border-dark);
    padding: 24px;
    background: var(--surface-lighter);
    border-radius: 20px 20px 0 0;
}

.modal-title {
    color: var(--text-light);
    font-weight: 600;
}

.modal-title i {
    color: var(--primary-purple);
}

.modal-body {
    border-radius: inherit;
    padding: 24px;
    background: var(--surface-dark);
}

.modal-footer {
    border-top: 1px solid var(--border-dark);
    padding: 24px;
    background: var(--surface-dark);
    border-radius: 0 0 20px 20px;
}

.btn-close {
    filter: invert(1);
    opacity: 0.6;
}

.btn-close:hover {
    opacity: 1;
}

/* Navigation tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 24px;
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 12px 20px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--text-light);
    background: var(--surface-lighter);
}

.nav-tabs .nav-link.active {
    color: var(--primary-purple);
    background: var(--surface-lighter);
    border-bottom: 2px solid var(--primary-purple);
}

/* Hide Zoo text input by default - JavaScript will show it if Zoo is selected */
#textInputSection {
    display: none;
}

/* Show Hunyuan image input by default (matches default provider selection) */
#imageInputSection {
    display: block;
}

/* File upload area */
#imageDropZone,
#figurineDropZone,
#textTabDropZone {
    background: var(--surface-lighter) !important;
    border: 2px dashed var(--border-dark) !important;
    border-radius: 16px;
    transition: all 0.3s ease;
}

#imageDropZone:hover,
#figurineDropZone:hover,
#textTabDropZone:hover {
    border-color: var(--primary-purple) !important;
    background: var(--surface-dark) !important;
}

#imageDropZone.drag-over,
#figurineDropZone.drag-over,
#textTabDropZone.drag-over {
    border-color: var(--primary-purple) !important;
    background: var(--surface-dark) !important;
}

/* Alert styles */
.alert {
    border: none;
    border-radius: 12px;
    margin-bottom: var(--spacing);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    border-left-color: var(--success-green);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border-left-color: var(--danger-red);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-amber);
    border-left-color: var(--warning-amber);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

/* Progress bar styling */
.progress {
    background-color: var(--surface-lighter);
    border-radius: 12px;
    height: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-purple) 0%, var(--accent-blue) 100%);
    border-radius: 12px;
}

.generation-progress {
    width: 400px;
    max-width: 100%;
}

/* Text utilities */
.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-light) !important;
}

.text-engineering {
    color: var(--primary-purple) !important;
    font-weight: 600;
}

/* Empty state */
#emptyState h4 {
    color: var(--text-muted);
}

#emptyState p {
    color: var(--text-dim);
}

#emptyState i {
    color: var(--text-dim);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Text tab responsive layout - stack on mobile */
    .text-tab-container {
        flex-direction: column !important;
    }
    
    .text-tab-textarea,
    .text-tab-dropzone {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    /* Adjust textarea rows on mobile */
    #sculptPrompt {
        rows: 4;
    }
    
    .floating-add-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    /* Generation page mobile optimizations */
    .generation-status {
        padding: 2rem 1rem !important;
        min-height: 300px !important;
    }
    
    .generation-status-container {
        padding: 1rem !important;
    }
    
    .timer-number {
        font-size: 2rem !important;
    }
    
    .timer-display {
        padding: 0.75rem 1.5rem !important;
    }
    
    .generation-progress {
        width: 100% !important;
    }
    
    .generation-header {
        padding: 1rem !important;
    }
    
    .generation-header h4 {
        font-size: 1.25rem;
    }
    
    .generation-tips {
        max-width: 100% !important;
        padding: 0 1rem;
    }
    
    .status-text-container h3 {
        font-size: 1.25rem !important;
        padding: 0 10px !important;
    }
    
    body {
        overflow-y: auto;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding: 16px;
    }
}

/* Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.generating {
    animation: pulse 2s infinite;
}

/* Three.js Viewer Styles */
canvas {
    outline: none !important;
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--surface-dark);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow: visible; /* Allow dropdown menus to show */
}

.sidebar-content {
    padding: 24px 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Allow dropdowns in user profile area */
}

.sidebar-brand {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.sidebar-brand a {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.sidebar-brand a:hover {
    color: var(--primary-purple);
}

.sidebar-brand i {
    width: 28px;
    height: 28px;
    color: var(--primary-purple);
}

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.sidebar .nav-link:hover {
    color: var(--text-light);
    background: var(--surface-lighter);
    text-decoration: none;
}

.sidebar .nav-link.active {
    color: var(--primary-purple);
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.sidebar .nav-link i {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.nav-section {
    margin-bottom: 16px;
}

/* Make navigation scrollable but allow dropdowns to overflow */
.sidebar-nav {
    overflow-y: auto;
    overflow-x: visible; /* Allow dropdown menus to extend beyond sidebar */
    min-height: 0; /* Allow flexbox shrinking */
}

.sidebar-user {
    padding: 16px;
    background: var(--surface-lighter);
    border-radius: 16px;
    margin: 16px 0 0 0;
    flex-shrink: 0; /* Keep footer at bottom without shrinking */
    position: relative; /* Create positioning context for dropdown */
    z-index: 1100; /* Ensure dropdown shows above other content */
    overflow: visible; /* Allow dropdown menu to extend outside */
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.3;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
}

.sidebar-user .btn {
    padding: 8px;
    border-radius: 8px;
}

.sidebar-user .btn i {
    width: 16px;
    height: 16px;
}

/* Ensure dropdown menu shows above all other elements */
.sidebar-user .dropdown-menu {
    z-index: 9999 !important;
    background: var(--surface-lighter) !important;
    border: 2px solid var(--primary-purple) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    position: absolute !important;
}

/* Make sure the dropdown shows when it has the show class */
.sidebar-user .dropdown-menu.show {
    display: block !important;
}

.sidebar-user .dropdown-item {
    color: var(--text-light) !important;
}

.sidebar-user .dropdown-item:hover {
    background: var(--surface-dark) !important;
    color: var(--primary-purple) !important;
}

/* Main content with sidebar */
.main-content {
    min-height: calc(100vh - 56px);
    background: transparent;
    transition: margin-left 0.3s ease;
}

/* Add margin only when authenticated (has sidebar) */
body:not(.no-sidebar) .main-content {
    margin-left: 260px;
}

/* Main content without sidebar (logged out) */
body.no-sidebar .main-content {
    margin-left: 0 !important;
}

/* Responsive sidebar */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    /* Fix: Use higher specificity to override the default margin */
    body:not(.no-sidebar) .main-content,
    .main-content {
        margin-left: 0 !important;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    /* Backdrop for mobile sidebar */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
    }
}

.sidebar-toggle {
    display: none;
}

.sidebar-toggle i {
    width: 20px;
    height: 20px;
}

/* Page header for sidebar layout */
.page-header {
    padding: 32px 0 24px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 32px;
}

.page-header h2 {
    color: var(--text-light);
    font-weight: 700;
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    margin: 8px 0 0 0;
}

/* Utility classes */
.bg-engineering {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-blue) 100%) !important;
}

.border-engineering {
    border-color: var(--primary-purple) !important;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}