/* ===== SITE HEADER ===== */
.site-header {
    background: #19374f;
    color: white;
    width: 100%;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 80px;
}

/* Hamburger Menu Button - dold på desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: auto;
}

/* Navigation - Desktop (inline) */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
}

.nav-link {
    color: #fef4dd;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-section {
    position: relative;
}

.nav-section-title {
    display: inline-block;
    color: #fef4dd;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: opacity 0.2s;
    margin: 0;
}

.nav-section-title:hover {
    opacity: 0.8;
}

/* Dropdown på desktop - dölj dropdown-menyn initialt */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 0.25rem);
    left: 0;
    padding-top: 0.75rem;
    background: transparent;
    min-width: 200px;
    z-index: 1000;
}

/* Visa dropdown vid hover */
.nav-section:hover .nav-dropdown {
    display: block;
}

/* Styling för länkar i dropdown */
.nav-dropdown .nav-link {
    display: block;
    color: #333;
    padding: 0.75rem 1.5rem;
    background: white;
    transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-dropdown .nav-link:first-child {
    border-radius: 4px 4px 0 0;
}

.nav-dropdown .nav-link:last-child {
    border-radius: 0 0 4px 4px;
}

.nav-dropdown .nav-link:not(:first-child) {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.nav-dropdown .nav-link:hover {
    background: #f5f5f5;
    opacity: 1;
}

/* Overlay background */
.nav-overlay {
    display: none;
}

/* Search Form */
.search-form {
    flex: 1;
    max-width: 600px;
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    outline: none;
    color: #666;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: #e45a2e;
    border: none;
    padding: 0.75rem 1.4rem;
    color: #fef4dd;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.search-btn:hover {
    background: #af4726;
}

/* Header Icons */
.header-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-shrink: 0;
}

.header-icon {
    color: #fef4dd;
    text-decoration: none;
    transition: opacity 0.2s;
    position: relative;
}

.header-icon:hover {
    opacity: 0.8;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fef4dd;
    transition: all 0.3s;
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translateY(6px);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translateY(-6px);
}


/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 992px) {

    /* Visa hamburger-menyn */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Navigation som sidebar på mobil */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100%;
        background: white;
        padding: 2rem 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 9999;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-link {
        display: block !important;
        width: 100%;
        padding: 1rem 2rem;
        color: #333;
        transition: background 0.2s;
        position: relative !important;
        box-shadow: none !important;
        background: white !important;
        margin-top: 0 !important;
    }
    
    .nav-link:hover {
        background: #f5f5f5 !important;
        opacity: 1;
    }
    
    .nav-section {
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e0e0e0;
    }
    
    /* Visa dropdown-container alltid på mobil */
    .nav-dropdown {
        display: block !important;
        position: relative !important;
        margin-top: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        padding-top: 0 !important;
        background: white !important;
        top: auto !important;
    }
    
    .nav-dropdown .nav-link {
        border-radius: 0 !important;
    }
    
    .nav-section-title {
        display: block;
        padding: 0.5rem 2rem;
        color: #666;
        font-size: 0.85rem;
        font-weight: 600;
        text-transform: uppercase;
        margin: 0;
        cursor: default;
        pointer-events: none;
    }
    
    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
    }
    
    .nav-overlay.active {
        display: block;
    }
    
    /* Anpassa header-layout för mobil */
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Logo i mitten på första raden */
    .logo {
        order: 2;
        margin: 0 auto;
    }
    
    /* Hamburger till vänster */
    .mobile-menu-btn {
        order: 1;
    }
    
    /* Ikoner till höger */
    .header-icons {
        order: 4;
        gap: 1rem;
    }
    
    /* Sökfält inline */
    .search-form {
        order: 4;
        flex: 1;
        max-width: 100%;
    }
    
    .main-content {
        padding-top: 1rem;
    }
}

