:root {
    --deep-charcoal: #1B1C1E;
    --absinthe-green: #B6FF9E;
    --muted-lavender: #9F8CC9;
    --glowing-teal: #5AF2D1;
    --pale-mint: #CFFFE3;
    --warning-red: #ff9e9e;
    --vapor-purple: #E2D9FF;
}

body.greenbottle {
    background-color: var(--deep-charcoal);
    color: var(--pale-mint);
    font-family: 'Fraunces', serif;
    overflow: hidden; /* Prevent scrolling */
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    margin: 0;
    padding: 0; /* Remove padding */
}

.greenbottle-container {
    width: 100%;
    max-width: 95%;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Allow content to overflow */
    margin: 55px auto 55px;
    position: relative; /* For proper stacking */
    z-index: 1;
}

.error-code {
    font-size: clamp(4rem, 10vw, 14rem);
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    margin-bottom: 1rem;
}

.flask {
    position: relative;
    display: inline-block;
    height: 1em;
    margin: 0 0.05em;
}

.flask svg {
    height: 100%;
    width: auto;
}

.flask .liquid {
    fill: var(--glowing-teal);
    filter: drop-shadow(0 0 10px var(--glowing-teal));
    animation: bubble 4s ease-in-out infinite;
}

.flask .bubbles circle {
    fill: rgba(255, 255, 255, 0.5);
    animation: float 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

@keyframes rise {
    0% { transform: translateY(0); opacity: 0.8; }
    100% { transform: translateY(-120px); opacity: 0; }
}

@keyframes continuous-rise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-120px); opacity: 0; }
}

.flask .rising-bubbles circle {
    fill: rgba(255, 255, 255, 0.4);
}

.rising-bubble {
    animation: continuous-rise 4s linear infinite;
}

.bottle-image .liquid {
    filter: none; /* Remove general filter */
}

.bottle-image .teal-liquid {
    filter: drop-shadow(0 0 8px var(--glowing-teal));
}

.bottle-image .lavender-liquid {
    filter: drop-shadow(0 0 8px var(--muted-lavender));
}

.bottle-image .green-liquid {
    filter: drop-shadow(0 0 8px var(--absinthe-green));
}

.bottle-image .shimmer {
    animation: shimmer 3s ease-in-out infinite;
}

.bottle-image .bubble {
    animation: float var(--float-duration, 3s) ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
    opacity: 0.6;
}

.disbanded-header {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    text-align: center;
    color: var(--warning-red);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.regulatory-detail {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    font-family: 'Manrope', sans-serif;
}

.status-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0; /* Allow child elements to shrink */
}

.wide-layout {
    display: flex;
    width: 100%;
    justify-content: space-between;
    flex: 1;
    overflow: visible;
}

.message-content {
    display: flex;
    width: 100%;
    gap: 1.5rem;
    position: relative; /* For proper overflow */
    z-index: 2;
}

.message-column {
    flex: 1;
    min-width: 240px; /* Smaller min-width */
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced gap */
    overflow: visible; /* Allow overflow */
}

.info-card {
    background: linear-gradient(180deg, rgba(27, 28, 30, 0.5) 0%, rgba(27, 28, 30, 0.8) 100%);
    border: 1px solid rgba(207, 255, 227, 0.1);
    border-radius: 8px;
    padding: 1rem; /* More compact cards */
    margin-bottom: 0.75rem; /* Reduced margin */
}

.info-card h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem; /* Smaller font */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.5rem 0; /* Reduced margin */
    color: var(--absinthe-green);
}

.info-card p {
    font-size: 0.85rem; /* Smaller font */
    line-height: 1.3; /* Reduced line height */
    margin-bottom: 0.3rem; /* Reduced margin */
}

.product-card {
    background-color: rgba(27, 28, 30, 0.5);
    border: 1px solid rgba(207, 255, 227, 0.2);
    border-radius: 8px;
    padding: 1rem; /* More compact cards */
    position: relative;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: scale(1.01);
    background: linear-gradient(180deg, 
        rgba(27, 28, 30, 0.5) 0%,
        rgba(255, 158, 158, 0.05) 100%);
}

