/* ============================================
   CSS för Quiz: Små kommuner, stora skillnader
   Simrishamn och Tomelilla
   
   Skapad: 2025-11-14
   Struktur: Extern CSS-fil enligt best practice
   ============================================ */

/* ============================================
   Allmän styling och CSS-variabler
   Här definieras färger och gemensamma värden
   ============================================ */
:root {
    /* Primära färger - gröna toner för kommunal känsla */
    --primary-color: #16a34a;
    --primary-hover: #15803d;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    
    /* Bakgrunder och kort */
    --background: #f1f5f9;
    --card-bg: #ffffff;
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    
    /* Övriga designelement */
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    /* Grön gradient för kommunal känsla */
    background: linear-gradient(135deg, #065f46 0%, #16a34a 50%, #4ade80 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

/* ============================================
   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);
    overflow: hidden;
}

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

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

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

.quiz-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

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

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

.all-quiz-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Progressbar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ============================================
   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: 2px solid #e2e8f0;
}

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

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

.page-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.page-dot:hover {
    transform: scale(1.2);
    background: #94a3b8;
}

.page-dot.active {
    background: var(--primary-color);
    width: 14px;
    height: 14px;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.intro-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

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

.intro-body h3 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

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

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

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

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

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

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

/* Specialstyling för info-rutor i intro-texterna */
.info-box {
    background: #d1fae5;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
}

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

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

/* ============================================
   Bildsektion med startbild och knapp
   Uppdatering 2025-11-14: Växlande bilder för Simrishamn och Tomelilla
   ============================================ */
.image-section {
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.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-md);
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.quiz-image.active {
    display: block;
}

.image-text {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 600;
}

/* ============================================
   Knappar
   ============================================ */
.primary-btn, .secondary-btn, .continue-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Open Sans', sans-serif;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: var(--secondary-color);
    color: white;
    flex: 1;
}

.secondary-btn:hover:not(:disabled) {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.continue-btn {
    background: var(--success-color);
    color: white;
    padding: 16px 40px;
    font-size: 1.2rem;
}

.continue-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.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: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.question-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Svarsalternativ - Här används gul bakgrund enligt regel 18 för att visa att det är indata */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.answer-btn {
    background: #fef3c7; /* Gul bakgrund för att tydligt visa att det är indata */
    border: 2px solid #d1d5db;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-family: 'Open Sans', sans-serif;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #fde68a;
    transform: translateX(5px);
}

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

/* Feedback efter svar - grön eller röd enligt design */
.answer-btn.correct {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.answer-btn.incorrect {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

/* Feedback-text under svaren */
.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    animation: slideDown 0.3s ease;
}

.feedback.correct {
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.feedback.incorrect {
    background: #fee2e2;
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

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

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

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

/* Nästa-knapp efter svar */
.next-question-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--transition);
    font-family: 'Open Sans', sans-serif;
}

.next-question-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.result-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--success-color);
    margin: 30px 0;
}

.result-message {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 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: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    display: inline-block;
    min-width: 280px;
}

.restart-btn:hover, .browse-quiz-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Speciell styling för "Se alla quiz"-knappen */
.browse-quiz-btn {
    background: var(--success-color);
}

.browse-quiz-btn:hover {
    background: #059669;
}

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

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

.tech-btn {
    background: var(--primary-color);
}

.prompt-btn {
    background: var(--secondary-color);
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
}

/* ============================================
   Modaler
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.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);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Fredoka', sans-serif;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.modal-content p, .modal-content ul, .modal-content li {
    line-height: 1.8;
    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);
}

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

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--error-color);
    transform: scale(1.2);
}

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

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

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    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.5rem;
    }

    .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.4rem;
    }

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

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

    .answer-btn {
        font-size: 1rem;
        padding: 14px 16px;
    }

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

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .modal-content {
        padding: 25px;
        margin: 20px;
    }

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

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

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