/* Sökfält på egen rad  */
@media (max-width: 768px) {
    .search-form {
        width: 100%;
        flex: 0 0 100%;
        margin: 0.5rem 0 1rem 0;
    }
    .header-icons {
        order: 3;
        gap: 1rem;
    }
    .header-container {
        height: auto;
        gap: 0rem;
    }

}


#quiz-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

.quiz-card header a {
    text-decoration: none;
    color: #2c3e50;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-header h1, .quiz-header h2 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.quiz-description, .quiz-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

#quiz-progress, #quizProgress {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
    color: #495057;
    font-weight: 600;
}

.quiz-progress-bar {
    width: 100%;
    height: 3px;
    background-color: #dbdcdd;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background-color: #e45a2e;
    width: 0%;
    transition: width 0.3s ease;
}

.question-progress {
    text-align: center;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 1.1em;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s ease;
}

#quiz-questions, #quizContainer {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-question, .question-container {
    display: none;
    margin-bottom: 30px;
}

.quiz-question.active, .question-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.quiz-question h3, .question-container h2 {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.quiz-question-image, .question-image, .quiz-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsiva bilder för olika skärmstorlekar */
@media (max-width: 768px) {
    .quiz-question-image, .question-image, .quiz-image {
        max-width: 100%;
        margin: 15px 0 0 0;
    }
}

.quiz-answers, .answers {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-answers-list {
    flex: 1;
    width: 100%;
}

.quiz-answer-option, .answer-option {
    display: block;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    position: relative;
    overflow: hidden;
    width: 100% !important;
}

/* Hover-effekt endast för enheter med mus (ej touchskärmar) */
@media (hover: hover) {
    .quiz-answer-option:hover, .answer-option:hover {
        background: #e9ecef;
        border-color: #6c757d;
    }
}

.quiz-answer-option input[type="radio"] {
    display: none;
}

.quiz-answer-option.selected, .answer-option.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.quiz-answer-option.correct, .answer-option.correct {
    background: #d4edda !important;
    border-color: #28a745 !important;
    color: #155724 !important;
    font-weight: 600;
}

.quiz-answer-option.incorrect, .answer-option.incorrect {
    background: #f8d7da !important;
    border-color: #dc3545 !important;
    color: #721c24 !important;
    font-weight: 600;
}

.quiz-answer-option.disabled, .answer-option.disabled {
    pointer-events: none;
    opacity: 0.8;
}

.quiz-stats, .answer-percentage {
    position: absolute;
    top: 8px;
    right: 15px;
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInStats 0.6s ease forwards;
}

.quiz-stats-bar, .answer-stats-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 1;
    opacity: 0;
    animation: fadeInStatsBar 0.4s ease forwards 0.2s;
}

.quiz-stats-fill, .answer-stats-fill {
    height: 100%;
    background: rgba(108, 117, 125, 0.3);
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
    animation: fillProgressBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.6s;
}

.quiz-answer-option.correct .quiz-stats-fill, 
.answer-option.correct .answer-stats-fill,
.answer-stats-fill.correct-answer {
    background: rgba(40, 167, 69, 0.3);
}

.quiz-answer-option.incorrect .quiz-stats-fill,
.answer-option.incorrect .answer-stats-fill,
.answer-stats-fill.user-incorrect {
    background: rgba(220, 53, 69, 0.3);
}

.answer-stats-fill.neutral {
    background: rgba(108, 117, 125, 0.3);
}

.quiz-answer-option span, .answer-option span {
    position: relative;
    z-index: 5;
}

/* Tangentbordssystem för desktop */
.quiz-keyboard-hints {
    display: none;
    flex-direction: column;
    padding-top: 50px;
    align-items: flex-start;
    width: 100%;
    margin-top: 0;
}

@media (min-width: 769px) {
    .quiz-keyboard-hints {
        display: flex;
    }
}

.keyboard-hints-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #9e9e9e;
    margin-bottom: 4px;
}

