/* Frødesams CSS - Neobrutalisme stil */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', 'Arial Bold', Arial, system-ui, sans-serif;
    background-color: #FFB6C1;
    min-height: 100vh;
    color: #000;
    line-height: 1.4;
}

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

/* Header */
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.header-icon {
    font-size: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #000;
    margin: 0;
}

.subtitle {
    font-family: Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 4px;
    color: #000;
}

.header-stripe {
    height: 8px;
    background: repeating-linear-gradient(
        -45deg,
        #000 0px, #000 5px,
        #FFB6C1 5px, #FFB6C1 14px
    );
    margin: 20px 0 32px;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #000;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 12px 24px;
    font-family: 'Arial Black', Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s;
    text-decoration: none;
    line-height: 1.2;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 4px 4px 0 #000 !important;
}

.btn-primary { background: #4CAF50; color: #fff; }
.btn-blue    { background: #3498DB; color: #fff; }
.btn-yellow  { background: #FFDB58; }
.btn-purple  { background: #8B5CF6; color: #fff; }
.btn-danger  { background: #E74C3C; color: #fff; }
.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-width: 2px;
    box-shadow: 3px 3px 0 #000;
}

/* Neobrutalisme Box */
.neo-box {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 6px 6px 0 #000;
    padding: 24px;
    margin-bottom: 20px;
}

/* Section Label */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFDB58;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 8px 22px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    margin-bottom: 20px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 900;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 3px solid #000;
    font-family: Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    background: #fff;
    color: #000;
    transition: box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    box-shadow: 4px 4px 0 #000;
    background: #f0f8ff;
}

.form-input::placeholder {
    color: #999;
    font-weight: 400;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Layout Utils */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

/* Team System */
.main-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    align-items: center;
}

.nav-logo {
    text-decoration: none;
    cursor: pointer;
    padding: 8px 12px;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, box-shadow 0.1s;
}

.nav-logo:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.nav-logo:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.team-name {
    flex: 1;
}

/* Quiz Grid */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.quiz-card {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 20px;
}

.quiz-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #000;
}

.quiz-card p {
    font-family: Arial, system-ui, sans-serif;
    font-size: 0.9rem;
    color: #333;
}

/* Teams Score */
.teams-score {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.team-score {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name-display {
    font-weight: 900;
    font-size: 1rem;
}

.team-points {
    font-weight: 900;
    font-size: 1.2rem;
    background: #FFB6C1;
    padding: 4px 12px;
    border: 2px solid #000;
}

/* Question Display */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #000;
}

.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
}

.question-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Answer Board for Frødesams */
.answer-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    font-weight: 700;
    cursor: pointer;
}

.answer-item.hidden {
    display: none;
}

.answer-item.revealed {
    background: #4CAF50;
    color: #fff;
}

.answer-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #FFDB58;
    border: 3px solid #000;
    font-size: 1.3rem;
    font-weight: 900;
    flex-shrink: 0;
}

.answer-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.4;
    text-align: center;
}

.answer-text.hidden-content {
    font-style: italic;
    color: #999;
    font-size: 2rem;
}

