/* style.css - Kryssportalen (Med Footer) */

:root {
    --primary: #111;
    --accent: #38bdf8;
    --success: #10b981;
    --error: #ef4444;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

body { 
    background-color: #fff; 
    color: #111;
    /* Flexbox för att trycka ner footern */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* --- GLOBAL HEADER --- */
header { 
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; 
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); 
}
.logo { font-weight: 800; font-size: 1rem; color: #111; text-transform: uppercase; letter-spacing: 1px; }
.user-nav { width: 36px; height: 36px; background: #111; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: bold; text-decoration: none; }

/* --- HERO CAROUSEL --- */
.hero-carousel {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; height: 75vh; margin-bottom: 20px;
}
.hero-carousel::-webkit-scrollbar { display: none; }

.hero-card {
    flex: 0 0 100%; height: 100%; scroll-snap-align: start; position: relative;
    overflow: hidden; color: white; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 30px; padding-top: 80px; background-size: cover; background-position: center;
}

.hero-card::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Mörkare botten för läsbarhet */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 20%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.95) 100%); 
    z-index: 1;
}

.card-content { position: relative; z-index: 2; margin-bottom: 40px; }

.card-eyebrow { 
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; margin-bottom: 10px; opacity: 0.95; font-weight: bold; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); 
}

/* FIX: Tog bort rutan här (background transparent) */
.highlight-bg { 
    background: transparent; 
    padding: 0; 
    border-radius: 0; 
}

.card-title { 
    font-size: 2.8rem; line-height: 1.05; margin-bottom: 15px; font-weight: 800; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}

.card-desc { 
    font-size: 1rem; opacity: 0.95; margin-bottom: 25px; max-width: 90%; line-height: 1.4; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.5); 
}

