/* ============================================
   ValutenKalkulator.bg v1 — Clean Professional Glassmorphism
   Muted palette, subtle animated blobs, mobile-first responsive
   Light & Dark theme support
   ============================================ */

/* ============================================
   FONT: Onest (local)
   ============================================ */
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Onest-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/Onest-Medium.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Onest-SemiBold.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Onest-Bold.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/Onest-ExtraBold.ttf') format('truetype');
}

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
    /* Glass cards */
    --card-outer-bg: rgba(255, 255, 255, 0.35);
    --card-outer-border: rgba(255, 255, 255, 0.5);
    --card-outer-hover-shadow: rgba(0, 0, 0, 0.06);
    --card-inner-bg: #fff;
    --card-inner-dot: rgba(0, 0, 0, 0.035);

    /* Blobs */
    --blob-one-from: #94a3b8;
    --blob-one-to: #64748b;
    --blob-two-from: #93c5fd;
    --blob-two-to: #60a5fa;
    --blob-three-from: #a5b4fc;
    --blob-three-to: #818cf8;
    --blob-four-from: #cbd5e1;
    --blob-four-to: #94a3b8;

    /* Dropdowns */
    --dropdown-item-color: #64748b;
    --dropdown-item-hover-bg: #f8fafc;
    --dropdown-item-hover-color: #1e293b;
    --dropdown-item-border: rgba(226, 232, 240, 0.5);
    --dropdown-symbol-color: #334155;
    --dropdown-name-color: #94a3b8;
    --dropdown-scrollbar: #e2e8f0;

    /* Ticker pills */
    --ticker-bg: rgba(255, 255, 255, 0.65);
    --ticker-border: rgba(226, 232, 240, 0.6);
    --ticker-color: #475569;
    --ticker-hover-bg: rgba(255, 255, 255, 0.85);

    /* Popular links */
    --popular-bg: rgba(255, 255, 255, 0.55);
    --popular-border: rgba(226, 232, 240, 0.6);
    --popular-color: #475569;
    --popular-hover-bg: rgba(255, 255, 255, 0.8);
    --popular-hover-color: #1e293b;
    --popular-hover-border: #cbd5e1;

    /* Rate cards */
    --rate-up-color: #059669;
    --rate-up-bg: #ecfdf5;
    --rate-up-border: #d1fae5;
    --rate-down-color: #dc2626;
    --rate-down-bg: #fef2f2;
    --rate-down-border: #fecaca;

    /* Spinner */
    --spinner-track: rgba(148, 163, 184, 0.2);
    --spinner-color: #64748b;

    /* Share copied */
    --share-copied-bg: #ecfdf5;
    --share-copied-color: #059669;
    --share-copied-border: #a7f3d0;

    /* Scrollbar */
    --scrollbar-thumb: #e2e8f0;
    --scrollbar-thumb-hover: #cbd5e1;

    /* Selection */
    --selection-bg: rgba(148, 163, 184, 0.2);
    --selection-color: #1e293b;

    /* FAQ */
    --faq-border: rgba(226, 232, 240, 0.4);
}

.dark {
    --card-outer-bg: rgba(30, 41, 59, 0.45);
    --card-outer-border: rgba(71, 85, 105, 0.35);
    --card-outer-hover-shadow: rgba(0, 0, 0, 0.3);
    --card-inner-bg: #1e293b;
    --card-inner-dot: rgba(255, 255, 255, 0.03);

    --blob-one-from: #334155;
    --blob-one-to: #1e293b;
    --blob-two-from: #1e3a5f;
    --blob-two-to: #1e40af;
    --blob-three-from: #312e81;
    --blob-three-to: #3730a3;
    --blob-four-from: #334155;
    --blob-four-to: #1e293b;

    --dropdown-item-color: #94a3b8;
    --dropdown-item-hover-bg: #334155;
    --dropdown-item-hover-color: #f1f5f9;
    --dropdown-item-border: rgba(71, 85, 105, 0.5);
    --dropdown-symbol-color: #e2e8f0;
    --dropdown-name-color: #64748b;
    --dropdown-scrollbar: #475569;

    --ticker-bg: rgba(30, 41, 59, 0.6);
    --ticker-border: rgba(71, 85, 105, 0.4);
    --ticker-color: #cbd5e1;
    --ticker-hover-bg: rgba(51, 65, 85, 0.8);

    --popular-bg: rgba(30, 41, 59, 0.5);
    --popular-border: rgba(71, 85, 105, 0.4);
    --popular-color: #cbd5e1;
    --popular-hover-bg: rgba(51, 65, 85, 0.7);
    --popular-hover-color: #f1f5f9;
    --popular-hover-border: #475569;

    --rate-up-color: #34d399;
    --rate-up-bg: rgba(16, 185, 129, 0.15);
    --rate-up-border: rgba(52, 211, 153, 0.3);
    --rate-down-color: #fb7185;
    --rate-down-bg: rgba(244, 63, 94, 0.15);
    --rate-down-border: rgba(251, 113, 133, 0.3);

    --spinner-track: rgba(100, 116, 139, 0.2);
    --spinner-color: #94a3b8;

    --share-copied-bg: rgba(16, 185, 129, 0.15);
    --share-copied-color: #34d399;
    --share-copied-border: rgba(52, 211, 153, 0.3);

    --scrollbar-thumb: #475569;
    --scrollbar-thumb-hover: #64748b;

    --selection-bg: rgba(148, 163, 184, 0.3);
    --selection-color: #f1f5f9;

    --faq-border: rgba(71, 85, 105, 0.3);
}