.answer-points {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 32px;
    background: #87CEEB;
    border: 3px solid #000;
    font-size: 1.5rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* Controller mode - always show answers */
.controller-mode .answer-item {
    display: flex !important;
}

/* Display mode - show numbered boxes with question marks */
body:not(.controller-mode) .answer-item {
    display: flex !important;
}

/* Point Controls */
.point-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.point-btn {
    padding: 8px 12px;
    border: 2px solid #000;
    background: #fff;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.point-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 #000;
}

.point-btn.positive {
    background: #4CAF50;
    color: #fff;
}

.point-btn.negative {
    background: #E74C3C;
    color: #fff;
}

.point-btn.team-1 { border-color: var(--team1-color, #FF6B6B); }
.point-btn.team-2 { border-color: var(--team2-color, #4ECDC4); }
.point-btn.team-3 { border-color: var(--team3-color, #45B7D1); }
.point-btn.team-4 { border-color: var(--team4-color, #96CEB4); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #000;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

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

/* Editor Tab Bar */
.editor-tab-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.editor-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.editor-tab {
    padding: 8px 16px;
    border: 2px solid #000;
    background: #fff;
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    transition: background 0.1s;
}

.editor-tab:hover {
    background: #f0f0f0;
}

.editor-tab.active {
    background: #FFB6C1;
    border-bottom: 2px solid #FFB6C1;
    position: relative;
    z-index: 1;
}

.category-tab-content {
    border: 2px solid #000;
    padding: 16px;
    background: #f9f9f9;
    margin-top: -2px;
}

/* Answer Inputs */
.answer-input {
    display: grid;
    grid-template-columns: 1fr 100px auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.points-label {
    padding: 8px;
    border: 2px solid #000;
    font-weight: 900;
    text-align: center;
    background: #f0f0f0;
    font-size: 0.85rem;
}

.answer-input .form-input {
    margin-bottom: 0;
}

/* Editor Errors */
.editor-errors {
    border: 3px solid #E53935;
    background: #FFEBEE;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.editor-error-item {
    font-weight: 700;
    font-size: 0.9rem;
    color: #C62828;
    margin-bottom: 4px;
}

.editor-error-item:last-child {
    margin-bottom: 0;
}

.editor-success {
    font-weight: 900;
    font-size: 1rem;
    color: #2E7D32;
    padding: 12px 16px;
    margin-bottom: 8px;
}

/* Export / Import Section */
.file-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.file-box {
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 16px;
}

.file-box h3 {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.file-box p {
    font-size: 0.85rem;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.file-export {
    background: #BAFCA2;
}

.file-import {
    background: #FFB2EF;
}

@media (max-width: 600px) {
    .file-grid {
        grid-template-columns: 1fr;
    }
}

/* Editor Checkbox */
.editor-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
}

.editor-checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #000;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .header-icon {
        font-size: 2rem;
    }

    .main-nav {
        justify-content: center;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .teams-score {
        grid-template-columns: 1fr;
    }

    .point-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .answer-item {
        padding: 12px;
        font-size: 0.9rem;
    }

    .answer-number {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .answer-points {
        font-size: 1.2rem;
        padding: 6px 12px;
        min-width: 50px;
    }

    .quiz-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .header-inner {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .section-label {
        font-size: 0.9rem;
        padding: 6px 16px;
    }

    .neo-box {
        padding: 16px;
    }

    .answer-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .answer-number {
        align-self: flex-start;
    }

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

    .team-input {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-remove-team {
        align-self: flex-end;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 25px rgba(76, 175, 80, 0.8); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Screen transitions */
.screen {
    animation: slideIn 0.3s ease-out;
}

.question-display {
    animation: slideIn 0.3s ease-out;
}

/* Answer item animations */
.answer-item {
    transition: all 0.3s ease;
}

.answer-item.revealed {
    animation: bounce 0.5s ease-out;
    animation-delay: 0.1s;
}

.answer-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

/* Team score update animation */
.team-score {
    transition: all 0.3s ease;
}

.team-score.updated {
    animation: pulse 0.5s ease-out;
    background: #4CAF50;
    color: #fff;
}

/* Modal animation */
.modal {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: slideIn 0.3s ease-out;
}

/* Current Team Indicator */
.current-team {
    display: inline-block;
    padding: 8px 16px;
    background: #FFDB58;
    border: 3px solid #000;
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* Controller-specific styles */
.controller-mode .answer-item {
    cursor: pointer;
}

.controller-mode .answer-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.controller-mode .answer-text.hidden-content {
    color: #333;
    font-style: normal;
}

/* Focus styles for accessibility */
.btn:focus,
.form-input:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .main-nav,
    .question-controls,
    .point-controls,
    .btn-remove-team {
        display: none !important;
    }
    
    .neo-box {
        break-inside: avoid;
        box-shadow: none !important;
        border: 2px solid #000 !important;
    }
}
