/* ========================================
   recycle.cafe - Swiss Aquarium Dashboard
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --abyssal-navy: #0f1c2e;
    --deep-current: #1a2b3d;
    --coral-orange: #ff7b3a;
    --sea-glass: #7ecfc0;
    --golden-kelp: #f5c842;
    --warm-shell: #e8ddd0;
    --tide-foam: #8a9bb0;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    color: var(--warm-shell);
    background: var(--abyssal-navy);
    background: radial-gradient(ellipse at 40% 30%, var(--deep-current) 0%, var(--abyssal-navy) 70%);
    line-height: 1.7;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

/* --- Bokeh Layer --- */
#bokeh-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0;
    animation: bokeh-drift 60s infinite ease-in-out;
}

@keyframes bokeh-drift {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    25% { transform: translate(30px, -20px); opacity: 0.9; }
    50% { transform: translate(-20px, 30px); opacity: 0.5; }
    75% { transform: translate(15px, 15px); opacity: 0.8; }
}

/* --- Fish Layer --- */
#fish-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.fish {
    position: absolute;
    width: 60px;
    height: 30px;
    opacity: 0;
}

.fish-1 {
    top: 15%;
    animation: swim-h 25s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate, swim-v 3s ease-in-out infinite;
}
.fish-2 {
    top: 45%;
    animation: swim-h-reverse 32s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate, swim-v 3.5s ease-in-out infinite;
}
.fish-3 {
    top: 70%;
    width: 60px;
    height: 40px;
    animation: swim-h 28s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate, swim-v 2.8s ease-in-out infinite;
}
.fish-4 {
    top: 30%;
    animation: swim-h-reverse 22s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate, swim-v 3.2s ease-in-out infinite;
}
.fish-5 {
    top: 58%;
    animation: swim-h 35s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate, swim-v 3.8s ease-in-out infinite;
}

.fish.visible {
    opacity: 1;
}

@keyframes swim-h {
    0% { left: -80px; }
    100% { left: calc(100vw + 20px); }
}

@keyframes swim-h-reverse {
    0% { left: calc(100vw + 20px); transform: scaleX(-1); }
    100% { left: -80px; transform: scaleX(-1); }
}

@keyframes swim-v {
    0%, 100% { margin-top: 0; }
    50% { margin-top: 15px; }
}

/* --- Navigation --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(15, 28, 46, 0.85);
    backdrop-filter: blur(8px);
}

.nav-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: var(--coral-orange);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 12px;
    letter-spacing: 2em;
    color: var(--warm-shell);
    text-decoration: none;
    transition: color 0.3s;
    letter-spacing: 0.2em;
}

.nav-link:hover, .nav-link.active {
    color: var(--coral-orange);
}

/* --- Dashboard Grid --- */
#dashboard {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    padding: 2px;
    z-index: 5;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#dashboard.visible {
    opacity: 1;
    transform: scale(1);
}

/* --- Panel Base --- */
.panel {
    background: var(--deep-current);
    border: 1px solid rgba(255, 183, 122, 0.15);
    border-radius: 4px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out,
                filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

.panel.stagger-in {
    opacity: 1;
    transform: translateY(0);
}

.panel:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 30px rgba(255, 123, 58, 0.12);
}

.panel.blurred {
    filter: blur(12px);
    transform: scale(0.92);
    opacity: 0.3;
    pointer-events: none;
}