/* Theme transition (only during manual toggle, not page load) */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

html { scroll-behavior: smooth; }

/* ============================================
   BACKGROUND BLOBS
   ============================================ */
.blob-bg { pointer-events: none; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    will-change: transform, border-radius;
}

.blob--one {
    width: 650px;
    height: 650px;
    top: -120px;
    left: -120px;
    background: radial-gradient(circle at 40% 40%, var(--blob-one-from), var(--blob-one-to));
    animation: morph-1 20s ease-in-out infinite alternate;
}

.blob--two {
    width: 550px;
    height: 550px;
    top: 80px;
    right: -100px;
    background: radial-gradient(circle at 60% 35%, var(--blob-two-from), var(--blob-two-to));
    opacity: 0.35;
    animation: morph-2 24s ease-in-out infinite alternate;
}

.blob--three {
    width: 500px;
    height: 500px;
    top: 600px;
    left: -60px;
    background: radial-gradient(circle at 45% 55%, var(--blob-three-from), var(--blob-three-to));
    opacity: 0.3;
    animation: morph-3 18s ease-in-out infinite alternate;
}

.blob--four {
    width: 480px;
    height: 480px;
    top: 1100px;
    right: -80px;
    background: radial-gradient(circle at 50% 50%, var(--blob-four-from), var(--blob-four-to));
    opacity: 0.4;
    animation: morph-4 22s ease-in-out infinite alternate;
}

@keyframes morph-1 {
    0%   { border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; transform: translate(0,0) rotate(0deg) scale(1); }
    50%  { border-radius: 55% 45% 35% 65% / 45% 55% 50% 50%; transform: translate(40px,-30px) rotate(90deg) scale(1.03); }
    100% { border-radius: 35% 65% 55% 45% / 55% 35% 65% 45%; transform: translate(-20px,20px) rotate(180deg) scale(0.98); }
}

@keyframes morph-2 {
    0%   { border-radius: 50% 50% 40% 60% / 40% 60% 40% 60%; transform: translate(0,0) rotate(0deg); }
    50%  { border-radius: 35% 65% 60% 40% / 55% 45% 55% 45%; transform: translate(-30px,40px) rotate(90deg); }
    100% { border-radius: 60% 40% 50% 50% / 45% 55% 45% 55%; transform: translate(20px,-20px) rotate(180deg); }
}

@keyframes morph-3 {
    0%   { border-radius: 45% 55% 50% 50% / 60% 40% 60% 40%; transform: translate(0,0) rotate(0deg) scale(1); }
    50%  { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; transform: translate(-40px,-25px) rotate(-90deg) scale(1.05); }
    100% { border-radius: 40% 60% 55% 45% / 50% 50% 40% 60%; transform: translate(25px,30px) rotate(-180deg) scale(0.97); }
}

@keyframes morph-4 {
    0%   { border-radius: 55% 45% 45% 55% / 50% 50% 50% 50%; transform: translate(0,0) rotate(0deg); }
    50%  { border-radius: 40% 60% 55% 45% / 60% 40% 55% 45%; transform: translate(35px,-40px) rotate(60deg); }
    100% { border-radius: 45% 55% 60% 40% / 55% 45% 40% 60%; transform: translate(-15px,15px) rotate(120deg); }
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none !important; }
    .reveal-on-scroll { opacity: 1 !important; transform: none !important; }
}

/* ============================================
   ENTRY ANIMATIONS (IntersectionObserver)
   ============================================ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--delay, 0s);
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Spinner */
.spinner {
    border-width: 2px;
    border-style: solid;
    border-color: var(--spinner-track);
    border-top-color: var(--spinner-color);
}

/* Dropdown */
.calc__dropdown.open { display: block; }

.calc__dropdown-item {
    padding: 9px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dropdown-item-color);
    transition: background 0.15s;
    border-bottom: 1px solid var(--dropdown-item-border);
}
.calc__dropdown-item:last-child { border-bottom: none; }
.calc__dropdown-item:hover,
.calc__dropdown-item.highlighted {
    background: var(--dropdown-item-hover-bg);
    color: var(--dropdown-item-hover-color);
}
.calc__dropdown-item .symbol {
    font-weight: 700;
    color: var(--dropdown-symbol-color);
    min-width: 36px;
}
.calc__dropdown-item .name { color: var(--dropdown-name-color); }
.calc__dropdown-item .flag { font-size: 16px; line-height: 1; }

