/* ========================================
   PRODUCTS PAGE - Goal Selection Styles
   ======================================== */

/* Disable double-tap zoom on mobile */
html, body {
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for input fields */
input, textarea, select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Goal selection container (separate page) */
.goal-selection-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    background-color: #000;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    color: #00FF00;
    flex-direction: column;
    overflow: visible;
}

/* Hide goal selection page by default */
.goal-selection-container:not(.active) {
    display: none;
}

/* Goal content container - normal document flow */
.goal-content-container {
    margin: 0 auto;
    padding: 20px 1rem;
    max-width: 90rem;
    width: 100%;
    line-height: 1.6;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* PWA and mobile browser specific heights */
body.pwa-standalone .goal-content-container {
    min-height: 100vh;
    min-height: 100svh;
}

body.mobile-browser .goal-content-container {
    min-height: 100vh;
    min-height: 100svh;
}

/* Mobile: Force full height for proper mobile experience */
@media (max-width: 768px) {
    .goal-selection-container {
        min-height: 100vh;
        min-height: 100svh;
    }
    
    .goal-content-container {
        min-height: 100vh;
        min-height: 100svh;
    }
}

/* Goal content text (header) */
.goal-content-text {
    font-family: 'Orbitron', 'Rajdhani', 'Bebas Neue', 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-top: 0px;
    margin-bottom: 80px;
    color: #F5F5F5;
    text-align: center;
    padding-top: 12px;
    transition: opacity 0.3s ease;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    opacity: 0.95;
}

/* Fade out content text when scrolling */
.goal-content-text.fade-out {
    opacity: 0;
}

/* Dark theme text color */
html.theme-dark .goal-content-text { 
    color: #F5F5F5;
}

/* Light theme text color */
html.theme-light .goal-content-text { 
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    font-weight: 800;
}

/* Mobile responsive header text */
@media (max-width: 768px) {
    .goal-content-text {
        font-size: clamp(1.8rem, 7vw, 3rem);
        margin-top: 0px;
        margin-bottom: 60px;
        padding-top: 8px;
        letter-spacing: 0.12em;
    }
}

/* Mobile and PWA positioning */
@media (max-width: 480px) {
    .goal-content-text {
        margin-top: 0px;
        margin-bottom: 48px;
        padding-top: 4px;
    }
    
    .goal-content-container {
        padding-top: 0px;
    }
    
    /* PWA-specific minimal padding */
    @media (display-mode: standalone) {
        .goal-content-container {
            padding-top: 0px;
        }
        
        .goal-content-text {
            padding-top: 1px;
        }
    }
}

/* Goal tiles container */
.goal-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    max-width: 900px;
    width: 100%;
    margin-top: 12px;
    padding: 0 10px;
}

/* Individual goal tile */
.goal-tile {
    position: relative;
    background: #000;
    border: 2px solid #00FF00;
    border-radius: 54px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    aspect-ratio: 1/1;
    min-height: 165px;
}

.goal-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(250, 201, 41, 0.8);
    border-color: #fac929;
}

.goal-tile.selected {
    border-color: #fac929;
    border-width: 3px;
    box-shadow: 
        0 0 25px rgba(250, 201, 41, 0.9),
        0 0 40px rgba(250, 201, 41, 0.6),
        inset 0 0 0 2px rgba(250, 201, 41, 0.3);
    transform: translateY(-3px);
}

/* Enhanced selected text background visibility */
.goal-tile.selected .goal-tile-label {
    background: linear-gradient(
        180deg,
        rgba(250, 201, 41, 0.15) 0%,
        rgba(250, 201, 41, 0.20) 50%,
        rgba(250, 201, 41, 0.15) 100%
    );
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    color: #FFFFFF;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.3);
    text-stroke: 0.5px rgba(255, 255, 255, 0.3);
}

/* Enhanced selected lock icon */
.goal-tile.selected .goal-tile-lock {
    color: #fac929;
    text-shadow: 
        0 0 12px rgba(250, 201, 41, 0.8),
        0 0 24px rgba(250, 201, 41, 0.5);
    filter: drop-shadow(0 2px 6px rgba(250, 201, 41, 0.6));
    transform: translateX(-50%) scale(1.05);
}

