/* ============================================
   CSS för Fräckt Fredagsquiz
   Svart humor, katter och lite av varje!
   
   Skapad: 2025-11-28
   Struktur: Extern CSS-fil enligt best practice
   
   UPPDATERING: Fräck lila/magenta/rosa färgpalett
   för att matcha quizets vågade tema
   ============================================ */

/* ============================================
   Allmän styling och CSS-variabler
   Här definieras färger och gemensamma värden
   ============================================ */
:root {
    /* Primära färger - het magenta/lila palett 🔥 */
    --primary-color: #d946ef;
    --primary-hover: #c026d3;
    --primary-dark: #86198f;
    --secondary-color: #6366f1;
    --accent-color: #f43f5e;
    --success-color: #10b981;
    --error-color: #ef4444;
    
    /* Bakgrunder och kort */
    --background: #fdf4ff;
    --card-bg: #ffffff;
    --card-bg-alt: #fae8ff;
    
    /* Text */
    --text-primary: #1e1b4b;
    --text-secondary: #4c1d95;
    --text-light: #a855f7;
    
    /* Övriga designelement */
    --border-radius: 16px;
    --shadow-sm: 0 2px 4px rgba(217, 70, 239, 0.1);
    --shadow-md: 0 4px 12px rgba(217, 70, 239, 0.15);
    --shadow-lg: 0 10px 25px rgba(217, 70, 239, 0.2);
    --shadow-glow: 0 0 30px rgba(217, 70, 239, 0.3);
    --transition: all 0.3s ease;
}

/* ============================================
   Reset och grundläggande styling
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    /* Het gradient från lila till magenta till rosa */
    background: linear-gradient(135deg, #581c87 0%, #c026d3 40%, #f43f5e 80%, #fb923c 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    /* Subtil animerad bakgrund */
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   Huvudcontainer för quiz
   ============================================ */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow: hidden;
    border: 3px solid rgba(217, 70, 239, 0.3);
}

/* ============================================
   Header med titel och progressbar
   ============================================ */
.quiz-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    padding: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Subtil glitter-effekt i headern */
.quiz-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.quiz-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.quiz-header-text {
    flex: 1;
    text-align: center;
}

.quiz-title {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.quiz-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 600;
}

/* Knapp för att se alla quiz */
.all-quiz-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-family: 'Nunito', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.all-quiz-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Progressbar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f472b6, #c084fc);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ============================================
   Intro-sektion (flersidiga introduktionstexter)
   ============================================ */
.intro-section {
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.intro-card {
    background: var(--card-bg);
}

/* Sidindikator - visar vilken sida användaren är på */
.page-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--card-bg-alt);
}

.page-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

/* Visuella prickar för sidindikering */
.page-dots {
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--card-bg-alt);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid var(--text-light);
}

.page-dot:hover {
    transform: scale(1.3);
    background: var(--text-light);
}

.page-dot.active {
    background: var(--primary-color);
    width: 18px;
    height: 18px;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.5);
}

.intro-title {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.intro-body {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.intro-body h3 {
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
}

.intro-body p {
    margin-bottom: 15px;
}

.intro-body ul, .intro-body ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.intro-body li {
    margin-bottom: 12px;
}

.intro-body strong {
    color: var(--primary-dark);
}

.intro-body a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
    font-weight: 700;
}

.intro-body a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Emoji-styling i intro */
.intro-body .emoji-big {
    font-size: 2rem;
    display: inline-block;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Specialstyling för info-rutor i intro-texterna */
.info-box {
    background: linear-gradient(135deg, #fae8ff 0%, #f5d0fe 100%);
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.info-box strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.warning-box strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #92400e;
}

/* Ny box-typ för fräckt innehåll */
.spicy-box {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    border-left: 5px solid var(--accent-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.spicy-box strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #be123c;
}

.intro-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

/* ============================================
   Bildsektion med startbild och knapp
   Bilderna växlar automatiskt var 3:e sekund
   ============================================ */
.image-section {
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-alt) 100%);
}

.quiz-image-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 500px;
    margin: 0 auto 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #581c87 0%, #c026d3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--primary-color);
}

.quiz-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: none;
    transition: opacity 0.5s ease;
}

.quiz-image.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.image-text {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 700;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
}

/* ============================================
   Knappar
   ============================================ */
.primary-btn, .secondary-btn, .continue-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 30px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Nunito', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    flex: 1;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(217, 70, 239, 0.4);
}

.secondary-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    flex: 1;
    box-shadow: var(--shadow-md);
}

