/* DigiAmpari - Suomalainen digitaalinen ämpäri-kulttuuri */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: #f4f5f7; /* vaalea harmaa */
    color: #222;
    min-height: 100vh;
    line-height: 1.75;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 22px 80px;
    background: transparent;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 36px;
    padding: 16px 0 12px;
    color: #111;
}

.header h1 {
    font-size: 2.6em;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    line-height: 1.3em;
    padding-top: 1.5em;
    padding-bottom: 0.5em;
}

.subtitle {
    font-size: 1.3em;
    color: #111;
}

/* Hero image */
.hero-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 0 0 14px 0;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

/* Väli CTA:n ja hero-kuvan väliin */
.hero-media {
    margin-top: 32px;
}

/* Intro-text spacing */
.intro-text {
    margin: 8px 0 16px 0;
}
.intro-text p {
    color: #333;
}

/* Daily Counter */
.daily-counter {
    padding: 8px 0 16px;
    margin-bottom: 8px;
}

.daily-counter h2 {
    color: #111;
    margin-bottom: 8px;
    font-size: 1.25em;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e6e7ea;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7a18 0%, #ca5705 100%);
    width: 100%;
    transition: width 300ms ease;
}

/* Queue Status */
.queue-status {
    padding: 12px 0 4px;
    margin-bottom: 16px;
}

.queue-status h3 {
    color: #111;
    margin-bottom: 10px;
    font-size: 1.15em;
    font-weight: 600;
}


/* Visual Queue */
.visual-queue {
    margin-top: 20px;
}

/* Rohkeampi teema vain jonotusalueelle */
#queue-section {
    background: linear-gradient(180deg, #ffeec7 0%, #fffaed 100%);
    border: 1px solid #f0f2f5;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    margin-top: 20px !important;
}

/* Jono: muut harmaita, oma hahmo värillinen */
#queue-list .queue-item svg { color: #d1d5db; }
#queue-list .queue-item:not(.user) svg { color: #d1d5db !important; }