/* Sophisticated photo animation for selected state */
.goal-tile.selected .goal-tile-image {
    overflow: hidden;
    position: relative;
}

.goal-tile.selected .goal-tile-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(250, 201, 41, 0.08) 0%,
        rgba(250, 201, 41, 0.04) 30%,
        rgba(250, 201, 41, 0.12) 60%,
        rgba(250, 201, 41, 0.06) 100%
    );
    opacity: 0;
    z-index: 5;
    animation: elegantShimmer 3s ease-in-out infinite;
}

.goal-tile.selected .goal-tile-image img {
    transform: scale(1.03);
    filter: brightness(1.1) contrast(1.05) saturate(1.15);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Elegant shimmer animation */
@keyframes elegantShimmer {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%) skewX(-15deg);
    }
    50% {
        opacity: 1;
        transform: translateX(100%) skewX(-15deg);
    }
}

/* Light theme photo enhancement */
html.theme-light .goal-tile.selected .goal-tile-image::before {
    background: linear-gradient(
        135deg,
        rgba(31, 117, 254, 0.06) 0%,
        rgba(31, 117, 254, 0.03) 30%,
        rgba(31, 117, 254, 0.10) 60%,
        rgba(31, 117, 254, 0.04) 100%
    );
}

html.theme-light .goal-tile.selected .goal-tile-image img {
    filter: brightness(1.08) contrast(1.03) saturate(1.12);
}

/* Mobile optimizations for photo animation */
@media (max-width: 768px) {
    .goal-tile.selected .goal-tile-image img {
        transform: scale(1.02);
        filter: brightness(1.08) contrast(1.03) saturate(1.12);
    }

    html.theme-light .goal-tile.selected .goal-tile-image img {
        filter: brightness(1.06) contrast(1.02) saturate(1.08);
    }

    .goal-tile.selected .goal-tile-image::before {
        animation: elegantShimmer 2.5s ease-in-out infinite;
    }
}

/* Tiny screen optimizations */
@media (max-width: 480px) {
    .goal-tile.selected .goal-tile-image img {
        transform: scale(1.015);
        filter: brightness(1.06) contrast(1.02) saturate(1.08);
    }

    html.theme-light .goal-tile.selected .goal-tile-image img {
        filter: brightness(1.04) contrast(1.01) saturate(1.05);
    }

    .goal-tile.selected .goal-tile-image::before {
        animation: elegantShimmer 2s ease-in-out infinite;
    }
}

/* PWA optimizations */
@media (display-mode: standalone) {
    .goal-tile.selected .goal-tile-image img {
        transform: scale(1.04);
        filter: brightness(1.12) contrast(1.06) saturate(1.18);
    }

    html.theme-light .goal-tile.selected .goal-tile-image img {
        filter: brightness(1.10) contrast(1.04) saturate(1.15);
    }

    .goal-tile.selected .goal-tile-image::before {
        animation: elegantShimmer 3.5s ease-in-out infinite;
    }
}

/* Goal tile image container */
.goal-tile-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-bottom: none;
}

.goal-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-opacity: 0.3 !important;
    background-color: #f0f0f0;
}

/* Crossfade images for HC-Chip tile */
.hc-chip-crossfade-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0 !important;
    transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hc-chip-crossfade-img.active {
    opacity: 1 !important;
}

/* Override any image loader classes for crossfade images */
.hc-chip-crossfade-img.image-loading,
.hc-chip-crossfade-img.image-loaded,
.hc-chip-crossfade-img.image-error,
.hc-chip-crossfade-img.image-intervention {
    transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: none !important;
}

.hc-chip-crossfade-img.active.image-loading,
.hc-chip-crossfade-img.active.image-loaded,
.hc-chip-crossfade-img.active.image-error,
.hc-chip-crossfade-img.active.image-intervention {
    opacity: 1 !important;
}

.hc-chip-crossfade-img:not(.active).image-loading,
.hc-chip-crossfade-img:not(.active).image-loaded,
.hc-chip-crossfade-img:not(.active).image-error,
.hc-chip-crossfade-img:not(.active).image-intervention {
    opacity: 0 !important;
}