.keyboard-hints-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyboard-hint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
    color: #9e9e9e;
}

.keyboard-key {
    display: inline-block;
    padding: 2px 3px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    font-weight: 600;
    color: #9e9e9e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 28px;
    text-align: center;
}

.keyboard-key:last-child {
    min-width: 60px;
}

.keyboard-label {
    color: #6c757d;
    font-size: 0.85em;
}

/* Visa tangentbordssystem endast på desktop */
@media (max-width: 768px) {
    .quiz-keyboard-hints {
        display: none;
    }
}

/* Animeringar för statistik */
@keyframes slideInStats {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInStatsBar {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fillProgressBar {
    from {
        width: 0;
    }
    to {
        width: var(--fill-width, 0%);
    }
}

/* Staggered animation för svarsalternativ */
.quiz-answer-option.showing-stats, .answer-option.showing-stats {
    animation: pulseStats 0.3s ease;
}

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

/* Animering för när svarsalternativ får rätt/fel styling */
.quiz-answer-option.correct, .answer-option.correct,
.quiz-answer-option.incorrect, .answer-option.incorrect {
    animation: revealAnswer 0.5s ease;
}

@keyframes revealAnswer {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}

.quiz-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.quiz-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quiz-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.primary {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.primary:hover {
    background: #218838;
    text-decoration: none;
}

/* ===== KATEGORIER ===== */
.categories-section {
    margin: 3rem 0;
    padding: 0 1rem;
}

.categories-section h2 {
    text-align: left;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

/* Kategori-header (när en specifik kategori är vald) */
.category-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin: 0 0 3rem 0;
}

.category-header-content {
    flex: 1;
}

.category-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.category-description {
    /* font-size: 0.75rem; */
    color: #666;
    line-height: 1.6;
    margin: 0;
    /* padding: 5px; */
}
.categories-grid .category-description {
    font-size: 0.75rem;
    padding: 5px;
}

.category-header-image {
    flex-shrink: 0;
    width: 300px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    /* background: #fad4d4; */
}

.category-header-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

@media (max-width: 768px) {
    .category-header {
        flex-direction: row;
    }
    
    .category-header-image {
        width: 30%;
        order: 2;
    }
    
    .category-header-content {
        order: 1;
        flex: 1;
    }
    
    .category-header h1 {
        font-size: 2rem;
    }
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 0;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.active {
    border-color: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.category-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7ddd5;
    overflow: hidden;
    margin: 0;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.category-placeholder {
    font-size: 3rem;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    padding: 0.75rem 0.5rem 0.25rem 0.5rem;
    color: #333;
}

.category-count {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    padding: 0 0.5rem 0.75rem 0.5rem;
}

@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-name {
        font-size: 0.9rem;
    }
    
    .category-count {
        font-size: 0.8rem;
    }
}

@media (max-width: 650px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .categories-section {
        padding: 0 0.5rem;
    }
}


.quiz-next-btn, #nextButton, #showResultsButton {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s ease;
    display: none;
}

.quiz-cancel-link {
    margin: 4rem 0;
}

.quiz-cancel-link a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85em;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    display: inline-block;
}

.quiz-cancel-link a:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.quiz-next-btn:hover, #nextButton:hover, #showResultsButton:hover {
    background: #218838;
}

#nextButton.show, #showResultsButton.show {
    display: inline-block;
}

/* Resultat-sida */
#quiz-results, #resultsContainer, .results-container {
    text-align: center;
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: none;
}

#quiz-results.show, #resultsContainer.show, .results-container.show {
    display: block;
}

#quiz-results h3, #resultsContainer h1, .results-container h1 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 0px;
}

#quiz-score, #scoreDisplay, .score-display {
    font-size: 2.5em;
    font-weight: 700;
    color: #dc3545;
}

#quiz-details {
    font-size: 2.5em;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 0.5rem;
}

#quiz-stats {
    margin-bottom: 1rem;
    font-size: 1.2em;
    color: #495057;
}

