/* ============================================
   HOGWARTS HAUS-THEMES
   ============================================ */

:root {
    /* Standard (Neutral) - Beige/Grau */
    --primary-color: #6b7280;
    --primary-dark: #4b5563;
    --primary-light: #9ca3af;
    --secondary-color: #d1d5db;
    --accent-color: #9ca3af;
    --bg-color: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

/* Gryffindor - Rot & Gold */
[data-house="gryffindor"] {
    --primary-color: #920000;
    --primary-dark: #6b0000;
    --primary-light: #b30000;
    --secondary-color: #ECB92E;
    --accent-color: #ECB92E;
    --bg-color: #fef2f2;
    --bg-gradient: linear-gradient(135deg, #fee2e2 0%, #fef3c7 30%, #fee2e2 100%);
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #fecaca;
}

/* Slytherin - Grün & Silber */
[data-house="slytherin"] {
    --primary-color: #045C4B;
    --primary-dark: #023d32;
    --primary-light: #067a66;
    --secondary-color: #AAABB0;
    --accent-color: #AAABB0;
    --bg-color: #ecfdf5;
    --bg-gradient: linear-gradient(135deg, #d1fae5 0%, #e5e7eb 30%, #d1fae5 100%);
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #a7f3d0;
}

/* Hufflepuff - Gelb & Schwarz */
[data-house="hufflepuff"] {
    --primary-color: #4C4D53;
    --primary-dark: #2d2e33;
    --primary-light: #6b6c73;
    --secondary-color: #FCB92D;
    --accent-color: #FCB92D;
    --bg-color: #fffbeb;
    --bg-gradient: linear-gradient(135deg, #fef3c7 0%, #fde68a 30%, #fef3c7 100%);
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #fde68a;
}

/* Ravenclaw - Blau & Bronze */
[data-house="ravenclaw"] {
    --primary-color: #1F326B;
    --primary-dark: #152047;
    --primary-light: #2a4a8f;
    --secondary-color: #8B5E2A;
    --accent-color: #8B5E2A;
    --bg-color: #eff6ff;
    --bg-gradient: linear-gradient(135deg, #dbeafe 0%, #fde68a 30%, #dbeafe 100%);
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #bfdbfe;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   NAVIGATION (Neutral - Grau/Beige)
   ============================================ */

.navbar {
    background: #f5f5f0;
    color: #4b5563;
    padding: 0.75rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b7280;
}

.logo-img {
    max-height: 50px;
    max-width: 80px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
    display: block;
}

.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: #4b5563;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    cursor: pointer;
    padding: 0.5rem 0;
}

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

/* Haus-Farbschalter */
.house-selector {
    position: relative;
    display: inline-block;
}

.house-toggle {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.house-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.house-toggle.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.house-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

.house-menu.show {
    display: flex;
}

.house-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.house-option:hover {
    background: #f9fafb;
}

.house-option.active {
    background: #f3f4f6;
    border-color: var(--primary-color);
}

.house-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.house-option[data-house="gryffindor"] .house-color {
    background: linear-gradient(135deg, #920000 0%, #ECB92E 100%);
}

.house-option[data-house="slytherin"] .house-color {
    background: linear-gradient(135deg, #045C4B 0%, #AAABB0 100%);
}

.house-option[data-house="hufflepuff"] .house-color {
    background: linear-gradient(135deg, #FCB92D 0%, #4C4D53 100%);
}

.house-option[data-house="ravenclaw"] .house-color {
    background: linear-gradient(135deg, #1F326B 0%, #8B5E2A 100%);
}

.house-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

/* ============================================
   FOOTER (Neutral - Grau/Beige)
   ============================================ */

.footer {
    background: #f5f5f0;
    color: #4b5563;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #1f2937;
}

.footer-text {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ============================================
   LAYOUT
   ============================================ */

.view {
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
}

/* ============================================
   AUTH STYLES
   ============================================ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.6;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.btn-primary {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.error-message {
    color: var(--error-color);
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* ============================================
   QUIZ STYLES
   ============================================ */

.quiz-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.quiz-header.mobile-hidden h1 {
    display: none;
}

.quiz-progress {
    margin-bottom: 2rem;
    display: none;
}

.quiz-progress.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.progress-text {
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 0 8px;
}

.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
}

#quizStartArea {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#quizStartArea.hidden {
    display: none;
}

#quizStartArea p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

#quizStartArea .btn-large {
    align-self: center;
}

.quiz-content {
    min-height: 400px;
}

.question-card {
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg) 100%);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-header h2 {
    font-family: 'Open Sans', sans-serif;
    color: var(--primary-color);
    flex: 1;
    text-transform: none !important; /* Keine Großbuchstaben */
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 0;
}

.question-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge.origin {
    background: var(--secondary-color);
    color: white;
}

.badge.difficulty {
    background: var(--primary-color);
    color: white;
}

.badge.difficulty.leicht {
    background: var(--success-color);
}

.badge.difficulty.mittel {
    background: var(--warning-color);
    color: white;
}

.badge.difficulty.schwer {
    background: var(--error-color);
}

.answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.answer-btn {
    padding: 0.875rem 1.25rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    text-transform: none; /* Keine Großbuchstaben */
    line-height: 1.4;
    word-wrap: break-word;
}

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

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

.answer-btn.correct {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

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

.explanation {
    background: rgba(16, 185, 129, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    margin-top: 1rem;
    color: var(--text-color);
}

.report-btn {
    padding: 0.5rem 1rem;
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
    font-weight: 500;
    width: auto;
    align-self: flex-start;
    margin-left: 0;
}

.report-btn:hover {
    background: rgba(107, 114, 128, 0.2);
    border-color: var(--text-secondary);
}

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ============================================
   LEADERBOARD STYLES
   ============================================ */

.leaderboard-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

.leaderboard-container h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
}

@media (min-width: 769px) {
    .leaderboard-container h1 {
        display: none;
    }
}

.leaderboard-tabs {
    margin-bottom: 1.5rem;
}

.leaderboard-content {
    display: grid;
    gap: 1rem;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    align-items: center;
    border: 1px solid var(--border-color);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}

.leaderboard-rank.top1 {
    color: var(--secondary-color);
}

.leaderboard-username {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.leaderboard-stats {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   STATS STYLES
   ============================================ */

.stats-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

.stats-container h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
}

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

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
    border-radius: 20px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Quiz Summary */
.quiz-summary {
    text-align: center;
    padding: 2rem;
}

.quiz-summary h2 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.level-up-notification {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stat-item .stat-value {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.motivational-message {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 20px;
    margin: 2rem 0;
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* ============================================
   ADMIN STYLES
   ============================================ */

.admin-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

.admin-container h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-actions input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
}

.import-container {
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.import-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.import-container p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.import-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.import-container input[type="file"] {
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s;
}

.import-container input[type="file"]:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.import-container button {
    align-self: flex-start;
}

.questions-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.pagination {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

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

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--text-color);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.question-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--info-color);
    color: white;
}

.btn-edit:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--primary-color);
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content textarea,
.modal-content input,
.modal-content select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-content textarea:focus,
.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-content textarea {
    min-height: 100px;
    resize: vertical;
}

/* Reports */
.reports-list {
    display: grid;
    gap: 1rem;
}

.report-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--error-color);
    border: 1px solid var(--border-color);
}

.report-item.completed {
    border-left-color: var(--success-color);
}

.report-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* User Management */
.users-container {
    margin-top: 1rem;
}

.search-user-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.search-user-box .input-group {
    flex: 1;
    max-width: 400px;
}

.users-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.user-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-item-info {
    flex: 1;
}

.user-item-info h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.user-item-actions {
    display: flex;
    gap: 0.5rem;
}

.user-result-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
}

.user-result-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-family: 'Cinzel', serif;
}

.user-info {
    margin-bottom: 1.5rem;
}

.user-info p {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--text-color);
}

.user-actions {
    margin-top: 1rem;
}

.badge.admin {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.badge.user {
    background: var(--text-secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .view {
        padding: 0 0.5rem;
        margin: 0.5rem auto;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .logo-text {
        display: none;
    }

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

    .burger-menu {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #f5f5f0;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .nav-links.mobile-open {
        transform: translateX(0);
    }

    .nav-links a {
        width: 100%;
        padding: 0.75rem;
        text-align: center;
        border-bottom: 1px solid #e5e7eb;
    }

    .house-selector {
        width: 100%;
        margin-top: 0.5rem;
    }

    .quiz-header {
        margin-bottom: 0;
    }

    .quiz-header h1 {
        display: none;
    }

    .quiz-progress {
        margin-bottom: 1rem;
    }

    .progress-bar {
        height: 28px;
        margin-bottom: 0;
    }

    .progress-fill {
        min-width: 100px;
    }

    .progress-text {
        font-size: 0.75rem;
    }

    .quiz-container,
    .leaderboard-container,
    .stats-container,
    .admin-container {
        padding: 1rem;
        border-radius: 15px;
    }

    .question-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .question-header h2 {
        font-size: 1.25rem;
        width: 100%;
    }

    .question-badges {
        align-self: flex-end;
    }

    .badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
    }

    .answers {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .answer-btn {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .report-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        width: auto;
        margin-top: 0.5rem;
    }

    .leaderboard-tabs {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .leaderboard-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.75rem;
        padding: 1rem;
        text-align: left;
    }

    .leaderboard-rank {
        grid-column: 1;
        grid-row: 1;
        font-size: 2rem;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .leaderboard-username {
        grid-column: 1;
        grid-row: 2;
        font-size: 1.1rem;
    }

    .leaderboard-stats {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        text-align: left;
        font-size: 0.85rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .leaderboard-stats > div {
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .house-menu {
        right: auto;
        left: 0;
        width: 100%;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .admin-tabs {
        gap: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .tab-btn {
        flex: 1 1 calc(50% - 0.125rem);
        min-width: 0;
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .admin-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .admin-actions button {
        width: 100%;
    }

    .admin-actions input {
        width: 100%;
        min-width: 0;
    }

    .import-container {
        padding: 1.5rem;
    }

    .import-container h3 {
        font-size: 1.25rem;
    }

    .import-container p {
        font-size: 0.85rem;
    }

    .import-container form {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .view {
        padding: 0 0.25rem;
        margin: 0.25rem auto;
    }

    .quiz-container,
    .leaderboard-container,
    .stats-container,
    .admin-container {
        padding: 0.75rem;
    }

    .question-card {
        padding: 0.75rem;
    }

    .question-header h2 {
        font-size: 1.1rem;
    }

    .progress-bar {
        height: 26px;
    }

    .progress-text {
        font-size: 0.7rem;
    }

    .progress-fill {
        min-width: 80px;
    }

    .answer-btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .report-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .tab-btn {
        flex: 1 1 100%;
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }

    .import-container {
        padding: 1rem;
    }

    .import-container h3 {
        font-size: 1.1rem;
    }

    .import-container p {
        font-size: 0.8rem;
    }
}