/* Image loading states */
.goal-tile-image img.image-loading {
    opacity: 0.7;
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

.goal-tile-image img.image-error {
    opacity: 0.6 !important;
    filter: grayscale(20%) brightness(0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.goal-tile-image img.image-intervention {
    opacity: 0.8 !important;
    filter: brightness(0.95);
}

.goal-tile-image img.image-loaded {
    opacity: 1 !important;
    filter: none;
}

/* Dark theme adjustments for image states */
html.theme-dark .goal-tile-image img {
    background-color: #333;
}

html.theme-dark .goal-tile-image img.image-loading {
    background: linear-gradient(45deg, #333 25%, #444 25%, #444 50%, #333 50%, #333 75%, #444 75%);
    background-size: 20px 20px;
}

html.theme-dark .goal-tile-image img.image-error {
    border: 1px solid rgba(0, 255, 0, 0.2);
}

@keyframes loading-shimmer {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* No overlay needed */
.goal-tile-overlay {
    display: none;
}

/* Goal tile label - edge-to-edge design */
.goal-tile-label {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    height: auto;
    padding: 18px 0;
    
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    
    backdrop-filter: blur(8px) saturate(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    
    color: #FFFFFF;
    font-size: clamp(14px, 3.8vw, 22px);
    font-weight: 800;
    text-align: center;
    border: none;
    border-radius: 0;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.3);
    text-stroke: 0.5px rgba(255, 255, 255, 0.3);
    
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    
    z-index: 10;
    
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Lock icon styling */
.goal-tile-lock {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(16px, 4vw, 24px);
    color: #FFFFFF;
    z-index: 15;
    
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.6),
        0 0 16px rgba(255, 255, 255, 0.3);
    
    transition: all 0.3s ease;
}

/* Hover effect for enhanced interactivity */
.goal-tile:hover .goal-tile-label {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0.12) 100%
    );
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    color: #FFFFFF;
}

.goal-tile:hover .goal-tile-lock {
    transform: translateX(-50%) scale(1.1);
    text-shadow: 
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 24px rgba(255, 255, 255, 0.4);
}

/* Coming soon tile styling */
.goal-tile.coming-soon {
    opacity: 1;
    cursor: pointer;
}

.goal-tile.coming-soon:hover {
    opacity: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .goal-tiles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 100%;
        margin-top: 0px;
    }

    .goal-tile {
        min-height: 150px;
    }

    .goal-tile-label {
        font-size: clamp(12px, 3.5vw, 18px);
        padding: 16px 0;
        width: 100%;
        border-radius: 0;
        
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.10) 50%,
            rgba(255, 255, 255, 0.06) 100%
        );
        
        backdrop-filter: blur(6px) saturate(1.0);
        -webkit-backdrop-filter: blur(6px) saturate(1.0);
        
        color: #FFFFFF;
        
        -webkit-text-stroke: 0.3px rgba(255, 255, 255, 0.2);
        text-stroke: 0.3px rgba(255, 255, 255, 0.2);
        
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
    }

    .goal-tile-lock {
        font-size: clamp(14px, 3.5vw, 20px);
        bottom: 14px;
    }

    .goal-tile.selected {
        border-width: 2px;
        box-shadow: 
            0 0 20px rgba(250, 201, 41, 0.85),
            0 0 35px rgba(250, 201, 41, 0.5),
            inset 0 0 0 1px rgba(250, 201, 41, 0.25);
    }

    .goal-tile.selected .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(250, 201, 41, 0.12) 0%,
            rgba(250, 201, 41, 0.16) 50%,
            rgba(250, 201, 41, 0.12) 100%
        );
        
        -webkit-text-stroke: 0.3px rgba(255, 255, 255, 0.2);
        text-stroke: 0.3px rgba(255, 255, 255, 0.2);
    }

    .goal-content-text {
        margin-top: 8px;
        margin-bottom: 65px;
        font-size: clamp(1.6rem, 6vw, 2.5rem);
        letter-spacing: 0.1em;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .goal-tiles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .goal-tile {
        min-height: 135px;
    }

    .goal-tile-label {
        font-size: clamp(10px, 3vw, 16px);
        padding: 14px 0;
        width: 100%;
        border-radius: 0;
        
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.05) 100%
        );
        
        backdrop-filter: blur(4px) saturate(0.9);
        -webkit-backdrop-filter: blur(4px) saturate(0.9);
        
        color: #FFFFFF;
        
        -webkit-text-stroke: 0.2px rgba(255, 255, 255, 0.15);
        text-stroke: 0.2px rgba(255, 255, 255, 0.15);
        
        filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.1));
    }

    .goal-tile-lock {
        font-size: clamp(12px, 3vw, 18px);
        bottom: 12px;
    }

    .goal-tile.selected {
        border-width: 2px;
        box-shadow: 
            0 0 18px rgba(250, 201, 41, 0.8),
            0 0 30px rgba(250, 201, 41, 0.45),
            inset 0 0 0 1px rgba(250, 201, 41, 0.2);
    }

    .goal-tile.selected .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(250, 201, 41, 0.10) 0%,
            rgba(250, 201, 41, 0.14) 50%,
            rgba(250, 201, 41, 0.10) 100%
        );
        
        -webkit-text-stroke: 0.2px rgba(255, 255, 255, 0.15);
        text-stroke: 0.2px rgba(255, 255, 255, 0.15);
    }

    html.theme-light .goal-tile.selected {
        box-shadow: 
            0 0 20px rgba(31, 117, 254, 0.55),
            0 0 35px rgba(31, 117, 254, 0.3),
            inset 0 0 0 1px rgba(31, 117, 254, 0.15);
    }

    html.theme-light .goal-tile.selected .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(31, 117, 254, 0.12) 0%,
            rgba(31, 117, 254, 0.16) 50%,
            rgba(31, 117, 254, 0.12) 100%
        );
        
        -webkit-text-stroke: 0.3px rgba(255, 255, 255, 0.25);
        text-stroke: 0.3px rgba(255, 255, 255, 0.25);
    }

    .goal-content-text {
        font-size: clamp(1.4rem, 5vw, 2rem);
        letter-spacing: 0.08em;
    }
}