#quiz-feedback-message, #feedbackMessage, .feedback-message {
    font-size: 1.3em;
    font-weight: 600;
    margin: 10px 0;
    color: #2c3e50;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#quiz-comparison, .comparison-text {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 1.1em;
    color: #495057;
}

.quiz-share-buttons, .share-buttons {
    margin-top: 20px;
}

/* Gemensam basstil för alla quiz-knappar */
.quiz-share-buttons button, .share-buttons button,
.quiz-share-buttons a, .share-buttons a {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 6px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin: 0 10px !important;
    transition: background 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    height: auto !important;
    min-height: 44px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
}

/* Hover-effekt för alla knappar */
.quiz-share-buttons button:hover, .share-buttons button:hover,
.quiz-share-buttons a:hover, .share-buttons a:hover {
    background: #5a6268 !important;
}

/* Färgvarianter */
.quiz-share-buttons button.primary, .share-buttons button.primary,
.quiz-share-buttons a.primary, .share-buttons a.primary {
    background: #007bff !important;
}

.quiz-share-buttons button.primary:hover, .share-buttons button.primary:hover,
.quiz-share-buttons a.primary:hover, .share-buttons a.primary:hover {
    background: #0056b3 !important;
}

.quiz-share-buttons button.success, .share-buttons button.success,
.quiz-share-buttons a.success, .share-buttons a.success {
    background: #28a745 !important;
}

.quiz-share-buttons button.success:hover, .share-buttons button.success:hover,
.quiz-share-buttons a.success:hover, .share-buttons a.success:hover {
    background: #218838 !important;
}

.quiz-share-buttons button.info, .share-buttons button.info,
.quiz-share-buttons a.info, .share-buttons a.info {
    background: #17a2b8 !important;
}

.quiz-share-buttons button.info:hover, .share-buttons button.info:hover,
.quiz-share-buttons a.info:hover, .share-buttons a.info:hover {
    background: #138496 !important;
}

/* Responsiv design */
@media (max-width: 768px) {
    
    .quiz-header h1, .quiz-header h2 {
        font-size: 1.8em;
    }
    
    #quiz-results, #resultsContainer, .results-container {
        padding: 25px;
    }
    
    #quiz-score, #scoreDisplay, .score-display {
        font-size: 2em;
    }
    
    .quiz-share-buttons button, .share-buttons button,
    .quiz-share-buttons a, .share-buttons a {
        display: block !important;
        width: 100%;
        margin: 10px 0 !important;
    }
}

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

.quiz-question, .question-container {
    animation: fadeIn 0.5s ease;
}

.quiz-feedback {
    animation: fadeIn 0.3s ease;
}

#quiz-results, #resultsContainer, .results-container {
    animation: fadeIn 0.5s ease;
}

/* Realistiskt fyrverkeri-animering för perfekt resultat */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.pyro {
    position: absolute;
    width: 100%;
    height: 100%;
}

.pyro > .before, .pyro > .after {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff,
        0 0 #fff;
    animation: 1s bang ease-out infinite backwards, 1s gravity ease-in infinite backwards, 5s position linear infinite backwards;
}

.pyro > .after {
    animation-delay: 1.25s, 1.25s, 1.25s;
    animation-duration: 1.25s, 1.25s, 6.25s;
}

