/* FPL Quizmas Styles */

#quizmas-app {
    margin: 0 auto;
    padding: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 80vh;
    background: #ffffff;
}

.quizmas-screen {
    max-width: 600px;
    margin: 0 auto;
    display: none;
    text-align: center;
}

.quizmas-screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Start Screen */
.quizmas-logo h1 {
    font-size: 2.5em;
    color: #37003c;
    margin-bottom: 0.3em;
    font-weight: 700;
}

.quizmas-tagline {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 1.5em;
}

.quizmas-intro {
    color: #666;
    margin: 1.5em 0;
    font-size: 1em;
}

/* Buttons */
.quizmas-btn {
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 600;
    border: 2px solid #37003c;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.2s ease;
    background: white;
    color: #37003c;
}

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

.quizmas-btn-primary {
    background: linear-gradient(135deg, #00ff87, #00e67a);
    color: #37003c;
    font-size: 1.1em;
    padding: 16px 40px;
}

.quizmas-btn-primary:hover {
    background: linear-gradient(135deg, #00e67a, #00cc6a);
}

/* Loading */
.quizmas-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #37003c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#quizmas-loading p {
    color: #666;
    font-size: 1.1em;
}

/* Progress Bar */
.quizmas-progress {
    margin-bottom: 20px;
}

.quizmas-progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

#quizmas-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff87, #04f5ff);
    transition: width 0.4s ease;
    width: 0%;
}

#quizmas-progress-text {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.quizmas-score-display {
    font-size: 1.2em;
    color: #37003c;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Question Content */
.quizmas-question-content {
    background: linear-gradient(135deg, #37003c, #2a0030);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(55, 0, 60, 0.3);
}

#quizmas-player-name {
    font-size: 2em;
    margin: 0 0 15px 0;
    font-weight: 700;
}

#quizmas-question-text {
    font-size: 1.15em;
    opacity: 0.95;
    margin: 0;
    line-height: 1.4;
}

/* Answers */
.quizmas-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.quizmas-answer-btn {
    padding: 18px 15px;
    font-size: 1.1em;
    font-weight: 600;
    background: white;
    border: 3px solid #37003c;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #37003c;
}

.quizmas-answer-btn:hover:not(:disabled) {
    background: #f8f0f9;
    transform: scale(1.02);
}

.quizmas-answer-btn.correct {
    background: #00ff87;
    border-color: #00ff87;
    color: #37003c;
    animation: pulse 0.3s ease;
}

.quizmas-answer-btn.incorrect {
    background: #ff5252;
    border-color: #ff5252;
    color: white;
    animation: shake 0.3s ease;
}

.quizmas-answer-btn.reveal-correct {
    background: #00ff87;
    border-color: #00ff87;
    color: #37003c;
}

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

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

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

/* Feedback */
.quizmas-feedback {
    min-height: 50px;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 1.05em;
}

.quizmas-feedback.correct {
    background: linear-gradient(135deg, #e6fff5, #d0ffe8);
    color: #00875a;
}

.quizmas-feedback.incorrect {
    background: linear-gradient(135deg, #ffe6e6, #ffd0d0);
    color: #cc0000;
}

/* Results */
#quizmas-results h2 {
    color: #37003c;
    font-size: 2em;
    margin-bottom: 0.5em;
}

.quizmas-final-score {
    font-size: 4em;
    font-weight: 700;
    color: #37003c;
    margin: 20px 0;
}

#quizmas-final-score-value {
    color: #00a651;
}

#quizmas-result-message {
    font-size: 1.4em;
    margin-bottom: 25px;
    color: #555;
}

#quizmas-emoji-grid {
    font-size: 1.8em;
    letter-spacing: 4px;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Share Section */
.quizmas-share {
    margin: 25px 0;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.quizmas-share-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.quizmas-share-buttons .quizmas-btn {
    flex: 1;
    flex-shrink: 1;
    min-width: 0;
}

.quizmas-settings-link {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
}

.quizmas-settings-link:hover {
    color: #37003c;
}

/* Voucher Section */
.quizmas-voucher {
    margin: 30px 0;
    padding: 25px 20px;
    background: linear-gradient(135deg, #37003c 0%, #5a0f60 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(55, 0, 60, 0.25);
}

.quizmas-voucher::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 135, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.quizmas-voucher-badge {
    display: inline-block;
    background: #00ff87;
    color: #37003c;
    font-size: 0.75em;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.quizmas-voucher h3 {
    color: white;
    font-size: 1.4em;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.quizmas-voucher p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 15px 0;
    font-size: 0.95em;
}

.quizmas-voucher-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(0, 255, 135, 0.6);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.quizmas-voucher-code span {
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: 700;
    color: #00ff87;
    letter-spacing: 2px;
}

.quizmas-voucher-copy {
    background: rgba(0, 255, 135, 0.2);
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #00ff87;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quizmas-voucher-copy:hover {
    background: rgba(0, 255, 135, 0.35);
    transform: scale(1.05);
}

.quizmas-voucher-copy.copied {
    background: #00ff87;
    color: #37003c;
}

.quizmas-btn-voucher {
    display: block;
    background: #00ff87 !important;
    color: #37003c !important;
    border: none !important;
    font-weight: 700;
    padding: 12px 28px;
    margin: 0 auto;
}

.quizmas-btn-voucher:hover {
    background: #00e67a !important;
    transform: translateY(-2px);
}

/* History */
#quizmas-history {
    margin-top: 40px;
    text-align: left;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

#quizmas-history h3 {
    color: #37003c;
    margin-bottom: 15px;
}

#quizmas-history-list {
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-item .history-score {
    font-weight: 700;
    color: #37003c;
}

.history-item .history-date {
    color: #888;
    font-size: 0.9em;
}

/* Start Buttons */
.quizmas-start-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#quizmas-settings-btn {
    padding: 8px 20px;
    font-size: 0.85em;
    background: transparent;
    border: 1px solid #999;
    color: #666;
}

#quizmas-settings-btn:hover {
    border-color: #37003c;
    color: #37003c;
}

