/* Modern CSS Variables */
:root {
    /* Color Palette - Soft Blue with Pink Accents */
    --primary-color: #5b8def;
    --primary-hover: #4a7ad8;
    --primary-light: #e8f2ff;
    --primary-gradient: linear-gradient(135deg, #6b9eff 0%, #5b8def 50%, #e8b4ff 100%);
    --accent-color: #6b9eff;
    --accent-hover: #5b8def;
    --accent-pink: #e8b4ff;
    --accent-pink-light: #f4d4ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Background Colors */
    --bg-primary: #f7f9fc;
    --bg-secondary: #f0f4f8;
    --bg-tertiary: #e7eef6;
    --card-background: #ffffff;
    --hover-background: #f0f7ff;
    --background-secondary: #f5f8fb;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 64px;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-light: #334155;
    --border-medium: #475569;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Layers */
.background-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

/* Layer 1: 3D House Animation (Deepest) */
.house-3d-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    perspective: 1000px;
    opacity: 0.15;
}

.house-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateHouse 40s linear infinite;
}

@keyframes rotateHouse {
    0% { transform: rotateY(0deg) rotateX(10deg); }
    100% { transform: rotateY(360deg) rotateX(10deg); }
}

/* Modern House Style */
.house-modern {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: morphToModern 40s ease-in-out infinite;
}

/* Base of the house */
.house-base {
    position: absolute;
    width: 200px;
    height: 150px;
    left: 50px;
    top: 100px;
    transform-style: preserve-3d;
}

.house-wall {
    position: absolute;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.house-wall.front {
    width: 200px;
    height: 150px;
    transform: translateZ(100px);
}

.house-wall.back {
    width: 200px;
    height: 150px;
    transform: rotateY(180deg) translateZ(100px);
}

.house-wall.left {
    width: 200px;
    height: 150px;
    transform: rotateY(-90deg) translateZ(100px);
}

.house-wall.right {
    width: 200px;
    height: 150px;
    transform: rotateY(90deg) translateZ(100px);
}

.house-wall.floor {
    width: 200px;
    height: 200px;
    transform: rotateX(-90deg) translateZ(75px);
    background: rgba(37, 99, 235, 0.1);
}

/* Roof */
.house-roof {
    position: absolute;
    width: 0;
    height: 0;
    left: 50px;
    top: 50px;
    transform-style: preserve-3d;
    animation: morphRoof 40s ease-in-out infinite;
}

.roof-side {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.roof-side.front {
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 80px solid rgba(147, 51, 234, 0.3);
    transform: translateZ(100px);
}

.roof-side.back {
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 80px solid rgba(147, 51, 234, 0.3);
    transform: rotateY(180deg) translateZ(100px);
}

.roof-side.left-slope {
    width: 200px;
    height: 80px;
    border: none;
    background: rgba(147, 51, 234, 0.2);
    transform: rotateY(-90deg) rotateX(30deg) translateZ(50px);
}

.roof-side.right-slope {
    width: 200px;
    height: 80px;
    border: none;
    background: rgba(147, 51, 234, 0.2);
    transform: rotateY(90deg) rotateX(-30deg) translateZ(50px);
}

/* Morphing animations for different house styles */
@keyframes morphRoof {
    0%, 100% { /* Traditional peaked roof */
        transform: translateY(0);
    }
    25% { /* Modern flat roof */
        transform: translateY(50px) scaleY(0.2);
    }
    50% { /* Contemporary slanted roof */
        transform: translateY(20px) rotateZ(15deg);
    }
    75% { /* Mansion style */
        transform: translateY(-20px) scaleY(1.3);
    }
}

@keyframes morphToModern {
    0%, 100% { /* Traditional house */
        opacity: 1;
    }
    25% { /* Modern house - more windows */
        opacity: 0.8;
    }
    50% { /* Contemporary */
        opacity: 0.9;
    }
    75% { /* Mansion */
        opacity: 0.85;
    }
}

/* Windows and doors */
.house-window {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.window-front-1 {
    width: 30px;
    height: 40px;
    top: 30px;
    left: 30px;
    transform: translateZ(101px);
}

.window-front-2 {
    width: 30px;
    height: 40px;
    top: 30px;
    right: 30px;
    transform: translateZ(101px);
}

.house-door {
    position: absolute;
    width: 40px;
    height: 60px;
    bottom: 0;
    left: 80px;
    background: rgba(236, 72, 153, 0.3);
    border: 1px solid rgba(236, 72, 153, 0.4);
    transform: translateZ(101px);
}

/* Layer 2: Gradient Animation (Middle) */
.gradient-animation {
    position: absolute;
    inset: -50%;
    background: linear-gradient(
        45deg,
        rgba(37, 99, 235, 0.1) 0%,
        rgba(147, 51, 234, 0.1) 25%,
        rgba(236, 72, 153, 0.1) 50%,
        rgba(59, 130, 246, 0.1) 75%,
        rgba(37, 99, 235, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
        transform: rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        transform: rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        transform: rotate(360deg);
    }
}

/* Layer 3: Floating Orbs */
.floating-orbs {
    position: absolute;
    inset: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    animation: floatOrb 20s ease-in-out infinite;
}

.orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.4) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation-duration: 25s;
}

.orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.4) 0%, transparent 70%);
    top: 60%;
    right: 10%;
    animation-duration: 30s;
    animation-delay: -10s;
}