@keyframes bang {
    to {
        box-shadow: 
            -120px -218px #ff6b6b,
            248px -16px #4ecdc4,
            190px 16px #45b7d1,
            -113px -308px #96ceb4,
            -109px -287px #feca57,
            -50px -313px #ff9ff3,
            -226px -31px #54a0ff,
            66px -218px #5f27cd,
            72px -187px #00d2d3,
            -141px -139px #ff3838,
            29px -122px #ff6348,
            78px -68px #ffa502,
            -184px -84px #2ed573,
            -168px -229px #1e90ff,
            -27px -156px #5352ed,
            -130px -243px #ff4757,
            137px -250px #ffa502,
            245px -156px #2ed573,
            162px -234px #3742fa,
            168px -89px #ff6b6b,
            -148px -123px #4ecdc4,
            150px -169px #45b7d1,
            -61px -195px #96ceb4,
            78px -95px #feca57,
            -12px -245px #ff9ff3,
            34px -200px #54a0ff,
            -83px -133px #5f27cd,
            218px -272px #00d2d3,
            -43px -94px #ff3838,
            95px -175px #ff6348,
            -89px -4px #ffa502,
            -24px -72px #2ed573,
            -196px -157px #1e90ff,
            -159px -49px #5352ed,
            76px -258px #ff4757,
            -217px -187px #ffa502,
            -186px -222px #2ed573,
            115px -92px #3742fa,
            -105px -46px #ff6b6b,
            -95px -26px #4ecdc4,
            -37px -201px #45b7d1,
            -156px -238px #96ceb4,
            -211px -267px #feca57,
            -58px -97px #ff9ff3,
            -72px -61px #54a0ff,
            -215px -182px #5f27cd,
            41px -37px #00d2d3,
            -99px -6px #ff3838,
            33px -71px #ff6348,
            172px -161px #ffa502,
            -95px -35px #2ed573,
            -66px -169px #1e90ff,
            214px -19px #5352ed,
            64px -338px #ff4757;
    }
}

@keyframes gravity {
    to {
        transform: translateY(200px);
        opacity: 0;
    }
}

@keyframes position {
    0%, 19.9% {
        margin-top: 10%;
        margin-left: 40%;
    }
    20%, 39.9% {
        margin-top: 40%;
        margin-left: 30%;
    }
    40%, 59.9% {  
        margin-top: 20%;
        margin-left: 70%
    }
    60%, 79.9% {  
        margin-top: 30%;
        margin-left: 20%;
    }
    80%, 99.9% {  
        margin-top: 30%;
        margin-left: 80%;
    }
}

.quiz-image-credit {
    color: #888;
    font-size: 0.75em;
    text-align: right;
    margin-top: 2px;
    font-style: italic;
}

/* Index page styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

.main-content {
    padding-top: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    line-height: normal;
}


.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 100%;
}

@media (min-width: 992px) {
    .quiz-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.quiz-card {
    background: white;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quiz-card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.quiz-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.quiz-card:hover .quiz-card-image {
    transform: scale(1.05);
}

.quiz-card-image-credit {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    text-align: right;
    line-height: 1.2;
}

.quiz-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.quiz-card-header {
    margin-bottom: 0.5rem;
}

.quiz-card-category {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.draft-badge {
    display: inline-block;
    background: #ff9800;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    margin-right: 0.2rem;
}

.quiz-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.quiz-card-stats {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 500;
}

.quiz-card p {
    color: #6b7280;
    line-height: 1.6;
    margin: 1rem 0 1.5rem 0;
    flex-grow: 1;
    font-size: 0.95rem;
}

.quiz-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
}

.quiz-card-meta-item {
    text-align: center;
}

.quiz-card-meta-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    display: block;
    margin-bottom: 0.25rem;
}

.quiz-card-meta-label {
    font-size: 0.875rem;
    color: #6b7280;
    display: block;
    font-weight: 500;
}

.quiz-card-button {
    display: block;
    width: 100%;
    background: #19374f;
    color: #fef4dd;
    text-align: center;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.quiz-card-button:hover {
    background: #af4726;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.2);
}

/* ===== SÖKRESULTAT ===== */

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    line-height: 1.2;
}


.error-message {
    background: #fee;
    color: #c53030;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #c53030;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-results h2 {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results ul {
    text-align: left;
    max-width: 400px;
    margin: 1.5rem auto 0;
    color: #6b7280;
}

.search-summary {
    margin-bottom: 2rem;
}

.search-summary p {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-weight: 500;
}