.calc__dropdown::-webkit-scrollbar { width: 4px; }
.calc__dropdown::-webkit-scrollbar-track { background: transparent; }
.calc__dropdown::-webkit-scrollbar-thumb { background: var(--dropdown-scrollbar); border-radius: 2px; }

/* States */
.calc__loading.active { display: block; }
.calc__error.active { display: block; }

.stars__star.active {
    color: #f59e0b !important;
    transform: scale(1.15);
}
.stars__star.hovered {
    color: #fbbf24 !important;
}

.calc__share-btn.copied {
    background: var(--share-copied-bg) !important;
    color: var(--share-copied-color) !important;
    border-color: var(--share-copied-border) !important;
}

.rating-section__thanks.active { display: block; }

/* Hide scrollbar but allow scrolling */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Ticker container */
#heroTicker {
    overflow-x: auto;
}
@media (min-width: 640px) {
    #heroTicker {
        overflow-x: visible;
    }
}

/* Ticker pills */
a.ticker-pill { text-decoration: none; cursor: pointer; }

.ticker-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ticker-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ticker-border);
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ticker-color);
    transition: all 0.2s ease;
}
.ticker-pill:hover {
    transform: translateY(-1px);
    background: var(--ticker-hover-bg);
}
.ticker-pill__flag { font-size: 14px; }

/* Two-layer card design */
.glass-card-outer {
    background: var(--card-outer-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-outer-border);
    border-radius: 22px;
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card-outer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--card-outer-hover-shadow);
}
.glass-card-inner {
    background: var(--card-inner-bg);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.glass-card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--card-inner-dot) 1px, transparent 1px);
    background-size: 14px 14px;
    pointer-events: none;
}

/* Calculator card specifics */
.calc.glass-card-outer {
    padding: 16px;
}
.calc .glass-card-inner {
    padding: 20px;
}
@media (min-width: 640px) {
    .calc.glass-card-outer {
        padding: 18px;
    }
    .calc .glass-card-inner {
        padding: 28px;
    }
}

/* Rate card */
.rate-card {
    padding: 12px;
}
.rate-card .glass-card-inner {
    padding: 14px;
}
.rate-change.up { color: var(--rate-up-color); background: var(--rate-up-bg); border: 1px solid var(--rate-up-border); }
.rate-change.down { color: var(--rate-down-color); background: var(--rate-down-bg); border: 1px solid var(--rate-down-border); }
.rate-change.neutral { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); }

/* Popular links */
.popular__link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--popular-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    text-decoration: none;
    color: var(--popular-color);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid var(--popular-border);
    transition: all 0.2s ease;
}
.popular__link:hover {
    transform: translateY(-1px);
    background: var(--popular-hover-bg);
    color: var(--popular-hover-color);
    border-color: var(--popular-hover-border);
}
.popular__link-flag { font-size: 16px; }

/* FAQ accordion */
.faq-item {
    padding: 16px 18px;
    cursor: pointer;
}
.faq-item:hover {
    transform: translateY(-1px);
}
.faq-chevron {
    transition: transform 0.3s ease;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}
.faq-answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
}
.faq-item.open .faq-answer {
    display: block;
    max-height: 300px;
    opacity: 1;
}

/* Chart canvas */
.chart-card__canvas-wrap canvas { width: 100% !important; height: 100% !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

::selection { background: var(--selection-bg); color: var(--selection-color); }

/* Microinteraction: pulse on result update */
@keyframes resultPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
.result-pulse {
    animation: resultPulse 0.3s ease-out;
}

/* Microinteraction: swap button spin */
@keyframes swapSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}
.swap-spin {
    animation: swapSpin 0.3s ease-out;
}

@media (max-width: 768px) {
    .blob { filter: blur(70px); opacity: 0.35; }
    .blob--one { width: 400px; height: 400px; }
    .blob--two { width: 350px; height: 350px; }
    .blob--three { width: 320px; height: 320px; }
    .blob--four { width: 300px; height: 300px; }

    .ticker-pill {
        padding: 4px 10px;
        font-size: 11px;
        gap: 3px;
    }
    .ticker-pill__flag { font-size: 12px; }

    .popular__link {
        padding: 8px 10px;
        font-size: 12px;
        gap: 5px;
        border-radius: 10px;
    }
    .popular__link-flag { font-size: 14px; }

    .calc__dropdown-item {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    .calc__dropdown-item .symbol { min-width: 36px; }

    .faq-item {
        padding: 14px 16px;
    }
}
