/* --- CSS Variables --- */
:root {
    --background: #000000;
    --primary: #6a11cb;
    --secondary: #eb337a;
    --accent1: #00f2fe;
    --accent2: #f5a623;
    --dark-text: #2c3e50;
    --light-text: #8a8a8a;
    
    /* Theme Variables - Dark (Modern Zinc) */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-card: #09090b;
    --bg-input: #18181b;
    --bg-hover: #27272a;
    --bg-active: #3f3f46;
    
    /* Text Colors - High Contrast for Accessibility */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-disabled: #52525b;
    --text-tertiary: #71717a;
    
    /* Border Colors */
    --border-color: #27272a;
    --border-light: #3f3f46;
    --border-focus: #6366f1;
    --border-hover: #3f3f46;
    
    /* Accent Colors - Refined Indigo */
    --accent-primary: #6366f1;
    --accent-secondary: #4f46e5;
    --accent-hover: #4338ca;
    --accent-active: #3730a3;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Shadow Colors - Refined */
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-glow: transparent;
    --shadow-sm: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.2);
    --shadow-lg: rgba(0, 0, 0, 0.3);
    
    /* Glowing Gradient Variables - Neutralized */
    --gradient-glow-1: transparent;
    --gradient-glow-2: transparent;
    --gradient-glow-3: transparent;
    --gradient-accent: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --gradient-card: var(--bg-card);
    
    /* Responsive Breakpoints - Mobile First */
    --breakpoint-mobile: 320px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
    --breakpoint-wide: 1440px;
    
    /* Touch-Friendly Sizing */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
    --touch-spacing: 12px;
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-hover: #f1f5f9;
    --bg-active: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;
    --text-tertiary: #64748b;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #6366f1;
    --border-hover: #cbd5e1;
    
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-glow: rgba(99, 102, 241, 0.2);
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    
    --gradient-glow-1: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    --gradient-glow-2: radial-gradient(circle at 80% 50%, rgba(129, 140, 248, 0.08) 0%, transparent 50%);
    --gradient-glow-3: radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

/* Custom Theme Support */
[data-theme="custom"] {
    /* Custom theme colors are applied via JavaScript */
}

/* ================================================
   ANIMATED DARK BACKGROUND WITH GLOWING ORBS
   ================================================ */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        var(--gradient-glow-1),
        var(--gradient-glow-2),
        var(--gradient-glow-3);
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Floating orbs animation */
.animated-orb {
    position: fixed;
    border-radius: 50%;
    /* filter blur removed for performance */
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translateZ(0);
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: 10%;
    left: 10%;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    top: 60%;
    right: 10%;
    animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    bottom: 20%;
    left: 50%;
    animation: float 18s ease-in-out infinite;
}

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

/* Particle Animation System */
.particle {
    position: fixed;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    will-change: transform, opacity;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift));
        opacity: 0;
    }
}

/* Ensure content is above background */
#root,
.home-page-container,
.dashboard-container,
.editor-container {
    position: relative;
    z-index: 1;
}

/* ================================================
   END ANIMATED DARK BACKGROUND
   ================================================ */