.orb:nth-child(3) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, transparent 70%);
    bottom: 20%;
    left: 30%;
    animation-duration: 35s;
    animation-delay: -5s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Layer 4: Frosted Glass Overlay (Top) */
.glass-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Dark mode adjustments */
[data-theme="dark"] .glass-overlay {
    background: rgba(15, 23, 42, 0.7);
}

[data-theme="dark"] .house-wall {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .roof-side {
    border-bottom-color: rgba(147, 51, 234, 0.2);
}

[data-theme="dark"] .gradient-animation {
    background: linear-gradient(
        45deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(147, 51, 234, 0.05) 25%,
        rgba(236, 72, 153, 0.05) 50%,
        rgba(37, 99, 235, 0.05) 75%,
        rgba(59, 130, 246, 0.05) 100%
    );
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    z-index: var(--z-sticky);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base);
}

.logo-icon:hover {
    transform: scale(1.05);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    visibility: hidden;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .menu-label {
    opacity: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.menu-item i {
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
}

.menu-item span {
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    visibility: hidden;
}

.menu-item:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(107, 158, 255, 0.1) 0%, rgba(107, 158, 255, 0.05) 50%, rgba(232, 180, 255, 0.03) 100%);
    color: var(--primary-color);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6b9eff 0%, #5b8def 50%, #e8b4ff 100%);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-dot[data-status="disconnected"] {
    background: var(--danger-color);
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.sidebar-toggle {
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.sidebar-toggle:hover {
    background: var(--gray-100);
}

.sidebar-toggle i {
    transition: transform var(--transition-base);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* App Wrapper */
.app-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.sidebar.collapsed ~ .app-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: var(--z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: var(--gray-100);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb i {
    font-size: 0.75rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-action {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.topbar-action:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.user-menu {
    margin-left: 0.5rem;
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.user-menu-toggle:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gray-200);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

/* Main Content */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
}

/* View Container */
.view-container {
    display: none;
    animation: fadeIn var(--transition-slow);
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.view-title h1 {
    margin-bottom: 0.25rem;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Header Filters */
.header-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-background);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.filter-item i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.stylized-filter {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.stylized-filter:hover {
    background: var(--hover-background);
}

.stylized-filter:focus {
    outline: none;
    background: var(--hover-background);
    box-shadow: 0 0 0 2px var(--accent-color), 0 0 0 4px rgba(107, 158, 255, 0.1);
}

.clear-filters-btn {
    background: var(--danger-color);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.clear-filters-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.clear-filters-btn i {
    font-size: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 50%, #f093fb 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

/* Search Box */
.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-primary);
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Filter Select */
.filter-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: translateY(-100%);
    transition: transform var(--transition-base);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::before {
    transform: translateY(0);
}

.project-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Family Grid */
.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.family-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.family-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.family-preview {
    width: 100%;
    height: 120px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-tertiary);
}

.family-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-category {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Material Categories */
.material-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.category-tab:hover {
    color: var(--text-primary);
}

.category-tab.active {
    color: var(--primary-color);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Material Grid */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.material-swatch {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.material-swatch:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.material-swatch.selected {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.material-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

/* VR Container */
.vr-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: calc(100vh - var(--topbar-height) - 4rem);
    display: flex;
    flex-direction: column;
}

.vr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.vr-tools-left,
.vr-tools-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vr-tool {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.vr-tool:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.vr-tool.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.vr-separator {
    width: 1px;
    height: 24px;
    background: var(--border-light);
}

.vr-location {
    font-weight: 500;
    color: var(--text-primary);
}

.vr-viewport {
    flex: 1;
    position: relative;
    background: #000;
}

/* Material Swap Panel */
.material-swap-panel {
    position: absolute;
    right: 1rem;
    top: 5rem;
    width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateX(400px);
    transition: transform var(--transition-slow);
}

.material-swap-panel.active {
    transform: translateX(0);
}

.swap-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.swap-panel-header h3 {
    font-size: 1rem;
}

.close-panel {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.close-panel:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.swap-panel-content {
    padding: 1rem;
}

.selected-element {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.selected-element strong {
    display: block;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.material-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.material-option {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.material-option:hover {
    transform: scale(1.1);
}

.material-option.selected {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Schedule Preview */
.schedule-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.schedule-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.schedule-tab:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.schedule-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.schedule-table {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: var(--z-fixed);
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.fab i {
    transition: transform var(--transition-base);
}

.fab.active i {
    transform: rotate(45deg);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.fab-option:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-lg);
}

/* Loading Animation */
.loading-container {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
}

.loading-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    perspective: 800px;
}

.loading-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 2s infinite ease-in-out;
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.loading-cube .face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    opacity: 0.9;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.face.front { transform: translateZ(40px); }
.face.back { transform: rotateY(180deg) translateZ(40px); }
.face.top { transform: rotateX(90deg) translateZ(40px); }
.face.bottom { transform: rotateX(-90deg) translateZ(40px); }
.face.left { transform: rotateY(-90deg) translateZ(40px); }
.face.right { transform: rotateY(90deg) translateZ(40px); }

.loading-text {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width var(--transition-slow);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-tooltip);
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.5rem;
    min-width: 300px;
    animation: slideIn var(--transition-slow);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: var(--success-color);
    color: white;
}

.toast-error .toast-icon {
    background: var(--danger-color);
    color: white;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Modal */
.modal-wrapper {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
}

.modal-wrapper.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: fadeIn var(--transition-base);
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn var(--transition-slow);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.25rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Command Palette */
.command-palette {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-popover);
    animation: commandIn var(--transition-base);
}

@keyframes commandIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.command-input-wrapper {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.command-input-wrapper i {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.command-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: none;
    background: none;
    font-size: 1rem;
    outline: none;
}

.command-results {
    max-height: 400px;
    overflow-y: auto;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background var(--transition-base);
}

.command-item:hover {
    background: var(--gray-100);
}

.command-item-icon {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.command-item-content {
    flex: 1;
}

.command-item-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.command-item-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.command-item-shortcut {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ===== PROJECT CARDS STYLING ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    padding: 24px;
}

.project-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
    position: relative;
    transition: all var(--transition-base);
    cursor: pointer;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.project-status-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.project-status-badge.active {
    background: var(--success-color);
    color: white;
}

.project-status-badge.in-review {
    background: var(--warning-color);
    color: white;
}

.project-status-badge.construction {
    background: var(--primary-color);
    color: white;
}

.project-status-badge.planning {
    background: var(--gray-400);
    color: white;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.project-sync-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.project-hub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.project-stats {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.project-files {
    margin-bottom: 16px;
}

.files-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: 6px;
    font-size: 13px;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
}

.file-size {
    color: var(--text-secondary);
}

.more-files {
    padding: 8px 12px;
    text-align: center;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
}

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

.last-modified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.project-action-btn {
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-base);
}

.project-action-btn:hover {
    background: var(--primary-hover);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin: 16px 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .app-wrapper {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 640px) {
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .view-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-box {
        width: 100%;
    }
    
    .material-swap-panel {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        transform: translateY(100%);
    }
    
    .material-swap-panel.active {
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .fab-container,
    .modal-wrapper,
    .command-palette {
        display: none !important;
    }
    
    .app-wrapper {
        margin-left: 0 !important;
    }
    
    .main-content {
        padding: 0;
    }
}
/* User Menu Dropdown */

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    min-width: 220px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.user-menu.menu-open .user-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
}

.user-email {
    font-size: 13px;
    color: #95a5a6;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 5px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    margin-right: 10px;
    font-size: 18px;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateX(420px);
    transition: transform 0.3s ease;
}

.notification-panel.show {
    transform: translateX(0);
}

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

.notification-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-icon {
    margin-right: 15px;
    font-size: 24px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.notification-text {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0 0 5px 0;
}

.notification-time {
    color: #bdc3c7;
    font-size: 12px;
}

.notification-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.notification-footer a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

/* Sync View Styles */
.sync-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 2rem;
}

.sync-status {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.sync-status h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sync-log {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-height: 600px;
    overflow-y: auto;
}

/* Analytics View Styles */
.analytics-dashboard {
    padding: 2rem;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.analytics-card h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.analytics-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
}

.analytics-charts {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

/* 3DS Viewer Styles */
.threeds-viewer-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 20px;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
}

.upload-area h3 {
    margin: 15px 0 10px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#viewerCanvas {
    width: 100%;
    height: 600px;
    background: #1a1a1a;
    border-radius: 8px;
}

.model-info-panel {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 20px;
}

.model-info-panel h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

#modelStats, #materialsList {
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Family/Instance Database Manager Styles */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
}

.category-tab {
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    background: var(--card-background);
    border: 1px solid var(--border-light);
    border-bottom: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tab:hover {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f2ff 50%, #faf4ff 100%);
    border-color: #b3d1ff;
}

.category-tab.active {
    background: linear-gradient(135deg, #6b9eff 0%, #5b8def 50%, #d4b5ff 100%);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(107, 158, 255, 0.2), 0 1px 4px rgba(212, 181, 255, 0.15);
}

.category-tab .badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.2) 60%, rgba(255, 220, 255, 0.15) 100%);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    backdrop-filter: blur(4px);
}

.staging-area {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 30px;
}

.fixtures-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fixtures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.fixture-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
}

.fixture-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fixture-card.staged {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(107, 158, 255, 0.05) 50%, rgba(232, 180, 255, 0.03) 100%);
}

.fixture-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.fixture-title {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
}

.fixture-type {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.fixture-thumbnail {
    width: 100%;
    height: 150px;
    background: var(--background-secondary);
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fixture-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fixture-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
    font-size: 0.9em;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

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

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.fixture-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.fixture-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.fixture-actions button:hover {
    background: var(--hover-background);
}

.fixture-actions button.stage-btn {
    background: linear-gradient(135deg, #6b9eff 0%, #5b8def 60%, #d4b5ff 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 1px 3px rgba(107, 158, 255, 0.15), 0 1px 2px rgba(212, 181, 255, 0.1);
}

.qc-panel {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
    position: sticky;
    top: 20px;
}

.qc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.qc-stat {
    padding: 10px;
    text-align: center;
    background: var(--background-secondary);
    border-radius: 8px;
}

.qc-stat .label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.qc-stat .value {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
}

.qc-stat.error {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.qc-stat.warning {
    background: rgba(255, 204, 0, 0.1);
    color: #ffcc00;
}

.qc-stat.success {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.qc-issues {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.qc-issue {
    padding: 8px;
    margin-bottom: 8px;
    background: var(--background-secondary);
    border-radius: 6px;
    font-size: 0.9em;
}

.qc-actions {
    display: grid;
    gap: 10px;
}

.qc-actions button {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.qc-actions button.export {
    background: linear-gradient(135deg, #10b981 0%, #0ea968 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.qc-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trade-subcategories {
    display: none;
    padding: 10px 20px;
    background: var(--background-secondary);
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.trade-subcategories.show {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.trade-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.trade-item:hover {
    background: var(--hover-background);
    border-color: var(--accent-color);
}

.trade-item.active {
    background: linear-gradient(135deg, #6b9eff 0%, #5b8def 60%, #d4b5ff 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(107, 158, 255, 0.15), 0 1px 2px rgba(212, 181, 255, 0.1);
}

.validation-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.validation-indicator.valid {
    background: var(--success-color);
    color: white;
}

.validation-indicator.warning {
    background: #ffcc00;
    color: white;
}

.validation-indicator.error {
    background: #ff3b30;
    color: white;
}

.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f2ff 60%, #faf4ff 100%);
    border-color: #b3d1ff;
    box-shadow: 0 2px 4px rgba(107, 158, 255, 0.1), 0 1px 2px rgba(212, 181, 255, 0.08);
}

.btn-primary {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #6b9eff 0%, #5b8def 60%, #d4b5ff 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(107, 158, 255, 0.15), 0 1px 2px rgba(212, 181, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5b8def 0%, #4a7ad8 60%, #c4a5ff 100%);
    box-shadow: 0 4px 8px rgba(107, 158, 255, 0.25), 0 2px 4px rgba(212, 181, 255, 0.15);
    transform: translateY(-1px);
}

/* 3D Cube Animation */
@keyframes rotate3d {
    0% { 
        transform: rotateX(-20deg) rotateY(0deg) rotateZ(0deg); 
    }
    25% { 
        transform: rotateX(-20deg) rotateY(90deg) rotateZ(5deg); 
    }
    50% { 
        transform: rotateX(-20deg) rotateY(180deg) rotateZ(0deg); 
    }
    75% { 
        transform: rotateX(-20deg) rotateY(270deg) rotateZ(-5deg); 
    }
    100% { 
        transform: rotateX(-20deg) rotateY(360deg) rotateZ(0deg); 
    }
}

.css-3d-container:hover .cube-3d {
    animation-duration: 3s;
}

/* Loading spinner for Boxicons */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bx-spin {
    animation: spin 1s linear infinite;
}

/* ACC Viewer Modal Styles */
.acc-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.acc-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.acc-viewer-content {
    position: relative;
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.acc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.acc-viewer-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.acc-viewer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.acc-viewer-close:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.acc-viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--gray-50);
}

.loading-message, .error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.loading-message i, .error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.error-message i {
    color: var(--danger-color);
}

.loading-message p, .error-message p {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.loading-message small, .error-message small {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Dark mode adjustments for modal */
[data-theme="dark"] .acc-viewer-content {
    background: var(--gray-800);
}

[data-theme="dark"] .acc-viewer-header {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

[data-theme="dark"] .acc-viewer-container {
    background: var(--gray-900);
}

/* Enhanced Lava Lamp Loading Animation for Fixtures */
.fixtures-loading-state {
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.6s ease;
    margin: 0 auto;
    max-width: 500px;
}

/* Single Morphing Blob Container - No boundaries */
.liquid-loader {
    width: 300px;
    height: 300px;
    position: relative;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Allow blob to flow outside container */
}

/* Glossy/Frosty Overlay - Removed */
.liquid-loader::before {
    display: none; /* Remove the overlay entirely for organic look */
}

/* Glass Shine Effect */
.liquid-loader::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(ellipse at center,
        rgba(255, 255, 255, 0.5) 0%,
        transparent 70%);
    filter: blur(15px);
    z-index: 11;
    animation: shine 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shine {
    0%, 100% {
        opacity: 0.9;
        transform: translateX(0) translateY(0);
    }
    50% {
        opacity: 0.4;
        transform: translateX(10px) translateY(-10px);
    }
}

/* Single Morphing Blob - More Organic */
.liquid-morph {
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 30% 30%,
        rgba(150, 120, 255, 0.95) 0%,
        rgba(128, 100, 255, 0.85) 20%,
        rgba(255, 100, 200, 0.75) 40%,
        rgba(100, 200, 255, 0.65) 60%,
        rgba(107, 158, 255, 0.8) 100%);
    border-radius: 43% 57% 43% 57% / 43% 43% 57% 57%;
    animation:
        morphBlobOrganic 12s ease-in-out infinite,
        rotateBlob 20s linear infinite,
        floatBlob 8s ease-in-out infinite;
    filter: blur(8px);
    box-shadow:
        0 0 80px rgba(128, 100, 255, 0.8),
        0 0 120px rgba(107, 158, 255, 0.6),
        0 0 160px rgba(255, 100, 200, 0.4),
        inset 0 0 60px rgba(255, 255, 255, 0.3);
    will-change: transform, border-radius;
}

/* Only one blob - remove nth-child selectors */
.liquid-morph:only-child {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Add organic overlay for softer edges */
.liquid-morph::before {
    content: '';
    position: absolute;
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
    background: radial-gradient(circle at 60% 60%,
        rgba(255, 100, 200, 0.3) 0%,
        rgba(128, 100, 255, 0.2) 40%,
        rgba(107, 158, 255, 0.1) 100%);
    border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
    filter: blur(15px);
    animation: morphBlobOverlay 8s ease-in-out infinite alternate;
}

@keyframes morphBlobOverlay {
    0% {
        transform: rotate(0deg) scale(1);
        border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
    }
    100% {
        transform: rotate(180deg) scale(1.1);
        border-radius: 45% 55% 45% 55% / 55% 45% 55% 45%;
    }
}

@keyframes morphBlobOrganic {
    0%, 100% {
        border-radius: 43% 57% 43% 57% / 43% 43% 57% 57%;
        transform: translate(-50%, -50%) scale(1);
    }
    20% {
        border-radius: 62% 38% 62% 38% / 62% 62% 38% 38%;
        transform: translate(-50%, -50%) scale(1.08);
    }
    40% {
        border-radius: 38% 62% 44% 56% / 49% 51% 49% 51%;
        transform: translate(-50%, -50%) scale(0.96);
    }
    60% {
        border-radius: 56% 44% 56% 44% / 44% 56% 44% 56%;
        transform: translate(-50%, -50%) scale(1.04);
    }
    80% {
        border-radius: 48% 52% 38% 62% / 56% 44% 56% 44%;
        transform: translate(-50%, -50%) scale(0.98);
    }
}

@keyframes rotateBlob {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(-50%, -50%) rotate(120deg) scale(1.05);
    }
    66% {
        transform: translate(-50%, -50%) rotate(240deg) scale(0.95);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

@keyframes floatBlob {
    0%, 100% {
        filter: blur(0.5px) brightness(1);
    }
    25% {
        filter: blur(1px) brightness(1.1);
    }
    50% {
        filter: blur(0.8px) brightness(1.05);
    }
    75% {
        filter: blur(0.3px) brightness(0.95);
    }
}

.loading-progress {
    text-align: center;
    max-width: 400px;
}

.loading-progress h4 {
    color: var(--primary-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.loading-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--primary-color) 0%,
        var(--secondary-color) 50%,
        var(--primary-color) 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: shimmer 2s linear infinite;
    transition: width 0.5s ease;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.loading-status {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Smooth transition from loading to loaded */
.fixtures-transitioning {
    animation: fadeOut 0.5s ease forwards;
}

.fixtures-loaded {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Individual fixture card animation */
.fixture-card.loading-placeholder {
    background: linear-gradient(90deg,
        var(--gray-50) 0%,
        var(--gray-100) 50%,
        var(--gray-50) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    opacity: 0.7;
}

.fixture-card.loaded {
    animation: cardFadeIn 0.4s ease forwards;
    animation-delay: calc(var(--card-index, 0) * 50ms);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
