/* 
   FLORIAN ATMOSPHERIC THEMES 3.0 - ULTRA PREMIUM
   High-Fidelity Immersive Design System
   Zero Layout Shift Architecture
   Optimized for Performance & Visual Accuracy
*/

:root {
    --theme-accent: #00A651;
    --theme-accent-gradient: linear-gradient(135deg, #00A651, #00ff87);
    --brand-primary: #00A651;
    --brand-primary-rgb: 0, 166, 81;
    --glass-blur: 12px;
    /* Optimized from 20px to reduce GPU load */

    /* Sync with Settings System */
    --bg-color: #f2f2f7;
    --card-bg: rgba(255, 255, 255, 0.9);
}


/* --- THEME: FOREST (DEFAULT) --- */
html.theme-forest {
    --theme-accent: #10b981;
    --theme-accent-gradient: linear-gradient(135deg, #059669, #10b981);
    --theme-bg-main: #f0fdf4;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
}


html.theme-forest body {
    background:
        radial-gradient(circle at 0% 0%, rgb(166 235 212) 0%, #67b55a 50%),
        radial-gradient(circle at 100% 100%, rgb(255 255 255 / 10%) 0%, white 50%),
        #f8fafc !important;
}

html.theme-forest.dark-mode body {
    background:
        radial-gradient(circle at 20% 20%, #064e3b 0%, transparent 40%),
        #022c22 !important;
}

html.theme-forest .top-nav,
html.theme-forest .bottom-nav {
    background: rgb(17 87 0) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

html.theme-forest.dark-mode .top-nav,
html.theme-forest.dark-mode .bottom-nav {
    background: rgba(2, 44, 34, 0.8) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

html.theme-forest .bottom-nav .nav-item.active {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #10b981 !important;
}


/* --- THEME: WINTER (ARCTIC) --- */
html.theme-winter {
    --theme-accent: #0ea5e9;
    --theme-accent-gradient: linear-gradient(135deg, #0ea5e9, #38bdf8);
    --theme-nav-bg: rgba(240, 249, 255, 0.85);
    --bg-color: #f0f9ff;
    --card-bg: rgba(255, 255, 255, 0.6);
}


html.theme-winter body {
    background:
        radial-gradient(circle at 50% 0%, #6ac3ff 0%, #ffffff 100%) !important
}

html.theme-winter.dark-mode body {
    background:
        radial-gradient(circle at 50% 0%, #0c4a6e 0%, #082f49 100%) !important;
}

html.theme-winter .top-nav,
html.theme-winter .bottom-nav {
    background: rgb(89 154 197 / 98%) !important;
    border-color: rgba(14, 165, 233, 0.2) !important;
}

html.theme-winter.dark-mode .top-nav,
html.theme-winter.dark-mode .bottom-nav {
    background: rgba(8, 47, 73, 0.8) !important;
    border-color: rgba(14, 165, 233, 0.2) !important;
}

html.theme-winter .bottom-nav .nav-item.active {
    background-color: rgba(14, 165, 233, 0.2) !important;
    color: #0ea5e9 !important;
}


/* --- THEME: VOLCANO (MAGMA) --- */
html.theme-volcano {
    --theme-accent: #ef4444;
    --theme-accent-gradient: linear-gradient(135deg, #ef4444, #f97316);
    --theme-nav-bg: rgba(254, 242, 242, 0.9);
    --bg-color: #fff1f2;
    --card-bg: rgba(255, 255, 255, 0.75);
}


html.theme-volcano body {
    background:
        radial-gradient(circle at 50% 100%, #ff0000ba 0%, #3b0e11 100%) !important;
}

html.theme-volcano.dark-mode body {
    background:
        radial-gradient(circle at 50% 110%, #450a0a 0%, #1a0505 100%) !important;
}

html.theme-volcano .top-nav,
html.theme-volcano .bottom-nav {
    background: rgb(255 131 103) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

html.theme-volcano.dark-mode .top-nav,
html.theme-volcano.dark-mode .bottom-nav {
    background: rgba(26, 5, 5, 0.8) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

html.theme-volcano .bottom-nav .nav-item.active {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}


/* --- THEME: SAKURA (SPRING) --- */
html.theme-sakura {
    --theme-accent: #f472b6;
    --theme-accent-gradient: linear-gradient(135deg, #f472b6, #fb923c);
    --bg-color: #fff5f8;
    --card-bg: rgba(255, 253, 253, 0.7);
}


html.theme-sakura body {
    background:
        radial-gradient(circle at 0% 0%, #ff5ab4 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, #ff5ab4 0%, transparent 50%),
        #fff !important
}

html.theme-sakura.dark-mode body {
    background:
        radial-gradient(circle at 10% 10%, #500724 0%, transparent 50%),
        #1a050a !important;
}

html.theme-sakura .top-nav,
html.theme-sakura .bottom-nav {
    background: rgb(255 175 182) !important;
    border-color: rgba(244, 114, 182, 0.2) !important;
}

html.theme-sakura.dark-mode .top-nav,
html.theme-sakura.dark-mode .bottom-nav {
    background: rgba(26, 5, 10, 0.8) !important;
    border-color: rgba(244, 114, 182, 0.2) !important;
}

html.theme-sakura .bottom-nav .nav-item.active {
    background-color: rgba(244, 114, 182, 0.2) !important;
    color: #f472b6 !important;
}


/* --- THEME: CYBER (NEON) --- */
html.theme-cyber {
    --theme-accent: #22d3ee;
    --theme-accent-gradient: linear-gradient(135deg, #06b6d4, #22d3ee);
    --bg-color: #020617;
    --card-bg: rgba(15, 23, 42, 0.6);
}


html.theme-cyber body {
    background: #020617 !important;
    position: relative;
}

html.theme-cyber body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center center;
    pointer-events: none;
    z-index: 0;
}

html.theme-cyber .top-nav,
html.theme-cyber .bottom-nav {
    background: rgba(2, 6, 23, 0.85) !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1) !important;
}

html.theme-cyber .bottom-nav .nav-item.active {
    background-color: rgba(34, 211, 238, 0.2) !important;
    color: #22d3ee !important;
}


html.theme-cyber .nav-item.active {
    color: #22d3ee !important;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.8) !important;
}

/* --- THEME: MISTY (ETHEREAL) --- */
html.theme-misty {
    --theme-accent: #64748b;
    --theme-accent-gradient: linear-gradient(135deg, #475569, #94a3b8);
}

html.theme-misty body {
    background: linear-gradient(315deg, #43434300, #080808a6) !important;
}

html.theme-misty.dark-mode body {
    background: linear-gradient(to bottom, #0f172a, #1e293b) !important;
}

html.theme-misty .top-nav,
html.theme-misty .bottom-nav {
    background: rgb(122 125 129) !important;
    border-color: rgba(100, 116, 139, 0.2) !important;
}

html.theme-misty.dark-mode .top-nav,
html.theme-misty.dark-mode .bottom-nav {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(100, 116, 139, 0.2) !important;
}

html.theme-misty .bottom-nav .nav-item.active {
    background-color: rgba(100, 116, 139, 0.2) !important;
    color: #ffffff !important;
}


/* --- PARTICLE SYSTEM --- */
#atmospheric-particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
    contain: strict;
    /* Force browser to isolate this container */
}

.env-particle {
    position: absolute;
    will-change: transform, opacity;
    pointer-events: none;
}

/* Snowflake 2.0 */
.particle-snow {
    background: white;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.6;
    animation: fallSnow linear forwards;
}

/* Ember 2.0 */
.particle-ember {
    background: #fbbf24;
    box-shadow: 0 0 8px #f59e0b, 0 0 15px #ea580c;
    border-radius: 50%;
    animation: riseEmber linear forwards;
}

/* Sakura Petal 2.0 */
.particle-sakura {
    background: #fbcfe8;
    border-radius: 20px 2px 20px 2px;
    width: 12px !important;
    height: 12px !important;
    animation: fallSakura linear forwards;
}

/* Leaf 2.0 */
.particle-leaf {
    background: #4ade80;
    border-radius: 10px 0 10px 0;
    width: 10px !important;
    height: 10px !important;
    animation: fallLeaf linear forwards;
}

/* Animations - Using translate3d for GPU optimization */
@keyframes fallSnow {
    0% {
        transform: translate3d(0, -20px, 0) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    100% {
        transform: translate3d(var(--tx), 110vh, 0) scale(1);
        opacity: 0;
    }
}

@keyframes riseEmber {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translate3d(var(--tx), -110vh, 0) scale(0.5);
        opacity: 0;
    }
}

@keyframes fallSakura {
    0% {
        transform: translate3d(0, -20px, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    100% {
        transform: translate3d(var(--tx), 110vh, 0) rotateX(360deg) rotateY(720deg) rotateZ(180deg);
        opacity: 0;
    }
}

@keyframes fallLeaf {
    0% {
        transform: translate3d(0, -20px, 0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    100% {
        transform: translate3d(var(--tx), 110vh, 0) rotate(720deg);
        opacity: 0;
    }
}

/* GLOBAL UI POLISH */
.scroll-progress-bar {
    background: var(--theme-accent-gradient) !important;
    height: 4px !important;
    box-shadow: 0 0 15px var(--theme-accent) !important;
}

.nav-item.active {
    background: rgba(var(--brand-primary-rgb), 0.1) !important;
    color: var(--theme-accent) !important;
    font-weight: 700 !important;
}

.search-input:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 20px rgba(var(--brand-primary-rgb), 0.2) !important;
}

.btn-primary,
.add-to-cart-btn {
    background: var(--theme-accent-gradient) !important;
    box-shadow: 0 10px 20px rgba(var(--brand-primary-rgb), 0.2) !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-primary:active {
    transform: scale(0.95);
}

.section-title {
    color: var(--theme-accent) !important;
    letter-spacing: -0.5px !important;
    font-weight: 800 !important;
}

.view-all {
    color: var(--theme-accent) !important;
    font-weight: 600 !important;
}

/* --- PREMIUM THEME ADAPTATION OVERRIDES --- */
/* Ensures all custom components look perfect and accurate in every theme */
html:not(.theme-default) {
    color: #1e293b;
    /* Dark Slate for light modes */
}

html.dark-mode:not(.theme-default) {
    color: #f1f5f9;
    /* Ghost White for dark modes */
}

/* Section Title Refinement */
html:not(.theme-default) .section-title {
    color: #494949 !important;
    text-shadow: none !important;
}

html.dark-mode:not(.theme-default) .section-title {
    color: white !important;
}

/* Card Depth (Glassmorphism) - Optimized */
html:not(.theme-default) .product-card,
html:not(.theme-default) .news-card {
    background: rgb(68 175 66) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
    transform: translateZ(0);
    /* Force GPU */
}

html.dark-mode:not(.theme-default) .product-card,
html.dark-mode:not(.theme-default) .news-card,
html.dark-mode:not(.theme-default) .settings-group,
html.dark-mode:not(.theme-default) .setting-item {
    background: rgba(15, 23, 42, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    transform: translateZ(0);
    /* Force GPU */
}

/* Text Element Correction */
html:not(.theme-default) .product-name,
html:not(.theme-default) .category-item span,
html:not(.theme-default) .nursery-item span {
    color: #1e293b !important;
}

html.dark-mode:not(.theme-default) .product-name,
html.dark-mode:not(.theme-default) .category-item span,
html.dark-mode:not(.theme-default) .nursery-item span {
    color: white !important;
}

html:not(.theme-default) .nursery-name {
    color: var(--theme-accent) !important;
    opacity: 0.8;
}

html:not(.theme-default) .product-price {
    color: var(--theme-accent) !important;
}

/* Greeting Text Preservation */
html:not(.theme-default) .greeting-text h2 {
    color: white !important;
}

html:not(.theme-default) .greeting-text p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Interactive Element Correction */
html:not(.theme-default) .search-input {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #1e293b !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: blur(8px) !important;
}

html.dark-mode:not(.theme-default) .search-input {
    background-color: rgba(15, 23, 42, 0.6) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html:not(.theme-default) .search-icon,
html:not(.theme-default) .search-extra-icons {
    color: #ffffff !important;
}

html.dark-mode:not(.theme-default) .search-icon,
html.dark-mode:not(.theme-default) .search-extra-icons {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Rating Harmony */
html:not(.theme-default) .rating i {
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.3) !important;
}

/* Placeholder Color Correction */
html:not(.theme-default) .search-input::placeholder {
    color: rgba(71, 85, 105, 0.6) !important;
}

html.dark-mode:not(.theme-default) .search-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}


/* --- UNIVERSAL ICON VISIBILITY & HARMONY --- */
html:not(.theme-default) .bottom-nav .nav-icon,
html:not(.theme-default) .top-nav .chat-icon-img {
    filter: brightness(0) opacity(0.5);
    transition: all 0.3s ease;
}

html.dark-mode:not(.theme-default) .bottom-nav .nav-icon,
html.dark-mode:not(.theme-default) .top-nav .chat-icon-img {
    filter: brightness(0) invert(1) opacity(0.6);
}

html:not(.theme-default) .bottom-nav .nav-item.active .nav-icon,
html:not(.theme-default) .top-nav .chat-icon-container:active .chat-icon-img {
    filter: none !important;
    opacity: 1 !important;
}

/* Perfecting Active State Icon Tinting */
html.theme-winter .bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 5px #0ea5e9);
}

html.theme-volcano .bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 5px #ef4444);
}

html.theme-sakura .bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 5px #f472b6);
}

html.theme-cyber .bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 8px #22d3ee);
}

html.theme-forest .bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 5px #10b981);
}

/* Force clean white in dark themes active state for maximum pop */
html.dark-mode:not(.theme-default) .bottom-nav .nav-item.active .nav-icon {
    filter: brightness(0) invert(1) !important;
}