.quizmas-settings-summary {
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
}

.quizmas-settings-summary:empty {
    display: none;
}

/* Start History */
#quizmas-start-history {
    margin-top: 30px;
    text-align: left;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

#quizmas-start-history h3 {
    color: #37003c;
    margin-bottom: 15px;
}

#quizmas-start-history-list {
}

#quizmas-start-history.empty {
    display: none;
}

/* Modal */
.quizmas-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.quizmas-modal.active {
    display: flex;
}

.quizmas-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.quizmas-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.quizmas-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.quizmas-modal-header h3 {
    margin: 0;
    color: #37003c;
    font-size: 1.3em;
}

.quizmas-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.quizmas-modal-close:hover {
    color: #37003c;
}

.quizmas-modal-body {
    padding: 20px;
}

.quizmas-modal-footer {
    padding: 15px 20px 20px;
    text-align: center;
}

.quizmas-reset-btn {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: underline;
}

.quizmas-reset-btn:hover {
    color: #37003c;
}

/* Error Modal */
.quizmas-error-modal .quizmas-modal-content {
    max-width: 400px;
}

.quizmas-error-modal .quizmas-modal-body {
    padding: 20px 25px 10px;
}

.quizmas-error-modal .quizmas-modal-body p {
    margin: 0;
    color: #333;
    font-size: 1em;
    line-height: 1.5;
}

.quizmas-error-modal .quizmas-modal-footer {
    padding: 10px 20px 20px;
}

.quizmas-error-modal .quizmas-modal-footer .quizmas-btn {
    min-width: 100px;
}

.quizmas-setting-group {
    margin-bottom: 25px;
}

.quizmas-setting-group > label,
.quizmas-setting-label-row > label {
    display: block;
    font-weight: 600;
    color: #37003c;
    margin-bottom: 12px;
    font-size: 1em;
}

.quizmas-setting-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quizmas-setting-label-row > label {
    margin-bottom: 0;
}

.quizmas-quick-select {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
}

.quizmas-quick-select button {
    background: none;
    border: none;
    color: #37003c;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

.quizmas-quick-select button:hover {
    color: #00a651;
}

.quizmas-quick-select span {
    color: #ccc;
}

.quizmas-setting-hint {
    font-size: 0.8em;
    color: #888;
    margin: 8px 0 0 0;
}

.quizmas-radio-group,
.quizmas-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quizmas-radio,
.quizmas-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.quizmas-radio input,
.quizmas-checkbox input {
    display: none;
}

.quizmas-radio span,
.quizmas-checkbox span {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
}

.quizmas-radio input:checked + span,
.quizmas-checkbox input:checked + span {
    background: linear-gradient(135deg, #00ff87, #00e67a);
    border-color: #00e67a;
    color: #37003c;
}

.quizmas-radio span:hover,
.quizmas-checkbox span:hover {
    border-color: #37003c;
}

/* Responsive */
@media (max-width: 480px) {
    #quizmas-app {
        padding: 15px;
    }

    .quizmas-answers {
        grid-template-columns: 1fr;
    }

    .quizmas-logo h1 {
        font-size: 2em;
    }

    #quizmas-player-name {
        font-size: 1.6em;
    }

    .quizmas-final-score {
        font-size: 3em;
    }

    .quizmas-question-content {
        padding: 20px;
    }

    #quizmas-emoji-grid {
        font-size: 1.5em;
        letter-spacing: 2px;
    }

    /* Share buttons responsive */
    .quizmas-share-buttons {
        flex-wrap: wrap;
    }

    .quizmas-share-buttons .quizmas-btn {
        flex: 1 1 45%;
        padding: 12px 10px;
        font-size: 0.9em;
    }

    /* Modal responsive */
    .quizmas-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .quizmas-modal-header {
        padding: 15px;
    }

    .quizmas-modal-header h3 {
        font-size: 1.1em;
    }

    .quizmas-modal-body {
        padding: 15px;
    }

    .quizmas-setting-group {
        margin-bottom: 18px;
    }

    .quizmas-setting-group > label {
        font-size: 0.9em;
        margin-bottom: 8px;
    }

    .quizmas-radio-group,
    .quizmas-checkbox-group {
        gap: 6px;
    }

    .quizmas-radio span,
    .quizmas-checkbox span {
        padding: 7px 12px;
        font-size: 0.8em;
        border-radius: 6px;
    }

    .quizmas-modal-footer {
        padding: 12px 15px 15px;
    }

    .quizmas-modal-footer .quizmas-btn {
        padding: 12px 24px;
        font-size: 0.95em;
    }

    /* Voucher responsive */
    .quizmas-voucher {
        padding: 20px 15px;
        margin: 25px 0;
    }

    .quizmas-voucher h3 {
        font-size: 1.2em;
    }

    .quizmas-voucher-code {
        padding: 10px 14px;
    }

    .quizmas-voucher-code span {
        font-size: 1.3em;
    }

    .quizmas-btn-voucher {
        padding: 10px 24px;
        font-size: 0.95em;
    }
}