/* Light Theme */
[data-theme="light"],
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-hover: #4338ca;
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark Theme (explicit) - PITCH BLACK */
[data-theme="dark"],
.theme-dark {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-card: #0f0f0f;
    --bg-input: #1a1a1a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2a2a2a;
    --border-light: #3a3a3a;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-hover: #4f46e5;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Font Size Variants */
[data-font-size="small"] {
    font-size: 14px;
}

[data-font-size="medium"] {
    font-size: 16px;
}

[data-font-size="large"] {
    font-size: 18px;
}

[data-font-size="xlarge"] {
    font-size: 20px;
}

/* Custom Theme Support */
[data-theme="custom"] {
    /* Custom theme colors are set via JavaScript */
}

/* Screen Reader Optimization */
[data-screen-reader="true"] {
    /* Enhanced focus indicators for screen readers */
}

[data-screen-reader="true"] *:focus {
    outline: 3px solid var(--accent-primary) !important;
    outline-offset: 2px;
}

[data-screen-reader="true"] button,
[data-screen-reader="true"] a,
[data-screen-reader="true"] input,
[data-screen-reader="true"] select {
    min-height: 44px; /* Touch-friendly minimum */
}

/* High Contrast Mode Enhancements */
.high-contrast,
[data-high-contrast="true"] {
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --border-color: #ffffff;
    --accent-primary: #00ffff;
}

/* Reduced Motion */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* High Contrast */
.high-contrast {
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --border-color: #ffffff;
    --accent-primary: #818cf8;
}

/* Theme-aware backgrounds */
.theme-bg-primary { background-color: var(--bg-primary); }
.theme-bg-secondary { background-color: var(--bg-secondary); }
.theme-bg-card { background-color: var(--bg-card); }
.theme-text-primary { color: var(--text-primary); }
.theme-text-secondary { color: var(--text-secondary); }
.theme-border { border-color: var(--border-color); }

/* ================================================
   EXTRA FANCY DASHBOARD AMBIENT BACKGROUNDS
   ================================================ */

/* Extra Fancy OFF: Clean solid backgrounds */
html[data-extra-fancy="false"] body,
body.extra-fancy-disabled {
    background-image: none !important;
    background-color: var(--bg-primary, #09090b) !important;
}

html[data-theme="light"][data-extra-fancy="false"] body,
[data-theme="light"] body.extra-fancy-disabled,
html[data-theme="soft"][data-extra-fancy="false"] body,
[data-theme="soft"] body.extra-fancy-disabled,
html[data-theme="white"][data-extra-fancy="false"] body,
[data-theme="white"] body.extra-fancy-disabled {
    background-image: none !important;
    background-color: var(--bg-primary, #ffffff) !important;
}

/* Sidebar: Solid, Opaque Panel (No background image or transparency) */
.professional-sidebar {
    background-color: #09090b !important;
    background: #09090b !important;
    border-right: 1px solid #27272a !important;
}
html[data-theme="light"] .professional-sidebar,
html[data-theme="soft"] .professional-sidebar,
html[data-theme="white"] .professional-sidebar,
[data-theme="light"] .professional-sidebar {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

/* Extra Fancy ON (Default) - Dark Theme Content Views ONLY */
html:not([data-extra-fancy="false"]) #main-content,
html[data-extra-fancy="true"] #main-content,
body.extra-fancy-active #main-content,
html:not([data-extra-fancy="false"]) .layout-content-area,
html[data-extra-fancy="true"] .layout-content-area,
body.extra-fancy-active .layout-content-area,
html:not([data-extra-fancy="false"]) .home-page-container,
html[data-extra-fancy="true"] .home-page-container,
body.extra-fancy-active .home-page-container {
    background-color: #0b0f19 !important;
    background-image: 
        linear-gradient(to bottom, rgba(11, 15, 25, 0.08) 0%, rgba(11, 15, 25, 0.22) 100%),
        url('/dashboard_dark_bg.jpg') !important;
    background-size: 105% auto !important;
    background-position: center top !important;
    background-attachment: scroll !important;
    background-repeat: no-repeat !important;
}

/* Extra Fancy ON (Default) - Light / White Theme Content Views ONLY */
html[data-theme="light"]:not([data-extra-fancy="false"]) #main-content,
html[data-theme="light"][data-extra-fancy="true"] #main-content,
[data-theme="light"] body.extra-fancy-active #main-content,
html[data-theme="soft"]:not([data-extra-fancy="false"]) #main-content,
html[data-theme="soft"][data-extra-fancy="true"] #main-content,
html[data-theme="white"]:not([data-extra-fancy="false"]) #main-content,
html[data-theme="white"][data-extra-fancy="true"] #main-content,
html[data-theme="light"]:not([data-extra-fancy="false"]) .layout-content-area,
html[data-theme="light"][data-extra-fancy="true"] .layout-content-area,
[data-theme="light"] body.extra-fancy-active .layout-content-area,
html[data-theme="light"]:not([data-extra-fancy="false"]) .home-page-container,
html[data-theme="light"][data-extra-fancy="true"] .home-page-container {
    background-color: #f8fafc !important;
    background-image: 
        linear-gradient(to bottom, rgba(248, 250, 252, 0.05) 0%, rgba(241, 245, 249, 0.18) 100%),
        url('/dashboard_light_bg.jpg') !important;
    background-size: 105% auto !important;
    background-position: center top !important;
    background-attachment: scroll !important;
    background-repeat: no-repeat !important;
}

/* Extra Fancy OFF: Clean solid backgrounds */
html[data-extra-fancy="false"] #main-content,
html[data-extra-fancy="false"] .layout-content-area,
html[data-extra-fancy="false"] .home-page-container,
body.extra-fancy-disabled #main-content,
body.extra-fancy-disabled .layout-content-area,
body.extra-fancy-disabled .home-page-container {
    background-image: none !important;
    background-color: var(--bg-primary, #09090b) !important;
}
html[data-theme="light"][data-extra-fancy="false"] #main-content,
html[data-theme="light"][data-extra-fancy="false"] .layout-content-area,
html[data-theme="light"][data-extra-fancy="false"] .home-page-container,
[data-theme="light"] body.extra-fancy-disabled #main-content,
[data-theme="light"] body.extra-fancy-disabled .layout-content-area {
    background-image: none !important;
    background-color: #f8fafc !important;
}

/* Transparent child containers inside main content */
.content-area-wrapper,
#main-content > div,
.layout-content-area > div {
    background: transparent !important;
    background-color: transparent !important;
}

/* Optimized subtle Glassmorphism for cards in Extra Fancy Dark Mode */
html:not([data-extra-fancy="false"]) .theme-bg-card,
html[data-extra-fancy="true"] .theme-bg-card,
body.extra-fancy-active .theme-bg-card {
    background-color: rgba(18, 24, 38, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Optimized subtle Glassmorphism for cards in Extra Fancy Light Mode */
html[data-theme="light"]:not([data-extra-fancy="false"]) .theme-bg-card,
html[data-theme="light"][data-extra-fancy="true"] .theme-bg-card,
[data-theme="light"] body.extra-fancy-active .theme-bg-card,
html[data-theme="soft"]:not([data-extra-fancy="false"]) .theme-bg-card,
html[data-theme="white"]:not([data-extra-fancy="false"]) .theme-bg-card {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* ================================================
   RESPONSIVE FRAMEWORK - Mobile First
   ================================================ */

/* Touch-Friendly Sizing - Mobile Default */
button,
.btn,
.touch-target {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: var(--touch-spacing);
}

/* Responsive Container */
.container-responsive {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Grid */
.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

/* Responsive Flex */
.flex-responsive {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hide/Show Utilities */
.hide-mobile { display: none; }
.show-mobile { display: block; }
.hide-tablet { display: block; }
.show-tablet { display: none; }
.hide-desktop { display: block; }
.show-desktop { display: none; }

/* Tablet Breakpoint (768px+) */
@media (min-width: 768px) {
    .container-responsive {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        max-width: 768px;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .flex-responsive {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    /* Touch targets can be smaller on tablet */
    button,
    .btn,
    .touch-target {
        min-width: 40px;
        min-height: 40px;
        padding: 10px;
    }
    
    .hide-mobile { display: block; }
    .show-mobile { display: none; }
    .hide-tablet { display: none; }
    .show-tablet { display: block; }
}

/* Desktop Breakpoint (1024px+) */
@media (min-width: 1024px) {
    .container-responsive {
        padding-left: 2rem;
        padding-right: 2rem;
        max-width: 1024px;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .flex-responsive {
        gap: 2rem;
    }
    
    /* Desktop can use smaller touch targets */
    button,
    .btn,
    .touch-target {
        min-width: 36px;
        min-height: 36px;
        padding: 8px;
    }
    
    .hide-desktop { display: none; }
    .show-desktop { display: block; }
}

/* Wide Breakpoint (1440px+) */
@media (min-width: 1440px) {
    .container-responsive {
        max-width: 1440px;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Text Sizes */
.text-responsive-sm {
    font-size: 0.875rem;
}

.text-responsive-base {
    font-size: 1rem;
}

.text-responsive-lg {
    font-size: 1.125rem;
}

.text-responsive-xl {
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .text-responsive-sm { font-size: 0.875rem; }
    .text-responsive-base { font-size: 1rem; }
    .text-responsive-lg { font-size: 1.25rem; }
    .text-responsive-xl { font-size: 1.5rem; }
}

@media (min-width: 1024px) {
    .text-responsive-sm { font-size: 1rem; }
    .text-responsive-base { font-size: 1.125rem; }
    .text-responsive-lg { font-size: 1.5rem; }
    .text-responsive-xl { font-size: 2rem; }
}

/* Responsive Spacing */
.spacing-responsive {
    padding: 1rem;
}

@media (min-width: 768px) {
    .spacing-responsive {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .spacing-responsive {
        padding: 2rem;
    }
}

/* ================================================
   END RESPONSIVE FRAMEWORK
   ================================================ */

/* ================================================
   RESPONSIVE NAVIGATION
   ================================================ */

/* Hamburger Menu Button - Mobile Only */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.hamburger-menu span {
    width: 2rem;
    height: 0.25rem;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.hamburger-menu.open span:first-child {
    transform: rotate(45deg);
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Navigation Container - Mobile First */
.nav-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-primary);
}

.nav-links {
    display: none; /* Hidden on mobile by default */
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

.nav-links.mobile-open {
    display: flex;
}

.nav-link {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-primary);
}

/* Tablet and Desktop Navigation */
@media (min-width: 768px) {
    .hamburger-menu {
        display: none; /* Hide hamburger on tablet+ */
    }
    
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        display: flex; /* Always visible on tablet+ */
        flex-direction: row;
        gap: 1rem;
        margin-top: 0;
        width: auto;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        min-height: 40px;
    }
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 1rem 2rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-link {
        min-height: 36px;
    }
}

/* ================================================
   END RESPONSIVE NAVIGATION
   ================================================ */

/* ================================================
   RESPONSIVE EDITOR CANVAS
   ================================================ */

/* Mobile Editor Canvas - Full Width, Scrollable */
.editor-canvas-container {
    width: 100%;
    height: calc(100vh - 120px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Touch-friendly toolbar on mobile */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.editor-toolbar button {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: 0.75rem;
    font-size: 1rem;
}

/* Canvas zoom controls for mobile */
.canvas-zoom-controls {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.canvas-zoom-controls button {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Touch gesture support */
.canvas-touch-enabled {
    touch-action: none;
    user-select: none;
}

/* Tablet Editor Canvas */
@media (min-width: 768px) {
    .editor-canvas-container {
        height: calc(100vh - 80px);
    }
    
    .editor-toolbar button {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .canvas-zoom-controls {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Desktop Editor Canvas */
@media (min-width: 1024px) {
    .editor-canvas-container {
        height: calc(100vh - 60px);
    }
    
    .editor-toolbar button {
        min-width: 36px;
        min-height: 36px;
        padding: 0.5rem;
    }
    
    .canvas-zoom-controls button {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Mobile-specific canvas adjustments */
@media (max-width: 767px) {
    /* Stack editor panels vertically on mobile */
    .editor-grid-layout {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    .editor-left-panel,
    .editor-right-panel {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: 40vh;
        position: relative !important;
    }
    
    .editor-canvas-area {
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 auto !important;
        order: -1; /* Canvas first on mobile */
    }
}

/* ================================================
   END RESPONSIVE EDITOR CANVAS
   ================================================ */

/* ================================================
   RESPONSIVE SIDE PANELS
   ================================================ */

/* Mobile: Bottom Sheet Style Panels */
.side-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    max-height: 50vh;
    background-color: var(--bg-card);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    box-shadow: 0 -4px 12px var(--shadow-color);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 40;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-panel.open {
    transform: translateY(0);
}

/* Panel drag handle for mobile */
.panel-handle {
    width: 3rem;
    height: 0.25rem;
    background-color: var(--border-color);
    border-radius: 0.125rem;
    margin: 0.75rem auto;
    cursor: grab;
}

.panel-handle:active {
    cursor: grabbing;
}

/* Panel header for mobile */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
    z-index: 10;
}

.panel-close-btn {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Panel content */
.panel-content {
    padding: 1rem;
}

/* Tablet: Side panels become smaller bottom sheets */
@media (min-width: 768px) {
    .side-panel {
        height: 40vh;
        max-height: 40vh;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
    }
    
    .panel-close-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Desktop: Traditional side panels */
@media (min-width: 1024px) {
    .side-panel {
        position: static;
        height: 100vh;
        max-height: 100vh;
        transform: none;
        width: 320px;
        border-radius: 0;
        box-shadow: none;
        border-left: 1px solid var(--border-color);
    }
    
    .panel-handle {
        display: none; /* No drag handle on desktop */
    }
    
    .panel-header {
        position: static;
        border-bottom: 1px solid var(--border-color);
    }
    
    .panel-close-btn {
        min-width: 36px;
        min-height: 36px;
    }
}

/* Swipe gesture support for mobile panels */
.panel-swipeable {
    touch-action: pan-y;
}

/* Panel overlay for mobile */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 39;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.panel-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .panel-overlay {
        display: none; /* No overlay on desktop */
    }
}

/* ================================================
   END RESPONSIVE SIDE PANELS
   ================================================ */

/* ================================================
   RESPONSIVE PAGE LAYOUTS
   ================================================ */

/* Home Page Responsive */
.home-page {
    padding: 1rem;
}

.home-hero {
    text-align: center;
    padding: 2rem 1rem;
}

.home-hero-title {
    font-size: 2rem;
    line-height: 1.2;
}

.home-hero-subtitle {
    font-size: 1rem;
    margin: 1rem 0;
}

.home-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .home-page {
        padding: 1.5rem;
    }
    
    .home-hero {
        padding: 3rem 1.5rem;
    }
    
    .home-hero-title {
        font-size: 2.5rem;
    }
    
    .home-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .home-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .home-page {
        padding: 2rem;
    }
    
    .home-hero {
        padding: 4rem 2rem;
    }
    
    .home-hero-title {
        font-size: 3rem;
    }
    
    .home-hero-subtitle {
        font-size: 1.25rem;
    }
    
    .home-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Settings Page Responsive */
.settings-page {
    padding: 1rem;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .settings-page {
        padding: 1.5rem;
    }
    
    .settings-section {
        padding: 1.5rem;
    }
    
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .settings-page {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .settings-section {
        padding: 2rem;
    }
}

/* Orders Page Responsive */
.orders-page {
    padding: 1rem;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.order-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .orders-page {
        padding: 1.5rem;
    }
    
    .orders-list {
        gap: 1.5rem;
    }
    
    .order-card {
        padding: 1.5rem;
    }
    
    .order-details {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .orders-page {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .order-card {
        padding: 2rem;
    }
}

/* Cart Page Responsive */
.cart-page {
    padding: 1rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.cart-summary {
    position: sticky;
    bottom: 0;
    background-color: var(--bg-card);
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px var(--shadow-color);
}

@media (min-width: 768px) {
    .cart-page {
        padding: 1.5rem;
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 1.5rem;
        align-items: start;
    }
    
    .cart-items {
        gap: 1.5rem;
    }
    
    .cart-item {
        flex-direction: row;
        align-items: center;
        padding: 1.5rem;
    }
    
    .cart-summary {
        position: sticky;
        top: 1rem;
        bottom: auto;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px var(--shadow-color);
    }
}

@media (min-width: 1024px) {
    .cart-page {
        padding: 2rem;
        max-width: 1400px;
        margin: 0 auto;
        gap: 2rem;
    }
    
    .cart-item {
        padding: 2rem;
    }
    
    .cart-summary {
        padding: 1.5rem;
    }
}

/* Continue Page Responsive */
.continue-page {
    padding: 1rem;
}

.continue-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.continue-card {
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .continue-page {
        padding: 1.5rem;
    }
    
    .continue-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .continue-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .continue-page {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .continue-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .continue-card {
        padding: 2rem;
    }
}

/* ================================================
   END RESPONSIVE PAGE LAYOUTS
   ================================================ */

/* ================================================
   ORIENTATION CHANGE HANDLING
   ================================================ */

/* Portrait Orientation Styles */
@media (orientation: portrait) {
    .orientation-aware {
        flex-direction: column;
    }
    
    .editor-canvas-container {
        height: calc(100vh - 140px);
    }
    
    .side-panel {
        height: 60vh;
        max-height: 60vh;
    }
    
    /* Adjust toolbar for portrait */
    .editor-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Landscape Orientation Styles */
@media (orientation: landscape) {
    .orientation-aware {
        flex-direction: row;
    }
    
    .editor-canvas-container {
        height: calc(100vh - 80px);
    }
    
    /* On mobile landscape, use side panels instead of bottom sheets */
    @media (max-width: 767px) {
        .side-panel {
            position: fixed;
            left: auto;
            right: 0;
            top: 0;
            bottom: 0;
            width: 300px;
            max-width: 80vw;
            height: 100vh;
            max-height: 100vh;
            border-radius: 0;
            border-top-left-radius: 1rem;
            border-bottom-left-radius: 1rem;
            transform: translateX(100%);
        }
        
        .side-panel.open {
            transform: translateX(0);
        }
    }
}

/* Smooth transition for orientation changes */
.orientation-transition {
    transition: all 0.3s ease;
}

/* Prevent layout shift during orientation change */
@media (orientation: portrait) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

@media (orientation: landscape) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* iOS Safari specific fixes for orientation */
@supports (-webkit-touch-callout: none) {
    .editor-canvas-container {
        height: -webkit-fill-available;
    }
}

/* ================================================
   END ORIENTATION CHANGE HANDLING
   ================================================ */

/* ================================================
   COMPREHENSIVE RESPONSIVE IMPROVEMENTS
   ================================================ */

/* Mobile-First Typography */
body {
    font-size: 16px;
    line-height: 1.5;
}

h1 {
    font-size: 1.75rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.875rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.25rem;
    }
    
    h3 {
        font-size: 1.875rem;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Tables */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (min-width: 768px) {
    table {
        display: table;
    }
}

/* Responsive Forms */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    width: 100%;
    font-size: 14px;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    line-height: 1.5;
}

@media (min-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
    select,
    textarea {
        padding: 0.5rem 0.75rem;
    }
}

@media (min-width: 1024px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
    select,
    textarea {
        padding: 0.5rem 0.75rem;
    }
}

/* Responsive Buttons */
button,
.btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    button,
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
}

@media (min-width: 1024px) {
    button,
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Responsive Cards */
.card,
.dashboard-card {
    padding: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .card,
    .dashboard-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .card,
    .dashboard-card {
        padding: 2rem;
        margin-bottom: 2rem;
    }
}

/* Responsive Modals */
.modal {
    width: 95%;
    max-width: 95%;
    margin: 1rem auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .modal {
        width: 80%;
        max-width: 600px;
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .modal {
        width: 70%;
        max-width: 800px;
        padding: 2rem;
    }
}

/* Touch-Friendly Spacing */
.touch-spacing {
    margin: 0.75rem 0;
}

@media (min-width: 1024px) {
    .touch-spacing {
        margin: 0.5rem 0;
    }
}

/* Prevent Text Selection on Touch Devices */
.no-select-mobile {
    -webkit-user-select: none;
    user-select: none;
}

@media (min-width: 1024px) {
    .no-select-mobile {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Responsive Utility Classes */
.mobile-only {
    display: block;
}

.tablet-up {
    display: none;
}

.desktop-up {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-up {
        display: block;
    }
}

@media (min-width: 1024px) {
    .desktop-up {
        display: block;
    }
}

/* Responsive Padding Utilities */
.p-responsive {
    padding: 1rem;
}

.px-responsive {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-responsive {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

@media (min-width: 768px) {
    .p-responsive {
        padding: 1.5rem;
    }
    
    .px-responsive {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .py-responsive {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .p-responsive {
        padding: 2rem;
    }
    
    .px-responsive {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .py-responsive {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Responsive Margin Utilities */
.m-responsive {
    margin: 1rem;
}

.mx-responsive {
    margin-left: 1rem;
    margin-right: 1rem;
}

.my-responsive {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .m-responsive {
        margin: 1.5rem;
    }
    
    .mx-responsive {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
    
    .my-responsive {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .m-responsive {
        margin: 2rem;
    }
    
    .mx-responsive {
        margin-left: 2rem;
        margin-right: 2rem;
    }
    
    .my-responsive {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Safe Area Insets for Notched Devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .nav-container {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* ================================================
   END COMPREHENSIVE RESPONSIVE IMPROVEMENTS
   ================================================ */

/* Light theme specific overrides for settings page */
.theme-light .settings-section {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.theme-light .settings-section h2,
.theme-light .settings-section p.text-white {
    color: var(--text-primary);
}

.theme-light .settings-section p.text-slate-400,
.theme-light .settings-section .text-slate-400 {
    color: var(--text-secondary);
}

.theme-light .bg-slate-700,
.theme-light .bg-slate-800,
.theme-light .bg-slate-900 {
    background-color: var(--bg-secondary);
}

.sidebar-nav-item {
    transition: all 0.2s ease;
    color: var(--text-secondary);
}
.sidebar-nav-item:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}
.sidebar-nav-item.active {
    background-color: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}

.theme-light input,
.theme-light select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* ================================================
   GLOBAL LAYOUT FIX - Prevent horizontal overflow
   ================================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#root {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

/* ================================================
   EDITOR LAYOUT IMPROVEMENTS
   ================================================ */

/* Left Panel: fixed width, scrollable, non-resizable, non-movable */
.editor-left-panel {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
    flex-shrink: 0 !important;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    resize: none !important;
    position: relative !important;
    transition: none !important;
}

/* Remove hover expansion - keep fixed */
.editor-left-panel:hover {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
}

/* Right Panel: fixed width, scrollable, non-resizable, non-movable */
.editor-right-panel {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    flex-shrink: 0 !important;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    resize: none !important;
    position: relative !important;
    transition: none !important;
}

/* Remove hover expansion - keep fixed */
.editor-right-panel:hover {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}

/* Parent container for the editor panels and canvas */
.editor-grid-layout {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* Container for the canvas area - must fill remaining space and be stable */
.canvas-area-container {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Advanced Editor Canvas Area: scrollable and stable */
.editor-canvas-area,
.advanced-editor-container {
    flex: 1 !important;
    overflow: auto !important;
    position: relative !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Canvas wrapper: prevent collapse */
.canvas-wrapper {
    min-width: 400px !important;
    min-height: 400px !important;
}

/* Easy Editor Canvas: scrollable and full height */
.easy-editor-canvas-container {
    overflow: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Easy Editor main wrapper - ensure full viewport height */
.easy-editor-main-wrapper {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: row !important;
}

/* CRITICAL: Easy Editor layout - left panel fixed, canvas fills remaining */
@media (min-width: 768px) {
    .easy-editor-main-wrapper {
        display: flex !important;
        flex-direction: row !important;
        height: 100vh !important;
    }
    
    .easy-editor-left-panel {
        width: 400px !important;
        min-width: 400px !important;
        max-width: 450px !important;
        flex-shrink: 0 !important;
        height: 100vh !important;
        overflow-y: auto !important;
    }
    
    .easy-editor-canvas-container {
        flex: 1 1 0% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 0 !important;
        overflow: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Floating Contextual Toolbar - appears above canvas when object selected */
.animate-slide-down {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

/* Waiting states */
.loading,
.processing,
[aria-busy="true"] {
    cursor: wait !important;
}

/* Not allowed state */
.disabled,
[disabled],
[aria-disabled="true"] {
    cursor: not-allowed !important;
}

/* Zoom cursors */
.zoom-in {
    cursor: zoom-in;
}

.zoom-out {
    cursor: zoom-out;
}


/* --- Skip Link Styles --- */
.skip-to-content {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background-color: #4F46E5;
    color: white;
    padding: 1rem;
    z-index: 9999;
}

.skip-to-content:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    overflow: visible;
    text-decoration: none;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
        0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Modern Keyframe Animations --- */
@keyframes toast-in {
    0% {
        transform: translateY(-100%) scale(0.95);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-out {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100%) scale(0.95);
        opacity: 0;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Modern slide-up with gentle bounce */
@keyframes slide-up-gentle {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    60% {
        transform: translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scale entrance */
@keyframes scale-in-smooth {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modern tooltip appearance */
@keyframes tooltip-appear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Subtle float for decorative elements */
@keyframes float-subtle {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Gentle pulse for loading states */
@keyframes pulse-gentle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* --- Animation Utility Classes --- */
.animate-toast-in {
    animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-toast-out {
    animation: toast-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.animate-fade-in {
    animation: fade-in 0.4s ease-out;
}

.animate-slide-up {
    animation: slide-up-gentle 0.5s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

.animate-scale-in {
    animation: scale-in-smooth 0.3s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

.animate-tooltip-in {
    animation: tooltip-appear 0.2s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

.animate-float {
    animation: float-subtle 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse-gentle 2s ease-in-out infinite;
}

/* Staggered animations for lists */
.animate-stagger-1 {
    animation-delay: 50ms;
}

.animate-stagger-2 {
    animation-delay: 100ms;
}

.animate-stagger-3 {
    animation-delay: 150ms;
}

.animate-stagger-4 {
    animation-delay: 200ms;
}

.animate-stagger-5 {
    animation-delay: 250ms;
}

/* --- Onboarding Modal --- */
.onboarding-modal-backdrop {
    animation: fade-in 0.25s ease-out forwards;
}

.onboarding-modal-content {
    animation: scale-in-smooth 0.3s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

/* --- Editor Toggle --- */
.editor-side-toggle-active {
    background-color: #4F46E5;
    color: white;
    border-color: #4F46E5;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Template Gallery Cards (Full Gallery Page) --- */
.template-gallery-card {
    aspect-ratio: auto !important;
    height: 350px !important;
    max-height: 350px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.template-gallery-card .template-gallery-thumbnail-container {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    flex: 0 0 250px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(2, 6, 23, 0.8) !important;
    overflow: hidden !important;
}

.template-gallery-card .template-gallery-thumbnail-container img {
    max-height: 230px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* --- Editor Left Panel Template Mini Cards --- */
.editor-left-panel .template-card,
.template-card {
    aspect-ratio: 1014 / 639;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.template-card:hover {
    border-color: #4F46E5;
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.template-card-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-top: 0.5rem;
}

/* --- Editor Panels --- */
.editor-left-panel>div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-left-panel>div>.flex-grow {
    height: 100%;
    overflow-y: auto;
}

/* --- Custom Tooltip --- */
.custom-tooltip {
    position: fixed;
    background-color: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    animation: tooltip-appear 0.2s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

/* --- Grid Panels --- */
.editor-grid-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.625rem;
    padding: 0.25rem 0;
}

.editor-grid-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 0.5rem;
    background-color: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 0.75rem;
    color: var(--text-primary, #1e293b);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px;
    min-width: 52px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.editor-grid-button:hover {
    background-color: var(--bg-hover, #f8fafc);
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.editor-grid-button svg {
    width: 1.35rem;
    height: 1.35rem;
    margin-bottom: 0.35rem;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.editor-grid-button:hover svg {
    opacity: 1;
    transform: scale(1.08);
}

/* --- Canvas --- */
.canvas-wrapper {
    position: relative;
    width: fit-content;
    height: fit-content;
    margin: auto;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

canvas {
    display: block;
}

.canvas-container {
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* --- Toolbar Buttons --- */
.tool-button {
    background-color: var(--bg-card, #ffffff);
    color: var(--text-primary, #374151);
    padding: 0.5rem;
    border: 1px solid var(--border-color, #D1D5DB);
    border-radius: 0.625rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    cursor: pointer;
}

.tool-button:hover {
    background-color: var(--bg-hover, #E5E7EB);
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
    transform: translateY(-1px);
}

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

.tool-button:disabled:hover {
    background-color: white;
    transform: none;
}

.tool-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.tool-separator {
    width: 1px;
    height: 1.5rem;
    background-color: #D1D5DB;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

/* --- Dashboard Cards --- */
.dashboard-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.26, 0.64, 1);
    border: 1px solid transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dashboard-card:hover {
    box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 0.2);
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.1);
}

/* --- Easy Editor --- */
.easy-editor-step {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.easy-editor-step-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.easy-editor-frame-btn {
    width: 5rem;
    height: 5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    min-width: 44px;
}

.easy-editor-frame-btn:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.easy-editor-frame-btn.active {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.3);
}

/* --- Modern Loader (UPDATED) --- */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 40px;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* New Swatch Loader */
.creative-loader {
    display: grid;
    grid-template-columns: repeat(2, 60px);
    grid-template-rows: repeat(2, 60px);
    gap: 8px;
}

.swatch {
    width: 100%;
    height: 100%;
    background-color: var(--color);
    border-radius: 8px;
    transform-origin: center;
    opacity: 0;
    animation: swatch-animate 2.4s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes swatch-animate {

    0%,
    100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

/* End New Swatch Loader */


/* --- Loading Text (Unchanged) --- */
.loading-text-container {
    text-align: center;
}

.title-main {
    font-size: 22px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
    animation: fade-in 0.5s ease-out;
}

.title-sub {
    font-size: 15px;
    color: var(--light-text);
    position: relative;
    display: inline-block;
    width: 220px;
    height: 20px;
}

.loading-step {
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    animation: fade-text-smooth 4.8s ease-in-out infinite;
}

.loading-step:nth-child(1) {
    animation-delay: 0s;
}

.loading-step:nth-child(2) {
    animation-delay: 1.2s;
}

.loading-step:nth-child(3) {
    animation-delay: 2.4s;
}

.loading-step:nth-child(4) {
    animation-delay: 3.6s;
}

@keyframes fade-text-smooth {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0);
    }

    10%,
    90% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Homepage Styles --- */
.home-background-gradient {
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 600px;
    background: radial-gradient(ellipse at 50% -50%, rgba(99, 102, 241, 0.08), transparent 70%);
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.home-hero-title {
    background: linear-gradient(135deg, var(--primary, #6a11cb), #3b0769);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero-subtitle {
    font-size: 1.25rem;
    color: #4b5563;
    max-width: 600px;
    margin: 1rem auto 2rem auto;
}

/* --- Mode Selection Cards --- */
.mode-selection-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.26, 0.64, 1);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.mode-selection-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary, #6a11cb);
    box-shadow: 0 12px 24px -8px rgba(106, 17, 203, 0.25);
}

.mode-selection-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.mode-selection-card p {
    color: #6b7280;
    font-size: 0.875rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

/* --- Color Utilities --- */
.indigo-bg-light {
    background-color: #eef2ff;
}

.indigo-text {
    color: #4f46e5;
}

.indigo-hover-border:hover {
    border-color: #6366f1;
}

.teal-bg-light {
    background-color: #f0fdfa;
}

.teal-text {
    color: #0d9488;
}

.teal-hover-border:hover {
    border-color: #2dd4bf;
}

.purple-bg-light {
    background-color: #faf5ff;
}

.purple-text {
    color: #9333ea;
}

.purple-hover-border:hover {
    border-color: #a855f7;
}

.sky-bg-light {
    background-color: #f0f9ff;
}

.sky-text {
    color: #0284c7;
}

.sky-hover-border:hover {
    border-color: #38bdf8;
}

.green-bg-light {
    background-color: #f0fdf4;
}

.green-text {
    color: #16a34a;
}

.green-hover-border:hover {
    border-color: #4ade80;
}

.amber-bg-light {
    background-color: #fffbeb;
}

.amber-text {
    color: #d97706;
}

.amber-hover-border:hover {
    border-color: #fcd34d;
}

/* --- Mobile Navigation --- */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    animation: fade-in 0.25s ease-out;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    background-color: white;
    z-index: 50;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    transform: translateX(-100%);
    animation: slide-in-menu 0.3s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

@keyframes slide-in-menu {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes slide-out-menu {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.mobile-nav-menu.closing {
    animation: slide-out-menu 0.25s ease-in forwards;
}

/* --- Admin Styles --- */
.admin-stat-card {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-stat-card:hover {
    box-shadow: 0 4px 12px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.admin-stat-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    margin-right: 1.5rem;
}

.admin-stat-icon-wrapper svg {
    width: 1.75rem;
    height: 1.75rem;
}

.admin-stat-content h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.admin-stat-content p {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.admin-sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4b5563;
}

.admin-sidebar-nav-link:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.admin-sidebar-nav-link.active {
    background-color: #eef2ff;
    color: #4f46e5;
}

.admin-sidebar-nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

/* --- Auth Decorator --- */
.auth-decorator-gradient {
    background: linear-gradient(165deg, #4f46e5 0%, #06b6d4 100%);
}

.auth-decorator-text {
    position: relative;
    z-index: 10;
}

.auth-decorator-text h3 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-decorator-text p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-decorator-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* --- Custom Cursor (External URL) --- */
canvas {
    cursor: url('https://static.figma.com/app/cursors/cursor-default.png') 0 0, auto !important;
}

.canvas-wrapper:hover canvas {
    cursor: url('https://static.figma.com/app/cursors/cursor-pointer.png') 0 0, pointer !important;
}

/* --- Custom Context Menu --- */
.custom-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 4px;
    z-index: 10000;
    min-width: 180px;
    font-family: 'Inter', sans-serif;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    transition: all 0.15s ease;
}

.context-menu-item:hover:not(.disabled) {
    background-color: #f3f4f6;
    color: #4f46e5;
}

.context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 4px 0;
}


/* ================================================
   MODERN UI OVERHAUL - PHASE 5
   ================================================ */

/* Global rounded corners for inputs, buttons, and cards */
input,
select,
textarea {
    border-radius: 0.5rem !important;
}

button:not(.no-round) {
    border-radius: 0.5rem !important;
}

.dashboard-card {
    border-radius: 0.75rem !important;
}

/* Modal and panel rounded corners */
.modal-content,
.panel-container {
    border-radius: 1rem !important;
}

/* Editor panels rounded corners */
.editor-left-panel,
.editor-right-panel,
.editor-toolbar,
.easy-editor-step {
    border-radius: 0.75rem !important;
}

/* Professional dotted background for editors */
.editor-canvas-bg,
.advanced-editor-container,
.easy-editor-canvas-container {
    background-color: #f8f9fa;
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Canvas wrapper */
.canvas-wrapper {
    border-radius: 0.5rem !important;
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ================================================
   CANVAS STABILITY FIXES - CRITICAL
   ================================================ */

/* Prevent canvas shift when contextual toolbar appears */
.editor-main-container,
.easy-editor-main-container {
    overflow: hidden;
    position: relative;
}

/* CRITICAL: Fixed 3-column grid layout - middle column NEVER collapses */
/* Updated for responsive right panel */
.editor-grid-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr auto !important;
    overflow: hidden !important;
    max-width: 100vw !important;
    height: 100% !important;
}

/* CRITICAL: Left panel must be above canvas */
.editor-left-panel {
    flex-shrink: 0 !important;
    width: 280px !important;
    max-width: 280px !important;
    overflow-y: auto !important;
    z-index: 10 !important;
    position: relative !important;
    background: white !important;
}

/* CRITICAL: Canvas area container - ALWAYS visible, BEHIND panels */
/* Updated for full viewport dimensions */
.editor-canvas-area,
.easy-editor-canvas-area {
    flex: 1 !important;
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
}

/* CRITICAL: Canvas container must maintain size */
.canvas-area-container {
    position: relative !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important; /* Critical for flex children */
    overflow: hidden !important;
}

/* Advanced Editor TopBar - Fixed height to prevent canvas resize */
.advanced-editor-dark > div:first-child {
    flex-shrink: 0;
    min-height: 60px;
}

/* Contextual sub-toolbar fixed height */
.advanced-editor-dark > div:first-child > div:last-child {
    min-height: 52px !important;
    max-height: 52px !important;
}

/* Canvas area should not resize when topbar changes */
.editor-grid-layout {
    flex: 1;
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    height: calc(100vh - 112px); /* 60px main toolbar + 52px contextual toolbar */
}

/* Ensure canvas area fills available space */
.editor-canvas-area {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: auto !important;

    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
}

/* Floating toolbar should not affect layout */
.floating-toolbar,
.easy-editor-toolbars {
    position: absolute;
    z-index: 50;
}

/* Prevent right panel from going off-screen */
/* Updated for smart visibility */
.editor-right-panel {
    flex-shrink: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    transition: width 0.3s ease, max-width 0.3s ease !important;
}

.editor-right-panel.panel-open {
    width: 320px !important;
    max-width: 320px !important;

    overflow-y: auto !important;
    z-index: 10 !important;
    position: relative !important;
    background: white !important;
}

/* Stable canvas wrapper */
.fabric-canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================
   MODERN UI OVERHAUL - PHASE 5
   ================================================ */

/* Global rounded corners for inputs, buttons, and cards */
input,
select,
textarea {
    border-radius: 0.5rem !important;
}

button:not(.no-round) {
    border-radius: 0.5rem !important;
}

.dashboard-card {
    border-radius: 0.75rem !important;
}

/* Modal and panel rounded corners */
.modal-content,
.panel-container {
    border-radius: 1rem !important;
}

/* Editor panels rounded corners */
.editor-left-panel,
.editor-right-panel,
.editor-toolbar,
.easy-editor-step {
    border-radius: 0.75rem !important;
}

/* Professional dotted background for editors */
.editor-canvas-bg,
.advanced-editor-container,
.easy-editor-canvas-container {
    background-color: #f8f9fa;
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Canvas wrapper */
.canvas-wrapper {
    border-radius: 0.5rem !important;
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ================================================
   DARK THEME HOME PAGE STYLES (v4.0)
   Matches the landing page aesthetic
   ================================================ */

/* Dark Home Page Container */
.home-dark {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Mesh Background - FIXED: No overflow */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: var(--bg-primary);
    overflow: hidden;
    pointer-events: none;
}

.mesh-blob {
    position: absolute;
    /* filter blur removed for performance */
    opacity: 0.4;
    animation: blob 20s infinite alternate;
    border-radius: 50%;
}

/* FIXED: Use % instead of vw to prevent overflow */
.blob-1 {
    top: -15%;
    left: -15%;
    width: 45%;
    height: 45%;
    background: #6a11cb;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -15%;
    right: -15%;
    width: 45%;
    height: 45%;
    background: #2575fc;
    animation-delay: 2s;
}

.blob-3 {
    top: 35%;
    left: 35%;
    width: 25%;
    height: 25%;
    background: #b983ff;
    animation-delay: 4s;
    opacity: 0.25;
}

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

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    /* disabled for low-end PC: backdrop-filter */
    -webkit-/* disabled for low-end PC: backdrop-filter */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Gradient Text Glow */
.text-glow {
    background: linear-gradient(to right, #fff, #b983ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(185, 131, 255, 0.3);
}

/* Glow Colors */
:root {
    --glow-violet: #8b5cf6;
    --glow-purple: #a855f7;
    --glow-amber: #f59e0b;
    --glow-teal: #14b8a6;
    --glow-emerald: #10b981;
    --glow-blue: #3b82f6;
}

/* Scale In Animation */
@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scale-in 0.3s cubic-bezier(0.34, 1.26, 0.64, 1) forwards;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Landing Page Specific Styles */
.landing-scroll {
    scroll-behavior: smooth;
}

.glass-header {
    background: rgba(15, 23, 42, 0.7);
    /* disabled for low-end PC: backdrop-filter */
    -webkit-/* disabled for low-end PC: backdrop-filter */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass {
    background: rgba(255, 255, 255, 0.03);
    /* disabled for low-end PC: backdrop-filter */
    -webkit-/* disabled for low-end PC: backdrop-filter */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* 3D Tilt Effect */
.tilt-card {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

.tilt-content {
    transform: translateZ(20px);
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbar for Dark Theme */
.home-dark::-webkit-scrollbar,
.landing-scroll::-webkit-scrollbar {
    width: 8px;
}

.home-dark::-webkit-scrollbar-track,
.landing-scroll::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.home-dark::-webkit-scrollbar-thumb,
.landing-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.home-dark::-webkit-scrollbar-thumb:hover,
.landing-scroll::-webkit-scrollbar-thumb:hover {
    background: #6a11cb;
}

/* Mode Selection Card Styles */
.mode-selection-card {
    background: rgba(255, 255, 255, 0.03);
    /* disabled for low-end PC: backdrop-filter */
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mode-selection-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.mode-selection-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.mode-selection-card p {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Fade In Up Animation */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Page Transition */
@keyframes page-transition {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-page-transition {
    animation: page-transition 0.3s ease-out;
}

/* Brand Colors for Tailwind-like classes */
.from-brand { --tw-gradient-from: #6a11cb; }
.to-brand-dark { --tw-gradient-to: #2575fc; }
.text-brand-light { color: #b983ff; }
.bg-brand-deep { background-color: #1a0b2e; }
.border-brand { border-color: #6a11cb; }
.text-brand { color: #6a11cb; }
.bg-brand { background-color: #6a11cb; }


/* ================================================
   EDITOR DARK THEME STYLES (Subtle, Professional)
   ================================================ */

/* Easy Editor Dark Theme */
.easy-editor-dark {
    background: #1e293b;
    min-height: 100vh;
}

.easy-editor-dark .easy-editor-step {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.easy-editor-dark .easy-editor-step-header {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

.easy-editor-dark input,
.easy-editor-dark select,
.easy-editor-dark textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.easy-editor-dark input:focus,
.easy-editor-dark select:focus,
.easy-editor-dark textarea:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.easy-editor-dark label {
    color: #94a3b8;
}

.easy-editor-dark .text-gray-700,
.easy-editor-dark .text-gray-600 {
    color: #cbd5e1 !important;
}

.easy-editor-dark .text-gray-500 {
    color: #94a3b8 !important;
}

.easy-editor-dark .bg-white {
    background: #1e293b !important;
}

.easy-editor-dark .bg-gray-50,
.easy-editor-dark .bg-gray-100 {
    background: #0f172a !important;
}

.easy-editor-dark .border-gray-200,
.easy-editor-dark .border-gray-300 {
    border-color: #334155 !important;
}

/* Easy Editor Canvas Area Dark */
.easy-editor-dark .easy-editor-canvas-container {
    background: #0f172a;
    background-image: radial-gradient(circle, #334155 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Easy Editor Toolbar Dark */
.easy-editor-dark .tool-button {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.easy-editor-dark .tool-button:hover {
    background: #334155;
    border-color: #475569;
}

/* Advanced Editor Dark Theme */
.advanced-editor-dark {
    background: #1e293b;
    min-height: 100vh;
}

.advanced-editor-dark .editor-left-panel,
.advanced-editor-dark .editor-right-panel {
    background: #1e293b;
    border-color: #334155;
}

.advanced-editor-dark .editor-toolbar {
    background: #0f172a;
    border-color: #334155;
}

.advanced-editor-dark .tool-button {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.advanced-editor-dark .tool-button:hover {
    background: #334155;
}

.advanced-editor-dark input,
.advanced-editor-dark select,
.advanced-editor-dark textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.advanced-editor-dark .text-gray-700,
.advanced-editor-dark .text-gray-600 {
    color: #cbd5e1 !important;
}

.advanced-editor-dark .text-gray-500 {
    color: #94a3b8 !important;
}

.advanced-editor-dark .bg-white {
    background: #1e293b !important;
}

.advanced-editor-dark .bg-gray-50,
.advanced-editor-dark .bg-gray-100 {
    background: #0f172a !important;
}

.advanced-editor-dark .border-gray-200,
.advanced-editor-dark .border-gray-300 {
    border-color: #334155 !important;
}

/* Advanced Editor Canvas Area Dark */
.advanced-editor-dark .editor-canvas-area,
.advanced-editor-dark .advanced-editor-container {
    background: #0f172a;
    background-image: radial-gradient(circle, #334155 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Panel Headers Dark */
.easy-editor-dark h2,
.easy-editor-dark h3,
.advanced-editor-dark h2,
.advanced-editor-dark h3 {
    color: #f1f5f9;
}

/* Buttons in Dark Mode */
.easy-editor-dark button:not(.bg-indigo-600):not(.bg-emerald-600):not(.bg-red-600),
.advanced-editor-dark button:not(.bg-indigo-600):not(.bg-emerald-600):not(.bg-red-600) {
    color: #f1f5f9;
}

/* Template Cards Dark */
.easy-editor-dark .template-card,
.advanced-editor-dark .template-card {
    background: #0f172a;
    border-color: #334155;
}

.easy-editor-dark .template-card:hover,
.advanced-editor-dark .template-card:hover {
    border-color: #6366f1;
    background: #1e293b;
}

/* Dropdown/Select Dark */
.easy-editor-dark select option,
.advanced-editor-dark select option {
    background: #1e293b;
    color: #f1f5f9;
}

/* Scrollbar for Dark Editors */
.easy-editor-dark::-webkit-scrollbar,
.advanced-editor-dark::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.easy-editor-dark::-webkit-scrollbar-track,
.advanced-editor-dark::-webkit-scrollbar-track {
    background: #0f172a;
}

.easy-editor-dark::-webkit-scrollbar-thumb,
.advanced-editor-dark::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.easy-editor-dark::-webkit-scrollbar-thumb:hover,
.advanced-editor-dark::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Data Manager Page Dark */
.data-manager-dark {
    background: #1e293b;
    min-height: 100vh;
    color: #f1f5f9;
}

.data-manager-dark .bg-white {
    background: #1e293b !important;
    border: 1px solid #334155;
}

.data-manager-dark table {
    background: #1e293b;
}

.data-manager-dark th {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

.data-manager-dark td {
    border-color: #334155;
    color: #cbd5e1;
}

.data-manager-dark tr:hover {
    background: #0f172a;
}

/* Media Library Dark */
.media-library-dark {
    background: #1e293b;
    min-height: 100vh;
    color: #f1f5f9;
}

.media-library-dark .bg-white {
    background: #1e293b !important;
    border: 1px solid #334155;
}

/* Cart Page Dark */
.cart-dark {
    background: #1e293b;
    min-height: 100vh;
    color: #f1f5f9;
}

.cart-dark .bg-white {
    background: #1e293b !important;
    border: 1px solid #334155;
}

/* Orders Page Dark */
.orders-dark {
    background: #1e293b;
    min-height: 100vh;
    color: #f1f5f9;
}

.orders-dark .bg-white {
    background: #1e293b !important;
    border: 1px solid #334155;
}

/* ================================================
   FULL VIEWPORT RESPONSIVE LAYOUT FIX
   Ensures all pages fill the entire screen
   ================================================ */

/* Ensure html and body fill viewport */
html, body {
    min-height: 100vh !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Root container fills viewport */
#root {
    min-height: 100vh !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Page container utility class */
.page-container {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Responsive content wrapper */
.content-wrapper {
    width: 100%;
    max-width: 80rem; /* max-w-7xl equivalent */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .content-wrapper {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .content-wrapper {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ================================================
   HOMEPAGE SIMPLIFIED STYLES
   ================================================ */

/* Home page full viewport - Works with header/footer */
.home-page-container {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* When home page is full screen (no header/footer) */
.home-page-container.fullscreen {
    min-height: 100vh;
}

/* Ensure main element fills viewport for full page views */
main.flex-grow.flex.flex-1 {
    min-height: 100vh;
    width: 100%;
}

/* Fix for the root container when showing full page views */
#root > div.min-h-screen {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

/* Home action card - dark theme version */
.home-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.26, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.home-action-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Admin panel button */
.admin-panel-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transition: all 0.2s ease;
}

.admin-panel-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
}

.admin-panel-btn svg,
.admin-panel-btn i {
    width: 1.25rem;
    height: 1.25rem;
}

/* Hero section styles */
.home-hero {
    text-align: center;
    padding: 3rem 0 4rem;
}

.home-hero-title-dark {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary, #fff), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

[data-theme="light"] .home-hero-title-dark {
    background: linear-gradient(135deg, #1e1b4b, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .home-hero-title-dark {
        font-size: 3.5rem;
    }
}

.home-hero-subtitle-dark {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Section headers */
.home-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-section-title i,
.home-section-title svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #a78bfa;
}

/* Card icon container */
.card-icon-container {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon-container.indigo { background: rgba(99, 102, 241, 0.2); }
.card-icon-container.teal { background: rgba(20, 184, 166, 0.2); }
.card-icon-container.purple { background: rgba(168, 85, 247, 0.2); }
.card-icon-container.green { background: rgba(34, 197, 94, 0.2); }
.card-icon-container.amber { background: rgba(245, 158, 11, 0.2); }
.card-icon-container.sky { background: rgba(14, 165, 233, 0.2); }

.card-icon-container i,
.card-icon-container svg {
    width: 1.5rem;
    height: 1.5rem;
}

.card-icon-container.indigo i,
.card-icon-container.indigo svg { color: #818cf8; }
.card-icon-container.teal i,
.card-icon-container.teal svg { color: #2dd4bf; }
.card-icon-container.purple i,
.card-icon-container.purple svg { color: #c084fc; }
.card-icon-container.green i,
.card-icon-container.green svg { color: #4ade80; }
.card-icon-container.amber i,
.card-icon-container.amber svg { color: #fbbf24; }
.card-icon-container.sky i,
.card-icon-container.sky svg { color: #38bdf8; }

/* Card text styles */
.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: #94a3b8;
    flex-grow: 1;
}

/* Primary CTA button */
.home-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.home-cta-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.home-cta-btn i,
.home-cta-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Animated background for home - theme-aware */
.home-animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

[data-theme="light"] .home-animated-bg {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
}

/* Fade in up animation */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Stagger delays for cards */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }


/* ================================================
   LANDING PAGE FULL VIEW STYLES
   ================================================ */

/* Landing page must fill entire viewport */
.landing-scroll {
    min-height: 100vh !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Ensure main element fills viewport for full page views (landing, auth) */
main.flex-grow.flex.flex-1 {
    min-height: 100vh !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* Auth pages full viewport */
.font-inter > div.flex.h-screen {
    min-height: 100vh !important;
    width: 100% !important;
}

/* Orders page wrapper - ensure dark background covers full viewport */
.orders-page-wrapper {
    min-height: 100vh;
    width: 100%;
    background: #0f172a;
}

/* Fix for any white space issues on dark theme pages */
.bg-slate-900 {
    min-height: 100vh;
}

/* Ensure container fills available space */
.container.mx-auto {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 640px) {
    .container.mx-auto {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container.mx-auto {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container.mx-auto {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container.mx-auto {
        max-width: 1280px;
    }
}


/* ================================================
   SETTINGS PAGE STYLES
   ================================================ */

/* Settings page wrapper - ensure dark background covers full viewport */
.settings-page-wrapper {
    min-height: 100vh;
    width: 100%;
    background: #0f172a;
}

/* Settings page animations */
.settings-page-wrapper .animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Settings toggle switch */
.settings-page-wrapper button[class*="rounded-full"] {
    transition: background-color 0.2s ease;
}

/* Settings input focus states */
.settings-page-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #6366f1;
}

/* Settings section cards */
.settings-page-wrapper .bg-slate-800 {
    transition: all 0.2s ease;
}

.settings-page-wrapper .bg-slate-800:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Settings stats cards */
.settings-page-wrapper .bg-slate-700\/50 {
    transition: all 0.2s ease;
}

.settings-page-wrapper .bg-slate-700\/50:hover {
    background: rgba(51, 65, 85, 0.6);
}

/* Settings action buttons */
.settings-page-wrapper button[class*="bg-slate-700"]:hover {
    transform: translateY(-1px);
}

/* Settings danger button */
.settings-page-wrapper button[class*="bg-red-600"]:hover {
    background: rgba(220, 38, 38, 0.4);
}


/* ================================================
   DARK THEME EDITOR FIXES (v4.1)
   Fix remaining white backgrounds in dark mode
   ================================================ */

/* Fix white backgrounds in dark theme editors - more specific selectors */
.easy-editor-dark .bg-white,
.easy-editor-dark [class*="bg-white"],
.advanced-editor-dark .bg-white,
.advanced-editor-dark [class*="bg-white"] {
    background-color: #1e293b !important;
}

/* Fix gray backgrounds */
.easy-editor-dark .bg-gray-50,
.easy-editor-dark .bg-gray-100,
.easy-editor-dark .bg-gray-200,
.easy-editor-dark [class*="bg-gray-50"],
.easy-editor-dark [class*="bg-gray-100"],
.easy-editor-dark [class*="bg-gray-200"],
.advanced-editor-dark .bg-gray-50,
.advanced-editor-dark .bg-gray-100,
.advanced-editor-dark .bg-gray-200,
.advanced-editor-dark [class*="bg-gray-50"],
.advanced-editor-dark [class*="bg-gray-100"],
.advanced-editor-dark [class*="bg-gray-200"] {
    background-color: #0f172a !important;
}

/* Fix input backgrounds - exclude color and range inputs */
.easy-editor-dark input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]),
.easy-editor-dark select,
.easy-editor-dark textarea,
.advanced-editor-dark input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]),
.advanced-editor-dark select,
.advanced-editor-dark textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Fix button backgrounds - exclude colored buttons */
.easy-editor-dark button:not(.bg-indigo-600):not(.bg-emerald-600):not(.bg-red-600):not(.bg-teal-500):not(.bg-purple-600):not(.bg-blue-600):not(.bg-green-600):not([class*="bg-indigo"]):not([class*="bg-emerald"]):not([class*="bg-red"]):not([class*="bg-teal"]):not([class*="bg-purple"]):not([class*="bg-blue"]):not([class*="bg-green"]),
.advanced-editor-dark button:not(.bg-indigo-600):not(.bg-emerald-600):not(.bg-red-600):not(.bg-teal-500):not(.bg-purple-600):not(.bg-blue-600):not(.bg-green-600):not([class*="bg-indigo"]):not([class*="bg-emerald"]):not([class*="bg-red"]):not([class*="bg-teal"]):not([class*="bg-purple"]):not([class*="bg-blue"]):not([class*="bg-green"]) {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix toolbar and panel section backgrounds */
.easy-editor-dark .p-1\.5,
.easy-editor-dark .p-2,
.easy-editor-dark .p-3,
.easy-editor-dark .p-4,
.advanced-editor-dark .p-1\.5,
.advanced-editor-dark .p-2,
.advanced-editor-dark .p-3,
.advanced-editor-dark .p-4 {
    /* Only apply to elements that have white/gray backgrounds */
}

/* Fix specific panel backgrounds */
.easy-editor-dark .rounded-lg.bg-white,
.easy-editor-dark .rounded-xl.bg-white,
.easy-editor-dark .rounded-md.bg-white,
.advanced-editor-dark .rounded-lg.bg-white,
.advanced-editor-dark .rounded-xl.bg-white,
.advanced-editor-dark .rounded-md.bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix dropdown menus */
.easy-editor-dark .absolute.bg-white,
.easy-editor-dark [class*="dropdown"],
.advanced-editor-dark .absolute.bg-white,
.advanced-editor-dark [class*="dropdown"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix modal backgrounds */
.easy-editor-dark .fixed.bg-white,
.easy-editor-dark [class*="modal"],
.advanced-editor-dark .fixed.bg-white,
.advanced-editor-dark [class*="modal"] {
    background-color: #1e293b !important;
}

/* Fix text colors */
.easy-editor-dark .text-gray-900,
.easy-editor-dark .text-gray-800,
.easy-editor-dark .text-gray-700,
.advanced-editor-dark .text-gray-900,
.advanced-editor-dark .text-gray-800,
.advanced-editor-dark .text-gray-700 {
    color: #f1f5f9 !important;
}

.easy-editor-dark .text-gray-600,
.easy-editor-dark .text-gray-500,
.advanced-editor-dark .text-gray-600,
.advanced-editor-dark .text-gray-500 {
    color: #94a3b8 !important;
}

/* Fix border colors */
.easy-editor-dark .border-gray-200,
.easy-editor-dark .border-gray-300,
.easy-editor-dark .border-gray-100,
.easy-editor-dark [class*="border-gray"],
.advanced-editor-dark .border-gray-200,
.advanced-editor-dark .border-gray-300,
.advanced-editor-dark .border-gray-100,
.advanced-editor-dark [class*="border-gray"] {
    border-color: #334155 !important;
}

/* Fix divide colors */
.easy-editor-dark .divide-gray-200 > *,
.easy-editor-dark .divide-gray-100 > *,
.advanced-editor-dark .divide-gray-200 > *,
.advanced-editor-dark .divide-gray-100 > * {
    border-color: #334155 !important;
}

/* Fix ring colors on focus */
.easy-editor-dark input:focus,
.easy-editor-dark select:focus,
.easy-editor-dark textarea:focus,
.easy-editor-dark button:focus,
.advanced-editor-dark input:focus,
.advanced-editor-dark select:focus,
.advanced-editor-dark textarea:focus,
.advanced-editor-dark button:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
}

/* Fix placeholder text */
.easy-editor-dark input::placeholder,
.easy-editor-dark textarea::placeholder,
.advanced-editor-dark input::placeholder,
.advanced-editor-dark textarea::placeholder {
    color: #64748b !important;
}

/* Fix hover states */
.easy-editor-dark .hover\:bg-gray-50:hover,
.easy-editor-dark .hover\:bg-gray-100:hover,
.advanced-editor-dark .hover\:bg-gray-50:hover,
.advanced-editor-dark .hover\:bg-gray-100:hover {
    background-color: #334155 !important;
}

/* Fix shadow colors for dark theme */
.easy-editor-dark .shadow,
.easy-editor-dark .shadow-sm,
.easy-editor-dark .shadow-md,
.easy-editor-dark .shadow-lg,
.advanced-editor-dark .shadow,
.advanced-editor-dark .shadow-sm,
.advanced-editor-dark .shadow-md,
.advanced-editor-dark .shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}


/* ================================================
   ADDITIONAL DARK THEME EDITOR FIXES (v4.2)
   Ensure complete coverage for all white areas
   ================================================ */

/* Fix any remaining white backgrounds in panels */
.easy-editor-dark .panel,
.easy-editor-dark [class*="panel"],
.easy-editor-dark .sidebar,
.easy-editor-dark [class*="sidebar"],
.advanced-editor-dark .panel,
.advanced-editor-dark [class*="panel"],
.advanced-editor-dark .sidebar,
.advanced-editor-dark [class*="sidebar"] {
    background-color: #1e293b !important;
}

/* Fix toolbar backgrounds */
.easy-editor-dark .toolbar,
.easy-editor-dark [class*="toolbar"],
.advanced-editor-dark .toolbar,
.advanced-editor-dark [class*="toolbar"] {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

/* Fix property panel backgrounds */
.easy-editor-dark .property-panel,
.easy-editor-dark [class*="property"],
.advanced-editor-dark .property-panel,
.advanced-editor-dark [class*="property"] {
    background-color: #1e293b !important;
}

/* Fix accordion/collapsible sections */
.easy-editor-dark details,
.easy-editor-dark summary,
.easy-editor-dark [class*="accordion"],
.easy-editor-dark [class*="collapsible"],
.advanced-editor-dark details,
.advanced-editor-dark summary,
.advanced-editor-dark [class*="accordion"],
.advanced-editor-dark [class*="collapsible"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix tab panels */
.easy-editor-dark [role="tabpanel"],
.easy-editor-dark [class*="tab-content"],
.advanced-editor-dark [role="tabpanel"],
.advanced-editor-dark [class*="tab-content"] {
    background-color: #1e293b !important;
}

/* Fix card components */
.easy-editor-dark .card,
.easy-editor-dark [class*="card"]:not(.design-card),
.advanced-editor-dark .card,
.advanced-editor-dark [class*="card"]:not(.design-card) {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix list items */
.easy-editor-dark li,
.easy-editor-dark [class*="list-item"],
.advanced-editor-dark li,
.advanced-editor-dark [class*="list-item"] {
    background-color: transparent !important;
}

/* Fix hover states for list items */
.easy-editor-dark li:hover,
.easy-editor-dark [class*="list-item"]:hover,
.advanced-editor-dark li:hover,
.advanced-editor-dark [class*="list-item"]:hover {
    background-color: #334155 !important;
}

/* Fix color picker wrapper */
.easy-editor-dark [class*="color-picker"],
.advanced-editor-dark [class*="color-picker"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix slider/range backgrounds */
.easy-editor-dark input[type="range"],
.advanced-editor-dark input[type="range"] {
    background-color: transparent !important;
}

/* Fix checkbox and radio backgrounds */
.easy-editor-dark input[type="checkbox"],
.easy-editor-dark input[type="radio"],
.advanced-editor-dark input[type="checkbox"],
.advanced-editor-dark input[type="radio"] {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

/* Fix tooltip backgrounds */
.easy-editor-dark [class*="tooltip"],
.advanced-editor-dark [class*="tooltip"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Fix popover backgrounds */
.easy-editor-dark [class*="popover"],
.advanced-editor-dark [class*="popover"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Ensure canvas container has proper dark background */
.easy-editor-dark .canvas-container,
.easy-editor-dark [class*="canvas-wrapper"],
.advanced-editor-dark .canvas-container,
.advanced-editor-dark [class*="canvas-wrapper"] {
    background-color: #0f172a !important;
}

/* Fix any inline styles that might override */
.easy-editor-dark [style*="background: white"],
.easy-editor-dark [style*="background-color: white"],
.easy-editor-dark [style*="background: #fff"],
.easy-editor-dark [style*="background-color: #fff"],
.easy-editor-dark [style*="background: rgb(255"],
.advanced-editor-dark [style*="background: white"],
.advanced-editor-dark [style*="background-color: white"],
.advanced-editor-dark [style*="background: #fff"],
.advanced-editor-dark [style*="background-color: #fff"],
.advanced-editor-dark [style*="background: rgb(255"] {
    background-color: #1e293b !important;
}


/* ================================================
   ENHANCED CANVAS BACKGROUND (v15.0)
   Professional editor canvas with improved visuals
   ================================================ */

/* Advanced Editor Enhanced Canvas Background */
.advanced-editor-enhanced-canvas {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    background-image: 
        linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(148, 163, 184, 0.08) 19px, rgba(148, 163, 184, 0.08) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(148, 163, 184, 0.08) 19px, rgba(148, 163, 184, 0.08) 20px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    position: relative;
}

/* Canvas workspace distinction */
.canvas-workspace-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px;
}

/* Design area highlight */
.canvas-design-area {
    background: #ffffff;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    position: relative;
}

/* Grid overlay (optional, togglable) */
.canvas-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 9px, rgba(99, 102, 241, 0.1) 9px, rgba(99, 102, 241, 0.1) 10px),
        repeating-linear-gradient(90deg, transparent, transparent 9px, rgba(99, 102, 241, 0.1) 9px, rgba(99, 102, 241, 0.1) 10px);
    background-size: 10px 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.canvas-grid-overlay.active {
    opacity: 1;
}

/* Guide lines (shown during object movement) */
.canvas-guide-line {
    position: absolute;
    background: rgba(99, 102, 241, 0.6);
    pointer-events: none;
    z-index: 1000;
}

.canvas-guide-line.horizontal {
    height: 1px;
    left: 0;
    right: 0;
}

.canvas-guide-line.vertical {
    width: 1px;
    top: 0;
    bottom: 0;
}

/* Empty canvas visual cues */
.canvas-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.canvas-empty-state.hidden {
    opacity: 0;
}

.canvas-empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.canvas-empty-state-text {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.canvas-empty-state-hint {
    font-size: 14px;
    color: #94a3b8;
}

/* Adaptive contrast for light content */
.canvas-adaptive-light {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.canvas-adaptive-light .canvas-design-area {
    background: #ffffff;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Adaptive contrast for dark content */
.canvas-adaptive-dark {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.canvas-adaptive-dark .canvas-design-area {
    background: #1e293b;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Zoom level indicator */
.canvas-zoom-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    /* disabled for low-end PC: backdrop-filter */
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 100;
}

/* Canvas controls (grid toggle, etc.) */
.canvas-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.canvas-control-btn {
    background: rgba(255, 255, 255, 0.95);
    /* disabled for low-end PC: backdrop-filter */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.canvas-control-btn:hover {
    background: #ffffff;
    border-color: #6366f1;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.canvas-control-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

.canvas-control-btn svg {
    width: 16px;
    height: 16px;
}

/* Dark mode enhancements */
.advanced-editor-dark .advanced-editor-enhanced-canvas {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    background-image: 
        linear-gradient(135deg, #0f172a 0%, #020617 100%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(148, 163, 184, 0.05) 19px, rgba(148, 163, 184, 0.05) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(148, 163, 184, 0.05) 19px, rgba(148, 163, 184, 0.05) 20px);
}

.advanced-editor-dark .canvas-design-area {
    background: #1e293b;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.advanced-editor-dark .canvas-zoom-indicator,
.advanced-editor-dark .canvas-control-btn {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.advanced-editor-dark .canvas-control-btn:hover {
    background: #334155;
    border-color: #6366f1;
    color: #a5b4fc;
}

.advanced-editor-dark .canvas-control-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

.advanced-editor-dark .canvas-empty-state-text {
    color: #cbd5e1;
}

.advanced-editor-dark .canvas-empty-state-hint {
    color: #64748b;
}

/* Easy Editor Enhanced Canvas (simpler version) */
.easy-editor-enhanced-canvas {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.easy-editor-dark .easy-editor-enhanced-canvas {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .canvas-workspace-wrapper {
        padding: 20px;
    }
    
    .canvas-controls {
        top: 10px;
        right: 10px;
        gap: 4px;
    }
    
    .canvas-control-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .canvas-zoom-indicator {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Animation for canvas load */
@keyframes canvas-fade-in {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.canvas-design-area {
    animation: canvas-fade-in 0.3s ease-out;
}

/* ================================================
   END ENHANCED CANVAS BACKGROUND
   ================================================ */

/* =============================================
   Magical iPrintBD Text Effect
   ============================================= */

.magical-text-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 500px);
    height: 120px;
    cursor: pointer;
    z-index: 100;
    pointer-events: auto;
}

.magical-text {
    width: 100%;
    height: 100%;
}

.outline-text {
    font-family: 'Hind Siliguri', 'Poppins', sans-serif;
    font-size: 56px;
    font-weight: 800;
    letter-spacing: 3px;
    dominant-baseline: middle;
    transition: stroke-width 0.3s ease, filter 0.3s ease;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.magical-text-container:hover .outline-text {
    stroke-width: 3;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8));
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .magical-text-container {
        width: 90vw;
        height: 80px;
        bottom: 1rem;
    }
    
    .outline-text {
        font-size: 36px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .magical-text-container {
        height: 60px;
    }
    
    .outline-text {
        font-size: 28px;
        letter-spacing: 1px;
    }
}

/* --- Logo Styles --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-container img {
    transition: opacity 0.2s ease;
}

.logo-container img:hover {
    opacity: 0.8;
}

.logo-fallback {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Responsive Logo Sizing */
@media (min-width: 1024px) {
    /* Desktop: 200px width */
    .logo-container img {
        max-width: 200px;
        height: auto;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Tablet: 150px width */
    .logo-container img {
        max-width: 150px;
        height: auto;
    }
}

@media (max-width: 767px) {
    /* Mobile: 100px width */
    .logo-container img {
        max-width: 100px;
        height: auto;
    }
    
    .logo-fallback {
        font-size: 1.25rem;
    }
}

/* ================================================
   PERMANENT SIDEBAR LAYOUT - RESPONSIVE
   ================================================ */

/* CSS Variables for Sidebar Layout */
:root {
    --sidebar-width-desktop: 256px;
    --sidebar-width-mobile: 0px;
    --sidebar-transition-duration: 0.3s;
    --backdrop-opacity: 0.5;
}

/* Layout Container - Root Layout Component */
.layout-container {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Content Area Wrapper - Flexible Content Region */
.content-area-wrapper {
    flex: 1;
    width: 100%;
    min-width: 0; /* Prevents flex item from overflowing */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Content Area Scroll Container */
.content-area-scroll {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
}

/* Mobile Backdrop Overlay */
.mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, var(--backdrop-opacity));
    z-index: 40;
    opacity: 0;
    animation: fadeIn 0.2s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Menu Button */
.mobile-menu-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 30;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.2s ease;
}

.mobile-menu-button:hover {
    background-color: var(--bg-hover);
    transform: scale(1.05);
}

.mobile-menu-button:active {
    transform: scale(0.95);
}

/* Sidebar - Mobile Drawer Mode (Default) */
.professional-sidebar,
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width-desktop);
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--sidebar-transition-duration) ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sidebar Open State (Mobile) */
.professional-sidebar.open,
.sidebar.open {
    transform: translateX(0);
}

/* Smooth Transitions for Sidebar Open/Close */
.professional-sidebar,
.sidebar,
.mobile-backdrop,
.content-area-wrapper {
    transition-property: transform, opacity, width, margin-left;
    transition-duration: var(--sidebar-transition-duration);
    transition-timing-function: ease-in-out;
}

/* Content Area Loading State */
.content-area-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: var(--bg-primary);
}

.content-area-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Content Area Error State */
.content-area-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 2rem;
    background-color: var(--bg-primary);
}

.content-area-error h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.content-area-error p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.content-area-error button {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.content-area-error button:hover {
    background-color: var(--accent-hover);
}

/* Viewport Height Constraints */
.layout-container,
.content-area-wrapper,
.content-area-scroll,
.content-area-loading,
.content-area-error {
    max-height: 100vh;
    max-height: -webkit-fill-available; /* iOS Safari fix */
}

/* Mobile-Specific Adjustments */
@media (max-width: 767px) {
    /* Content area takes full width on mobile */
    .content-area-wrapper {
        width: 100%;
        margin-left: 0;
    }
    
    /* Sidebar is hidden by default, shown as drawer */
    .professional-sidebar,
    .sidebar {
        transform: translateX(-100%);
    }
    
    /* Sidebar open state */
    .professional-sidebar.open,
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px var(--shadow-color);
    }
    
    /* Mobile menu button visible */
    .mobile-menu-button {
        display: flex;
    }
    
    /* Adjust content padding for mobile menu button */
    .content-area-scroll {
        padding-top: 0;
    }
}

/* ================================================
   END PERMANENT SIDEBAR LAYOUT - RESPONSIVE
   ================================================ */

/* ================================================
   RESPONSIVE BREAKPOINTS - SIDEBAR LAYOUT
   ================================================ */

/* Tablet Breakpoint (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Sidebar becomes persistent but narrower */
    .professional-sidebar,
    .sidebar {
        position: relative;
        transform: translateX(0);
        width: var(--sidebar-width-desktop);
        flex-shrink: 0;
    }
    
    /* Content area adjusts for sidebar */
    .content-area-wrapper {
        width: calc(100% - var(--sidebar-width-desktop));
        margin-left: 0;
    }
    
    /* Hide mobile menu button */
    .mobile-menu-button {
        display: none;
    }
    
    /* No backdrop needed */
    .mobile-backdrop {
        display: none;
    }
    
    /* Adjust touch targets for tablet */
    .sidebar button,
    .sidebar a {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }
}

/* Desktop Breakpoint (1024px+) */
@media (min-width: 1024px) {
    /* Sidebar is always visible and persistent */
    .professional-sidebar,
    .sidebar {
        position: relative;
        transform: translateX(0);
        width: var(--sidebar-width-desktop);
        flex-shrink: 0;
        border-right: 1px solid var(--border-color);
    }
    
    /* Content area takes remaining space */
    .content-area-wrapper {
        width: calc(100% - var(--sidebar-width-desktop));
        margin-left: 0;
        flex: 1;
    }
    
    /* Hide mobile menu button */
    .mobile-menu-button {
        display: none;
    }
    
    /* No backdrop needed */
    .mobile-backdrop {
        display: none;
    }
    
    /* Desktop-optimized touch targets */
    .sidebar button,
    .sidebar a {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }
    
    /* Optimize scrolling performance */
    .content-area-scroll {
        will-change: scroll-position;
    }
}

/* Wide Desktop Breakpoint (1440px+) */
@media (min-width: 1440px) {
    /* Optionally increase sidebar width for wide screens */
    .professional-sidebar,
    .sidebar {
        width: var(--sidebar-width-desktop);
    }
    
    /* Content area adjusts accordingly */
    .content-area-wrapper {
        width: calc(100% - var(--sidebar-width-desktop));
    }
}

/* ================================================
   ORIENTATION-SPECIFIC ADJUSTMENTS
   ================================================ */

/* Portrait Orientation - Mobile */
@media (max-width: 767px) and (orientation: portrait) {
    /* Sidebar drawer takes more screen space in portrait */
    .professional-sidebar,
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
    /* Adjust content area for better readability */
    .content-area-scroll {
        padding: 1rem;
    }
    
    /* Larger touch targets in portrait */
    .sidebar button,
    .sidebar a {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Landscape Orientation - Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    /* Sidebar drawer is narrower in landscape */
    .professional-sidebar,
    .sidebar {
        width: 240px;
        max-width: 60vw;
    }
    
    /* Optimize vertical space */
    .content-area-scroll {
        padding: 0.75rem;
    }
    
    /* Compact touch targets in landscape */
    .sidebar button,
    .sidebar a {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Mobile menu button positioned to avoid notch */
    .mobile-menu-button {
        top: 0.5rem;
        left: 0.5rem;
    }
}

/* Tablet Portrait Orientation */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    /* Sidebar can be slightly wider in tablet portrait */
    .professional-sidebar,
    .sidebar {
        width: 280px;
    }
    
    .content-area-wrapper {
        width: calc(100% - 280px);
    }
}

/* Tablet Landscape Orientation */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    /* Standard sidebar width in tablet landscape */
    .professional-sidebar,
    .sidebar {
        width: var(--sidebar-width-desktop);
    }
    
    .content-area-wrapper {
        width: calc(100% - var(--sidebar-width-desktop));
    }
}

/* ================================================
   ACCESSIBILITY & REDUCED MOTION
   ================================================ */

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .professional-sidebar,
    .sidebar,
    .mobile-backdrop,
    .content-area-wrapper,
    .mobile-menu-button {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .professional-sidebar,
    .sidebar {
        border-right: 2px solid var(--border-color);
    }
    
    .mobile-menu-button {
        border: 2px solid var(--border-color);
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    /* Hide sidebar and navigation when printing */
    .professional-sidebar,
    .sidebar,
    .mobile-menu-button,
    .mobile-backdrop {
        display: none !important;
    }
    
    /* Content takes full width for printing */
    .content-area-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* Remove background colors for print */
    .layout-container,
    .content-area-scroll {
        background-color: white !important;
        color: black !important;
    }
}

/* ================================================
   END RESPONSIVE BREAKPOINTS - SIDEBAR LAYOUT
   ================================================ */

/* ================================================
   GLOBAL HITBOX FIX (ACCESSIBILITY & TOUCH)
   ================================================ */

/* Ensure minimum 44x44 touch targets for interactive elements without visually altering them */
button, 
[role="button"], 
.hitbox-expanded {
    position: relative;
}

/* We use ::before positioned relative to the center to guarantee a 44x44 area */
button::before, 
[role="button"]::before, 
.hitbox-expanded::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
    transform: translate(-50%, -50%);
    /* Transparent and behind child content (like icons) so it doesn't block their specific hovers if any */
    z-index: 0; 
}

/* Restored animated orbs specifically for the landing page */
.home-animated-bg .animated-orb,
.home-animated-bg .mesh-blob { 
    display: block !important; 
    opacity: 0.3 !important; 
    filter: blur(100px); 
}

/* Hide them inside the editor to prevent performance drops */
.editor-workspace .animated-orb, 
.editor-workspace .mesh-bg, 
.editor-workspace .mesh-blob { 
    display: none !important; 
    opacity: 0 !important; 
    animation: none !important; 
}