.product-card .description {
    font-style: italic;
    opacity: 0.7;
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(255, 158, 158, 0.25);
    color: #ff9e9e;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.product-details {
    margin: 1rem 0;
}

.price {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: rgba(207, 255, 227, 0.7);
}

.description {
    font-size: 0.85rem;
    color: rgba(207, 255, 227, 0.7);
}

.disabled-btn {
    background-color: rgba(27, 28, 30, 0.5);
    border: 1px solid rgba(207, 255, 227, 0.2);
    color: rgba(207, 255, 227, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    cursor: not-allowed;
    opacity: 0.7;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.safety-notice {
    background-color: rgba(255, 180, 180, 0.1);
    border: 1px solid rgba(255, 180, 180, 0.2);
    padding: 1rem; /* More compact cards */
    border-radius: 8px;
    margin: 1rem 0;
    position: relative;
}

.safety-notice::before {
    content: "⚠️";
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.2rem;
    opacity: 0.5;
}

.vapor-warning {
    font-size: 0.75rem;
    color: var(--warning-red);
    margin-top: 0.5rem;
    font-style: italic;
}

.batch-codes {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.batch-codes span {
    background-color: rgba(255, 158, 158, 0.15);
    color: #ff9e9e;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 2rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.batch-codes span::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}

.batch-codes span:hover::before {
    left: 100%;
}

.batch-codes span:hover {
    color: var(--warning-red);
    text-shadow: 0 0 8px var(--warning-red);
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px; /* Fixed height */
    padding: 0 3rem;
    margin-bottom: 0;
    background: linear-gradient(to bottom, rgba(27, 28, 30, 0.98), rgba(27, 28, 30, 0.95));
    border-bottom: 1px solid rgba(207, 255, 227, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-sizing: border-box;
}

.nav-links {
    display: flex;
    gap: 2rem; /* More natural link spacing */
    justify-content: center;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.nav-links a, .account-links a, .footer-links a {
    color: var(--pale-mint);
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.nav-links a:hover, .account-links a:hover, .footer-links a:hover {
    opacity: 1;
    background: rgba(207, 255, 227, 0.05);
}

.nav-links.disabled a.inactive, 
.account-links.disabled a.inactive,
.footer-links.disabled a.inactive {
    color: rgba(207, 255, 227, 0.3);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-links::before, .nav-links::after {
    display: none; /* Remove the dot separators */
}

.account-links {
    min-width: 120px;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.logo {
    margin-top: 0.25rem; /* Add top margin to logo */
    height: 32px;
    display: flex;
    align-items: center;
    min-width: 180px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 1;
}

.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px; /* Fixed height */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    background: linear-gradient(to top, rgba(27, 28, 30, 0.95), rgba(27, 28, 30, 0.8));
    border-top: 1px solid rgba(207, 255, 227, 0.1);
    backdrop-filter: blur(5px);
    z-index: 10;
}

.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
}

.footer-center {
    position: relative;
    padding: 0 2rem;
    font-size: 0.7rem;
    opacity: 0.7;
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-center::before, .footer-center::after {
    content: "✧";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
}

.footer-center::before { left: 0.5rem; }
.footer-center::after { right: 0.5rem; }

.archive-link {
    color: var(--pale-mint);
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.archive-link:hover {
    opacity: 0.9;
}

.archive-link::before {
    content: '←';
    margin-right: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

/* Remove old positioned archive link */
.site-footer {
    display: none; /* Hide the old footer */
}

@media (min-height: 800px) {
    .greenbottle-container {
        justify-content: space-between;
    }
}

@media (max-height: 800px) {
    .greenbottle-container {
        transform: none;
    }
}

@media (max-height: 700px) {
    .greenbottle-container {
        transform: none;
    }
}

@media (max-height: 600px) {
    .error-code {
        font-size: clamp(3rem, 8vw, 10rem);
        margin-bottom: 0.75rem;
    }

    .bottle-visual {
        height: 160px;
    }

    .greenbottle-container {
        margin: 60px auto 60px;
    }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none; /* Hide nav links on mobile */
    }

    .message-content {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-center {
        font-size: 0.6rem;
        padding: 0 1rem;
    }

    .footer-right {
        display: none;
    }

    .fixed-footer {
        padding: 0.75rem 1.5rem;
    }

    .error-code {
        font-size: clamp(4rem, 15vw, 20rem);
    }

    .bottle-visual {
        height: 180px; /* Smaller bottles on mobile */
    }
}

@media (max-width: 480px) {
    .account-links {
        display: none;
    }

    .logo span {
        font-size: 0.9rem;
    }

    .greenbottle-container {
        margin: 60px auto 80px;
    }
}

/* Enhanced Mobile Compatibility */
@media (max-width: 600px) {
    .error-code {
        font-size: clamp(3rem, 12vw, 6rem);
        margin-bottom: 0.5rem;
    }
    
    .disbanded-header {
        font-size: 1rem;
    }
    
    .regulatory-detail {
        font-size: 0.7rem;
        padding: 0 0.5rem;
    }
    
    .info-card, .product-card, .safety-notice {
        padding: 0.75rem;
    }
    
    .batch-codes {
        gap: 0.3rem;
    }
    
    .batch-codes span {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .bottle-visual {
        height: 140px; /* Further reduced height for smaller screens */
        gap: 0;
    }
    
    .bottle-image {
        width: 100px; /* Narrower bottles */
    }
    
    .label-tag {
        top: 125px; /* Reposition labels for smaller bottles */
    }
}

@media (max-width: 380px) {
    .error-code {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .flask {
        height: 0.9em;
    }
    
    .status-banner {
        margin-bottom: 1rem;
    }
    
    .bottle-visual {
        height: 120px; /* Even smaller for tiny screens */
    }
    
    .bottle-image {
        width: 80px;
    }
    
    .label-tag {
        font-size: 0.45rem;
        top: 105px;
    }
    
    .recall-stamp {
        font-size: 1.8rem;
        border: 3px solid var(--warning-red);
        padding: 0.3rem 1.5rem;
    }
    
    .fixed-footer {
        height: 40px;
        padding: 0 1rem;
    }
    
    .footer-center {
        font-size: 0.55rem;
    }
    
    .archive-link {
        font-size: 0.7rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    /* Enhance tap targets for touch devices */
    .nav-links a, .account-links a, .footer-links a {
        padding: 0.5rem;
    }
    
    .disabled-btn {
        padding: 0.7rem 1rem;
    }
    
    /* Add visible focus states for touch */
    .batch-codes span:active {
        color: var(--warning-red);
        text-shadow: 0 0 8px var(--warning-red);
    }
    
    /* Fix for iOS viewport issues */
    body.greenbottle {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow-y: auto; /* Allow scrolling within the body */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    /* Ensure better tap area for interactive elements */
    .action-buttons {
        margin-top: 1.5rem;
    }
    
    .action-buttons button {
        min-height: 44px;
    }
}

/* Fix for landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .greenbottle-container {
        margin: 50px auto 50px;
    }
    
    .error-code {
        font-size: clamp(2rem, 6vw, 3rem);
        margin-bottom: 0.5rem;
    }
    
    .bottle-visual {
        height: 100px;
    }
    
    .label-tag {
        top: 85px;
    }
    
    .site-nav {
        height: 40px;
    }
    
    .fixed-footer {
        height: 40px;
    }
    
    .status-banner {
        margin-bottom: 0.5rem;
    }
    
    .disbanded-header {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .regulatory-detail {
        font-size: 0.65rem;
    }
}

.bottle-visual {
    display: flex;
    justify-content: center;
    gap: 0.1rem;
    margin: 0.5rem 0; /* Reduced margin */
    height: 180px; /* Slightly smaller bottles */
    position: relative;
}

.bottle-image {
    position: relative;
    width: 120px;
    height: 100%;
}

.bottle-image .label-tag {
    position: absolute;
    background-color: var(--pale-mint);
    color: var(--deep-charcoal);
    padding: 0.1rem 0.25rem;
    border-radius: 2px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.55rem;
    transform: rotate(-15deg);
    bottom: 10px;
    left: 50%;
    transform-origin: center;
    transform: translateX(-50%) rotate(-15deg);
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    cursor: help;
    transition: all 0.2s ease;
}

.bottle-image .label-tag:hover {
    background-color: var(--absinthe-green);
    color: var(--deep-charcoal);
    transform: translateX(-50%) rotate(-15deg) scale(1.1);
    box-shadow: 0 0 8px rgba(182, 255, 158, 0.4);
    z-index: 10;
}

/* Specific adjustment for the purple/lavender bottle (EV-221) */
.bottle-image:nth-child(3) {
    transform: translateY(12px);
    position: relative;
    z-index: 1;
}

/* Move the green bottle (CS-419) down */
.bottle-image:nth-child(4) {
    transform: translateY(10px);
    position: relative;
    z-index: 1;
}

/* Custom detailed tooltip system for bottles */
.bottle-image::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -100px;
    width: 200px;
    background-color: rgba(27, 28, 30, 0.95);
    color: var(--pale-mint);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1.3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    z-index: 20;
    text-align: center;
    border: 1px solid rgba(207, 255, 227, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-family: 'Manrope', sans-serif;
}

.bottle-image:hover::after {
    opacity: 1;
    bottom: -85px;
}

/* Fix for mobile hover states */
@media (hover: none) {
    .bottle-image .label-tag:active {
        background-color: var(--absinthe-green);
        color: var(--deep-charcoal);
        transform: translateX(-50%) rotate(-15deg) scale(1.1);
        box-shadow: 0 0 8px rgba(182, 255, 158, 0.4);
    }
    
    .bottle-image:active::after {
        opacity: 1;
        bottom: -85px;
    }
}

/* Media query adjustments for tooltip positioning */
@media (max-width: 768px) {
    .bottle-image::after {
        width: 160px;
        padding: 0.5rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .bottle-image::after {
        width: 140px;
        bottom: -110px;
    }
    
    .bottle-image:hover::after,
    .bottle-image:active::after {
        bottom: -100px;
    }
}

.recall-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    font-family: 'Manrope', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--warning-red);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: 4px solid var(--warning-red);
    padding: 0.5rem 2rem;
    border-radius: 4px;
    opacity: 0.15;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

@keyframes glitch {
    2%, 64% { transform: translate(-50%, -50%) rotate(-20deg); }
    4%, 60% { transform: translate(-51%, -50%) rotate(-20deg) scale(1.01); }
    62% { transform: translate(-49%, -50%) rotate(-20deg) scale(0.99); }
}

.recall-stamp {
    animation: glitch 4s infinite;
}

/* Add vapor particle effect near bottles */
@keyframes float-particle {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 0.4; }
    100% { transform: translateY(-100px) translateX(var(--drift)); opacity: 0; }
}

.vapor-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.vapor-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--vapor-purple);
    border-radius: 50%;
    opacity: 0;
}

/* CSS Test Tube Graphics */
.test-tube {
    position: relative;
    width: 40px;
    height: 120px;
    margin: 0 auto;
}

.test-tube-body {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--pale-mint);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
}

.test-tube-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--pale-mint);
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.test-tube-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: var(--glowing-teal);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    animation: bubble 4s ease-in-out infinite;
    filter: drop-shadow(0 0 8px var(--glowing-teal));
}

.test-tube-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: rise 4s linear infinite;
}

.test-tube-bubble:nth-child(1) {
    width: 6px;
    height: 6px;
    left: 30%;
    bottom: 10%;
    animation-delay: 0.2s;
}

.test-tube-bubble:nth-child(2) {
    width: 4px;
    height: 4px;
    left: 60%;
    bottom: 20%;
    animation-delay: 1s;
}

.test-tube-bubble:nth-child(3) {
    width: 5px;
    height: 5px;
    left: 45%;
    bottom: 5%;
    animation-delay: 2s;
}

/* Animation for test tube liquid shimmer */
@keyframes shimmer-liquid {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

/* Animation for bubbles rising */
@keyframes rise {
    0% { transform: translateY(0); opacity: 0.6; }
    100% { transform: translateY(-60px); opacity: 0; }
}

/* CSS Test Tube Logo for site nav */
.logo-test-tube {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.logo-test-tube::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--pale-mint);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.logo-test-tube::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 14px;
    background: var(--glowing-teal);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    filter: drop-shadow(0 0 4px var(--glowing-teal));
    animation: shimmer-liquid 3s infinite;
}