/* PWA adjustments */
@media (display-mode: standalone) {
    .goal-selection-container {
        padding-top: max(8vh, env(safe-area-inset-top, 60px));
    }
    
    .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.10) 0%,
            rgba(255, 255, 255, 0.14) 50%,
            rgba(255, 255, 255, 0.10) 100%
        );
        
        backdrop-filter: blur(9px) saturate(1.15);
        -webkit-backdrop-filter: blur(9px) saturate(1.15);
        
        color: #FFFFFF;
        
        -webkit-text-stroke: 0.6px rgba(255, 255, 255, 0.25);
        text-stroke: 0.6px rgba(255, 255, 255, 0.25);
        
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
        
        width: 100%;
    }

    .goal-tile-lock {
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.7),
            0 0 20px rgba(255, 255, 255, 0.4);
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    }

    .goal-tile.selected {
        border-width: 3px;
        box-shadow: 
            0 0 28px rgba(250, 201, 41, 0.9),
            0 0 45px rgba(250, 201, 41, 0.6),
            inset 0 0 0 2px rgba(250, 201, 41, 0.3);
    }

    .goal-tile.selected .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(250, 201, 41, 0.16) 0%,
            rgba(250, 201, 41, 0.22) 50%,
            rgba(250, 201, 41, 0.16) 100%
        );
        
        -webkit-text-stroke: 0.6px rgba(255, 255, 255, 0.25);
        text-stroke: 0.6px rgba(255, 255, 255, 0.25);
    }

    html.theme-light .goal-tile.selected {
        box-shadow: 
            0 0 32px rgba(31, 117, 254, 0.75),
            0 0 55px rgba(31, 117, 254, 0.45),
            inset 0 0 0 2px rgba(31, 117, 254, 0.25);
    }

    html.theme-light .goal-tile.selected .goal-tile-label {
        background: linear-gradient(
            180deg,
            rgba(31, 117, 254, 0.20) 0%,
            rgba(31, 117, 254, 0.28) 50%,
            rgba(31, 117, 254, 0.20) 100%
        );
        
        -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.4);
        text-stroke: 0.8px rgba(255, 255, 255, 0.4);
    }
}

/* Light theme overrides */
html.theme-light .goal-selection-container {
    background-color: #f8f8f8;
    color: #000000;
}

html.theme-light .goal-tile {
    background: #f8f8f8;
    border-color: #000000;
}

html.theme-light .goal-tile:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