.priority-info {
    font-size: 0.9rem;
    color: #6b7280;
}

.search-results-section {
    margin-bottom: 3rem;
}

.results-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.results-section-title svg {
    color: #3b82f6;
}

/* Sökresultat-specifika element */
.matching-question {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    padding: 0.75rem;
    margin: 0.75rem 0 1rem 0;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.matching-question strong {
    color: #1e40af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    color: #374151;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}


/* Markera söktermen */
mark {
    background: #fef08a;
    color: #854d0e;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Hjälptext för sökning */
.search-help {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.search-help h2 {
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.search-help p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.search-help ul {
    text-align: left;
    max-width: 500px;
    margin: 1.5rem auto;
    color: #4b5563;
}

.search-help li {
    margin-bottom: 0.5rem;
}

.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

.search-suggestion {
    background: #f3f4f6;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.search-suggestion:hover {
    background: #19374f;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsiv design för sökresultat */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .results-section-title {
        font-size: 1.3rem;
    }
    
    .search-help {
        padding: 2rem 1.5rem;
    }
    
    .popular-searches {
        gap: 0.5rem;
    }
    
    .search-suggestion {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

.quiz-card footer {
    margin-top: auto !important;
}

/* ===== FAVORIT-HJÄRTA ===== */
.favorite-heart {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.favorite-heart:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-heart.favorited {
    background: rgba(255, 182, 193, 0.9);
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Favorit-notifiering */
.favorite-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

/* ===== FAVORIT-LISTA ===== */
.no-favorites {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-favorites-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.no-favorites h2 {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-favorites p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.browse-quizzes-btn {
    display: inline-block;
    background: #19374f;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.browse-quizzes-btn:hover {
    background: #1a3d55;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 55, 79, 0.3);
    text-decoration: none;
    color: white;
}

.loading-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.error-message {
    background: #fee;
    color: #c53030;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid #c53030;
}

/* Responsiv design för favoriter */
@media (max-width: 768px) {
    .no-favorites {
        padding: 3rem 1.5rem;
    }
    
    .no-favorites-icon {
        font-size: 3rem;
    }
    
    .no-favorites h2 {
        font-size: 1.3rem;
    }
    
    .no-favorites p {
        font-size: 1rem;
    }
    
    .browse-quizzes-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

.quiz-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.quiz-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.quiz-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    border-top: 1px solid #e0e0e0;
    margin-top: 3rem;
    font-size: 0.95rem;
}

footer p {
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 1.5rem;
    background: #19374f;
    color: #fef4dd;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pagination-btn:hover {
    background: #af4726;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 55, 79, 0.2);
}

.pagination-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #19374f;
    color: #fef4dd;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination-page:hover {
    background: #af4726;
    color: #fef4dd;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(25, 55, 79, 0.2);
}

.pagination-current {
    background: #e45a2e !important;
    color: white !important;
    border-color: #e45a2e !important;
    cursor: default;
}



.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #6c757d;
    font-weight: 500;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1rem;
}

/* Responsiv design för pagination */
@media (max-width: 768px) {
    .pagination-container {
        gap: 0.5rem;
    }
    
    .pagination-btn {
        height: 36px;
        padding: 0 1rem;
        font-size: 0.9rem;
    }
    
    .pagination-page {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .pagination-ellipsis {
        width: 36px;
        height: 36px;
    }
    
    .pagination-info {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* På mobil: använd grid för att placera knapparna på samma rad */
    .pagination-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1rem;
        justify-items: center;
        align-items: center;
    }
    
    /* Placera Föregående-knappen i övre vänstra hörnet */
    .pagination-prev {
        grid-column: 1;
        grid-row: 1;
        justify-self: end;
    }
    
    /* Placera Nästa-knappen i övre högra hörnet */
    .pagination-next {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
    }
    
    /* Placera sidnumren under knapparna */
    .pagination-pages {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: center;
    }
}