.secondary-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.continue-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #fb923c 100%);
    color: white;
    padding: 20px 50px;
    font-size: 1.3rem;
    box-shadow: var(--shadow-lg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 0 rgba(244, 63, 94, 0.4); }
    50% { box-shadow: var(--shadow-lg), 0 0 0 15px rgba(244, 63, 94, 0); }
}

.continue-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(244, 63, 94, 0.5);
    animation: none;
}

.primary-btn:disabled, .secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Quiz-innehåll (frågor och svar)
   ============================================ */
#quizContent {
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.question-container {
    margin-bottom: 30px;
}

.question-number {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.question-text {
    font-family: 'Bangers', cursive;
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.5;
    letter-spacing: 0.5px;
    white-space: pre-line; /* Bevarar radbrytningar i frågetexten */
}

/* Svarsalternativ - Gul bakgrund för att tydligt visa att det är indata (enligt regel 18) */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.answer-btn {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); /* Gul bakgrund för indata */
    border: 3px solid #e5e7eb;
    padding: 18px 24px;
    border-radius: 15px;
    font-size: 1.15rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.answer-btn:hover:not(:disabled)::before {
    left: 100%;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

/* Feedback efter svar - grön eller röd enligt design */
.answer-btn.correct {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-color: var(--success-color);
    color: white;
    transform: scale(1.02);
}

.answer-btn.incorrect {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    border-color: var(--error-color);
    color: white;
}

/* Feedback-text under svaren */
.feedback {
    margin-top: 25px;
    padding: 25px;
    border-radius: 15px;
    line-height: 1.9;
    animation: slideDown 0.4s ease;
}

.feedback.correct {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 5px solid var(--success-color);
    color: #065f46;
}

.feedback.incorrect {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 5px solid var(--error-color);
    color: #991b1b;
}

.feedback strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.feedback h3 {
    color: #065f46;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
}

.feedback.incorrect h3 {
    color: #991b1b;
}

.feedback ul, .feedback ol {
    margin-left: 25px;
    margin-bottom: 15px;
    margin-top: 10px;
}

.feedback li {
    margin-bottom: 10px;
}

.feedback p {
    margin-bottom: 15px;
}

/* Klickbara länkar i feedback */
.feedback a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
    font-weight: 700;
}

.feedback a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Nästa-knapp efter svar */
.next-question-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: var(--transition);
    font-family: 'Nunito', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
}

.next-question-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(217, 70, 239, 0.4);
}

/* ============================================
   Resultatskärm
   ============================================ */
.result-container {
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.result-title {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 var(--card-bg-alt);
}

.result-score {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 30px 0;
}

.result-message {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.7;
    font-weight: 600;
}

/* Container för knappar på resultatskärmen */
.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 30px;
}

.restart-btn, .browse-quiz-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
    display: inline-block;
    min-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
}

.restart-btn:hover, .browse-quiz-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 25px rgba(217, 70, 239, 0.4);
}

/* Speciell styling för "Se alla quiz"-knappen */
.browse-quiz-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #7c3aed 100%);
}

/* ============================================
   Floating action buttons
   ============================================ */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.floating-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.tech-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.prompt-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #fb923c 100%);
}

.floating-btn:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 15px 30px rgba(217, 70, 239, 0.4);
}

/* ============================================
   Modaler
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(88, 28, 135, 0.8);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.3s ease;
    border: 3px solid var(--primary-color);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    letter-spacing: 1px;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
}

.modal-content p, .modal-content ul, .modal-content li {
    line-height: 1.9;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-content ul {
    margin-left: 20px;
}

.modal-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
    font-weight: 700;
}

.modal-content a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close:hover {
    color: var(--accent-color);
    transform: scale(1.3) rotate(90deg);
}

/* ============================================
   Hjälpklasser
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Animationer
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ============================================
   Responsiv design för mindre skärmar
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .quiz-header-content {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-title {
        font-size: 1.8rem;
    }

    .quiz-subtitle {
        font-size: 1rem;
    }

    .all-quiz-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .intro-section, #quizContent, .image-section {
        padding: 25px;
    }

    .intro-title {
        font-size: 1.6rem;
    }

    .intro-body {
        font-size: 1.05rem;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .answer-btn {
        font-size: 1.05rem;
        padding: 16px 18px;
    }

    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }

    .floating-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .modal-content {
        padding: 25px;
        margin: 15px;
        max-height: 85vh;
    }

    .result-title {
        font-size: 2rem;
    }

    .result-score {
        font-size: 2.5rem;
    }

    .quiz-image-container {
        max-width: 100%;
        min-height: 300px;
    }

    .continue-btn {
        padding: 16px 30px;
        font-size: 1.1rem;
    }
}