.panel.expanded {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    border-radius: 0;
    overflow-y: auto;
    padding: 48px;
    animation: panel-expand 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes panel-expand {
    from { opacity: 0.8; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Panel Expanded Content --- */
.panel-expanded {
    display: none;
}

.panel.expanded .panel-compact {
    display: none;
}

.panel.expanded .panel-expanded {
    display: block;
}

/* --- Grid Placement --- */
.panel-hero {
    grid-column: 1 / 5;
    grid-row: 1 / 3;
}

.panel-species {
    grid-column: 5 / 7;
    grid-row: 1 / 4;
}

.panel-metric-cups {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

.panel-metric-co2 {
    grid-column: 3 / 5;
    grid-row: 3 / 4;
}

.panel-menu {
    grid-column: 1 / 3;
    grid-row: 4 / 5;
}

.panel-fish-day {
    grid-column: 3 / 5;
    grid-row: 4 / 5;
}

.panel-community {
    grid-column: 5 / 7;
    grid-row: 4 / 5;
}

/* --- Typography --- */
.panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    color: var(--coral-orange);
    line-height: 0.95;
    margin-bottom: 16px;
}

.panel-subtitle {
    font-family: 'Work Sans', sans-serif;
    color: var(--warm-shell);
    max-width: 500px;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

.panel-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: var(--coral-orange);
    margin-bottom: 16px;
}

.expanded-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.15em;
    color: var(--coral-orange);
    margin-bottom: 24px;
}

.expanded-text {
    font-family: 'Work Sans', sans-serif;
    color: var(--warm-shell);
    max-width: 640px;
    margin-bottom: 16px;
    line-height: 1.7;
}

/* --- Metric Panels --- */
.metric-label {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--tide-foam);
    margin-bottom: 8px;
}

.metric-value {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-variant-numeric: tabular-nums;
    color: var(--sea-glass);
    text-shadow: 0 0 8px rgba(126, 207, 192, 0.4);
}

.metric-unit {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--tide-foam);
    margin-top: 4px;
}

.metric-big {
    font-family: 'Space Mono', monospace;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--sea-glass);
    text-shadow: 0 0 12px rgba(126, 207, 192, 0.5);
}

.metric-big .metric-counter {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* --- Species Log --- */
.species-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.species-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.species-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.species-name {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--warm-shell);
    flex: 1;
}

.species-count {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--sea-glass);
    text-shadow: 0 0 8px rgba(126, 207, 192, 0.4);
    font-variant-numeric: tabular-nums;
}

/* --- Menu Panel --- */
.menu-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.menu-name {
    font-family: 'Work Sans', sans-serif;
    color: var(--warm-shell);
    font-size: 0.9rem;
    white-space: nowrap;
}

.menu-dots {
    flex: 1;
    border-bottom: 1px dotted var(--tide-foam);
    opacity: 0.4;
    margin-bottom: 4px;
}

.menu-price {
    font-family: 'Space Mono', monospace;
    color: var(--sea-glass);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.expanded-menu {
    gap: 16px;
}

.expanded-menu .menu-name {
    font-size: 1.1rem;
}

.expanded-menu .menu-price {
    font-size: 1.1rem;
}

/* --- Fish of the Day --- */
.fish-spotlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.spotlight-fish {
    width: 80px;
    height: 50px;
}

.spotlight-fish-large {
    width: 160px;
    height: 100px;
    margin-bottom: 24px;
}

.spotlight-name {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    color: var(--golden-kelp);
    font-size: 0.95rem;
}

.spotlight-latin {
    font-family: 'Work Sans', sans-serif;
    font-style: italic;
    color: var(--tide-foam);
    font-size: 0.8rem;
}

/* --- Community --- */
.community-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    color: var(--sea-glass);
    text-shadow: 0 0 8px rgba(126, 207, 192, 0.4);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--tide-foam);
}

/* --- Recycling Icon --- */
.recycling-icon {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 80px;
    height: 80px;
    opacity: 0.6;
}

.recycling-icon svg {
    width: 100%;
    height: 100%;
}

.recycle-path {
    animation: draw-recycle 3s ease-out forwards;
    animation-delay: 1.5s;
}

@keyframes draw-recycle {
    to { stroke-dashoffset: 0; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #dashboard {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        overflow-y: auto;
    }

    .panel-hero {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .panel-species {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .panel-metric-cups,
    .panel-metric-co2,
    .panel-menu,
    .panel-fish-day,
    .panel-community {
        grid-column: span 1;
        grid-row: auto;
    }

    .panel-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .fish {
        animation-name: swim-h !important;
    }
}