html.theme-light .goal-tile.selected {
    border-color: #1F75FE;
    border-width: 3px;
    box-shadow: 
        0 0 30px rgba(31, 117, 254, 0.7),
        0 0 50px rgba(31, 117, 254, 0.4),
        inset 0 0 0 2px rgba(31, 117, 254, 0.25);
    transform: translateY(-3px);
}

html.theme-light .goal-tile.selected .goal-tile-label {
    background: linear-gradient(
        180deg,
        rgba(31, 117, 254, 0.18) 0%,
        rgba(31, 117, 254, 0.25) 50%,
        rgba(31, 117, 254, 0.18) 100%
    );
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    
    color: #FFFFFF;
    
    -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.4);
    text-stroke: 0.8px rgba(255, 255, 255, 0.4);
}

html.theme-light .goal-tile.selected .goal-tile-lock {
    color: #1F75FE;
    text-shadow: 
        0 0 10px rgba(31, 117, 254, 0.8),
        0 0 20px rgba(31, 117, 254, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 6px rgba(31, 117, 254, 0.5));
    transform: translateX(-50%) scale(1.05);
}

html.theme-light .goal-tile-label {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.12) 0%,
        rgba(0, 0, 0, 0.16) 50%,
        rgba(0, 0, 0, 0.12) 100%
    );
    
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    
    color: #FFFFFF;
    
    -webkit-text-stroke: 0.6px rgba(255, 255, 255, 0.35);
    text-stroke: 0.6px rgba(255, 255, 255, 0.35);
    
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

html.theme-light .goal-tile:hover .goal-tile-label {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.16) 0%,
        rgba(0, 0, 0, 0.20) 50%,
        rgba(0, 0, 0, 0.16) 100%
    );
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
}

/* ========================================
   BACK BUTTON - Bottom Navigation
   ======================================== */

.back-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    pointer-events: none;
    z-index: 100;
}

.back-button {
    /* Reset button styles */
    background: none;
    border: none;
    outline: none;
    
    /* Text styling */
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
    letter-spacing: 2px;
    color: #000000;
    
    /* Layout */
    padding: 12px 32px;
    cursor: pointer;
    pointer-events: auto;
    
    /* Professional subtle effects */
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Subtle shadow for depth */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    
    /* Invisible background that appears on hover */
    border-radius: 8px;
}

/* Pseudo-element for the hover/active background */
.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: -1;
    transform: scale(0.9);
}

/* Hover state - elegant elevation */
.back-button:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.back-button:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Active/Click state - subtle press */
.back-button:active {
    transform: translateY(1px);
    text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.2);
}

.back-button:active::before {
    opacity: 1;
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.08);
}

/* Unique ripple effect on click */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.back-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.back-button:active::after {
    animation: ripple 0.6s ease-out;
}

/* Dark theme styles */
html.theme-dark .back-button {
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}

html.theme-dark .back-button::before {
    background: rgba(255, 255, 255, 0.08);
}

html.theme-dark .back-button:hover {
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.15);
}

html.theme-dark .back-button:active {
    text-shadow: 0 0.5px 1px rgba(255, 255, 255, 0.2);
}

html.theme-dark .back-button:active::before {
    background: rgba(255, 255, 255, 0.12);
}

html.theme-dark .back-button::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

/* Light theme enhanced styles */
html.theme-light .back-button {
    color: #000000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

html.theme-light .back-button::before {
    background: rgba(0, 0, 0, 0.04);
}

html.theme-light .back-button:hover {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

html.theme-light .back-button:active::before {
    background: rgba(0, 0, 0, 0.06);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .back-button-container {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    }
    
    .back-button {
        font-size: clamp(13px, 3.5vw, 16px);
        padding: 10px 28px;
        letter-spacing: 1.5px;
    }
}

/* Tiny screens */
@media (max-width: 480px) {
    .back-button-container {
        padding: 14px;
        padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
    }
    
    .back-button {
        font-size: clamp(12px, 3.2vw, 14px);
        padding: 9px 24px;
        letter-spacing: 1.2px;
    }
}

/* PWA optimizations */
@media (display-mode: standalone) {
    .back-button-container {
        padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    }
    
    .back-button {
        font-size: clamp(15px, 3vw, 19px);
        padding: 13px 36px;
    }
}