.btn-big { display: inline-block; background: #fff; color: #000; padding: 15px 35px; border-radius: 30px; font-weight: bold; border: none; cursor: pointer; font-size: 1rem; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.btn-big:active { transform: scale(0.96); }

/* Fallback bakgrunder */
.bg-news { background-image: radial-gradient(circle at top right, #34495e, #1a252f); }
.bg-speed { background-image: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.bg-league { background-image: radial-gradient(circle at bottom left, #9b59b6, #8e44ad); }

/* --- CONTENT LAYOUT --- */
.content-body { 
    padding: 10px 20px 0 20px; 
    /* Ser till att innehållet fyller ut så footern hamnar rätt */
    flex: 1;
}
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 15px; margin-top: 10px;}
.section-header h2 { font-size: 1.2rem; color: #111; font-weight: 700; }
.link-all { font-size: 0.85rem; color: #666; text-decoration: none; }

/* --- SÖKFÄLT --- */
.search-container { margin-bottom: 15px; position: relative; }
.search-input {
    width: 100%; padding: 12px 15px 12px 40px; border-radius: 25px; border: 1px solid #e5e7eb;
    background: #f9fafb; font-size: 0.95rem; outline: none; transition: 0.2s;
}
.search-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }

/* --- KATEGORI-PILLS --- */
.category-scroll {
    display: flex; overflow-x: auto; gap: 8px; padding-bottom: 10px; margin-left: -20px; padding-left: 20px; width: calc(100% + 40px); scrollbar-width: none; margin-bottom: 5px;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
    background: #fff; border: 1px solid #e5e7eb; padding: 8px 16px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600; color: #64748b; white-space: nowrap; transition: 0.2s; cursor: pointer;
}
.category-pill:hover, .category-pill.active { border-color: #38bdf8; background: #f0f9ff; color: #0f172a; }

/* --- REKOMMENDERADE KORT --- */
.rec-scroll { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; margin-left: -20px; padding-left: 20px; width: calc(100% + 40px); scrollbar-width: none; }
.rec-scroll::-webkit-scrollbar { display: none; }
.rec-card {
    min-width: 200px; background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.rec-header { padding: 5px 10px; background: #fdf2f8; color: #db2777; font-size: 0.65rem; font-weight: bold; text-transform: uppercase; }
.rec-img { height: 90px; background: #ddd; background-size: cover; background-position: center; }
.rec-body { padding: 10px; }
.rec-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 0.75rem; color: #666; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* --- EXPLORE LIST --- */
.explore-list { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    margin-top: 10px;
    min-height: 50vh;
    transition: opacity 0.2s;
}

.list-item { 
    display: flex; 
    align-items: flex-start; 
    gap: 15px; 
    background: #fff; 
    padding: 15px; 
    border-radius: 16px; 
    border: 1px solid #f1f5f9; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.1s;
    text-decoration: none; 
    color: inherit;
}

.thumb { 
    width: 60px; 
    height: 60px; 
    background: #eee; 
    border-radius: 12px; 
    flex-shrink: 0; 
    background-size: cover; 
    background-position: center; 
}

.item-info { 
    flex: 1; 
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.item-header { display: flex; flex-direction: column; }
.item-title { font-size: 1rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.item-cat { font-size: 0.75rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; margin-top: 2px; }

/* NIVÅ-KNAPPAR (PILLS) */
.level-group { display: flex; flex-wrap: wrap; gap: 8px; }

.lvl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 14px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-decoration: none; 
    border: 1px solid transparent; transition: transform 0.1s, opacity 0.2s;
    min-width: 60px; /* Ser till att de har bra tryckyta och ser enhetliga ut */
}
.lvl-btn:active { transform: scale(0.95); }

.lvl-1 { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.lvl-2 { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.lvl-3 { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }

/* GHOSTED STATE (När spelad: Visa poäng) */
.lvl-btn.played { 
    background: #f8fafc; 
    border-color: #e2e8f0; 
    color: #64748b; /* Tydlig grå text för poängen */
    opacity: 1; /* Full opacitet så man ser poängen */
}

/* "Visa fler"-knapp */
.btn-load-more {
    display: block; width: 100%; text-align: center; padding: 15px; margin-top: 20px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    color: #64748b; font-weight: 600; cursor: pointer; font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.btn-load-more:hover { background: #f8fafc; color: #111; }
.btn-load-more:disabled { opacity: 0.5; cursor: default; }

/* Animation */
.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- SPELMOTORN --- */
.badge-level { font-size: 0.7rem; padding: 4px 10px; border-radius: 12px; font-weight: 700; text-transform: uppercase; display: inline-flex; align-items: center; }
.level-1 { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.level-2 { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.level-3 { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.game-container { max-width: 600px; margin: 80px auto 20px auto; padding: 20px; }
.game-card { background: #fff; padding: 25px; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); border: 1px solid #eee; text-align: center; }
.game-cover { width: 100%; height: 250px; object-fit: cover; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 8px 20px rgba(0,0,0,0.15); display: block; }
.img-credit { font-size: 0.7rem; color: #999; text-align: right; margin-top: -20px; margin-bottom: 20px; margin-right: 5px; font-style: italic; display: block; }
.option-btn { display: flex; align-items: center; width: 100%; padding: 16px 20px; margin-bottom: 12px; border: 1px solid #e5e7eb; background: #fff; border-radius: 12px; font-size: 1rem; cursor: pointer; text-align: left; transition: all 0.2s; color: #111; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.option-btn:hover { border-color: #111; background: #f9fafb; }
.progress-bar { width: 100%; height: 6px; background: #f1f5f9; border-radius: 3px; margin-bottom: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: #111; width: 0%; transition: width 0.3s ease; }
.feedback-box { margin: 20px 0; padding: 15px; border-radius: 12px; font-weight: bold; text-align: center; }
.feedback-correct { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.feedback-wrong { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.review-card { background: #f9fafb; border: 1px solid #eee; border-radius: 12px; padding: 15px; margin-bottom: 15px; text-align: left; }
.review-q { font-weight: bold; margin-bottom: 10px; display: block; color: #111; }
.review-opt { padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 5px; border: 1px solid #eee; background: #fff; color: #666; }
.rev-correct { background: #dcfce7; border-color: #10b981; color: #064e3b; font-weight: bold; }
.rev-wrong { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; text-decoration: line-through; opacity: 0.7; }

/* --- AUTENTISERING & CONTAINERS --- */
.auth-container { 
    padding: 40px 20px; max-width: 400px; margin: 0 auto; text-align: center; margin-top: 60px; 
    /* Ser till att denna trycker ner footern också */
    flex: 1;
}
.container { 
    /* Samma sak för denna container */
    flex: 1; 
}

.form-input { width: 100%; padding: 15px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 12px; font-size: 1rem; background: #fff; }
.form-btn { width: 100%; padding: 15px; background: #111; color: #fff; border: none; border-radius: 30px; font-weight: bold; font-size: 1rem; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

@media (max-height: 700px) { .game-cover { height: 180px; margin-bottom: 15px; } }

/* --- FOOTER STYLES --- */
.site-footer {
    background: #0f172a; /* Mörkblå/svart */
    border-top: 1px solid #1e293b;
    padding: 20px 0;
    margin-top: 50px;
    font-size: 0.85rem;
    color: #64748b;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-right a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: #38bdf8; /* Ljusblå vid hover */
}

.footer-right .sep {
    margin: 0 10px;
    opacity: 0.3;
}

/* Mobilanpassning av footer */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