/* Korosta käyttäjän hahmo värillä ja pehmeällä hehkulla */
.queue-item.user svg { color: #000 !important; }

.queue-viewport {
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0;
}

.queue-list {
    display: flex;
    flex-wrap: wrap; /* useampia rivejä */
    gap: 0 2px; /* y,x */
}

.queue-item {
    display: flex;
    width: 48px;
    height: 72px;
    align-items: center;
    justify-content: center;
}

.queue-item svg {
    width: 52px;
    height: 52px;
    color: #d1d5db; /* vaalea harmaa */
}

/* Sisäinen kääre kondensio-animointiin */
.queue-item .q-inner {
    display: inline-flex;
    transition: transform 280ms ease;
}

.queue-item.user svg {
    color: #000;
}

/* Ensimmäinen on myös vaaleanharmaa (ei korostusta) */

@keyframes pulse-first {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.queue-item.got-bucket svg {
    color: #dc3545;
    animation: bucket-handout 300ms ease-out forwards;
}

@keyframes bucket-handout {
    0% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2) rotate(5deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Activity Check */
.activity-check {
    background: #fee2e2; /* vaalea punainen */
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
    text-align: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.activity-check h3 {
    color: #7f1d1d;
    margin-bottom: 6px;
}

.activity-timer {
    font-size: 1.25em;
    font-weight: 700;
    color: #991b1b;
    margin-top: 6px;
}

/* Yhtenäinen toast-tyyli ilmoituksille */
.notification {
    position: relative; /* stacked inside toast-container */
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95em;
    border: 1px solid transparent;
    background: #fff;
    color: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    animation: slideIn 0.35s ease-out;
}

/* Toast container for stacking */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    align-items: flex-end;
    pointer-events: none;
}

.notification.success {
    background: #e6f4ea;
    border-color: #b7e1c1;
    color: #0a4b2f;
}

.notification.error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #7f1d1d;
}

/* Ad Container */
.ad-container {
    padding: 12px 0 16px;
    margin-bottom: 16px;
    text-align: center;
}

.ad-placeholder {
    color: #666;
    font-style: italic;
    padding: 28px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
}

/* Bucket Animation */
.bucket-animation {
    background-color: #111; /* fallback */
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('jonota-digiampari-1600x630.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 36px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
    color: white;
    animation: celebrate 1.4s ease-in-out;
    position: relative;
    overflow: hidden;
}

@keyframes celebrate {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.bucket {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.bucket-animation h2 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.share-button, .queue-again-button {
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.share-button:hover, .queue-again-button:hover {
    transform: translateY(-1px);
    background: #f6f7f9;
}


/* Article Section */
.article-section {
    background: transparent;
    padding: 8px 0 32px;
    margin-bottom: 8px;
    line-height: 1.85;
}

.article-section h2 {
    color: #111;
    margin: 28px 0 16px;
    font-size: 1.9em;
    text-align: center;
    letter-spacing: -0.01em;
    padding-top: 1em;
    line-height: 1.3em;
}

.article-section h3 {
    color: #222;
    margin: 24px 0 12px 0;
    font-size: 1.3em;
    line-height: 1.3em;
}

.article-section p {
    color: #444;
    margin-bottom: 14px;
}

/* CTA button */
.queue-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 26px;
    font-size: 1.15em;
    font-weight: 800;
    background: linear-gradient(135deg, #ff7a18, #ff3d00);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255,61,0,0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.queue-start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255,61,0,0.3);
}

.queue-start-button:active {
    transform: translateY(0);
}

.hero .queue-start-button::after {
    content: "→";
    font-weight: 800;
}

/* Keskitys: aseta CTA-painikkeet keskelle tekstikentissään */
.hero .queue-start-button,
.article-section .queue-start-button {
    display: block;            /* mahdollistaa auto-marginit */
    width: fit-content;        /* säilytä kapeus sisällön mukaan */
    margin: 0 auto;            /* keskitys horisontaalisesti */
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #777;
    font-size: 0.9em;
    margin-top: 24px;
}

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0 12px 0;
    margin-bottom: 12px;
}

.nav-brand {
    font-weight: 800;
    color: #111;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 14px;
}

.nav-links a {
    text-decoration: none;
    color: #444;
    font-weight: 600;
}

.nav-links a:hover { color: #111; }

.nav-cta {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-weight: 700;
}

/* Mobiilinavigaatio */
.nav-toggle { display: none; }

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        background: #fff;
        color: #111;
        font-weight: 800;
        cursor: pointer;
    }
    .nav-links {
        position: absolute;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        max-width: 880px;
        display: none;
        flex-direction: column;
        gap: 10px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.06);
        z-index: 50;
    }
    .nav-links.show { display: flex; }
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr; /* ei sivupalkkia */
        align-items: start;
    }
}

/* Ad slots */
.ad-slot { margin-bottom: 16px; }

.ad-inline .ad-placeholder {
    display: block;
    min-height: 120px; /* varattu tila, vähentää CLS */
}

/* Facts box - hillitty vaalea kortti */
.facts-box {
    list-style: disc inside;
    background: #ffeec7; /* vaalea harmaanbeige */
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 14px 0 18px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.facts-box li {
    color: #333;
    margin: 6px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .bucket {
        font-size: 3em;
    }
    
    .bucket-animation h2 {
        font-size: 1.5em;
    }

    /* Rajoita hero-kuvan korkeus mobiilissa, jotta teksti näkyy heti */
    .hero-image {
        max-height: 220px;
        object-fit: cover;
    }

    /* Keskitys mobiilissa */
    .daily-counter,
    .daily-counter h2 { text-align: center; }

    .queue-status,
    .queue-status h3 { text-align: center; }

    /* Toastit keskelle ylös mobiilissa */
    .toast-container {
        top: 12px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        align-items: center;
        width: calc(100% - 24px);
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
