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

/* Common Quiz Styles */
.quiz-page, .quiz-admin {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
}

/* Remove theme container constraints */
.quiz-page .entry-content,
.quiz-admin .entry-content,
.quiz-page > .container,
.quiz-admin > .container,
.quiz-page .ct-container,
.quiz-admin .ct-container {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide default page titles */
.quiz-page .entry-header,
.quiz-admin .entry-header {
    display: none !important;
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 10px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.quiz-title, .admin-title {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
 .admin-title {
    font-size: 2.5rem;
 }

/* Registration Screen */
.quiz-screen {
    animation: quizFadeIn 0.3s ease;
}

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

.registration-box, .waiting-box, .final-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.registration-box h2, .waiting-box h2, .final-box h2 {
    color: #333;
    margin-bottom: 20px;
}

.registration-box input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.registration-box input:focus {
    outline: none;
    border-color: #667eea;
}

.quiz-page .btn-primary,
.quiz-admin .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-page .btn-primary:hover,
.quiz-admin .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.waiting-animation {
    font-size: 4rem;
    animation: quizPulse 1.5s infinite;
}

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

.hint {
    color: #888;
    font-size: 0.9rem;
    margin-top: 10px;
}

.rename-link {
    margin: -10px 0 10px 0;
}

.rename-link a {
    color: #667eea;
    font-size: 0.85rem;
    text-decoration: underline;
}

/* Rename Modal */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 320px;
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn-secondary {
    background: #e9ecef;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.modal-buttons .btn-primary {
    padding: 10px 20px;
}

/* Question Screen */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
    gap: 12px;
}

.question-number {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.question-type {
    background: rgba(255,255,255,0.25);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.question-type.two_truths {
    background: rgba(255, 193, 7, 0.4);
}

.question-box {
    background: white;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.question-box h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.3rem;
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
}

.option-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 1rem;
}

.option-btn.selected .option-letter {
    background: white;
    color: #667eea;
}

.option-text {
    flex: 1;
    line-height: 1.4;
    padding-top: 3px;
}

.submitted-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
}

/* Reveal Screen */
.reveal-mode {
    border: 3px solid #ffc107;
}

.option-display {
    display: flex;
    align-items: flex-start;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.option-display:last-child {
    margin-bottom: 0;
}

.option-display .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.option-display .option-text {
    flex: 1;
    padding-top: 3px;
}

.option-display.correct {
    background: #d4edda;
    border-color: #28a745;
    border-width: 3px;
}

.option-display.correct .option-letter {
    background: #28a745;
}

.option-display.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    border-width: 3px;
}

.option-display.wrong .option-letter {
    background: #dc3545;
}

.your-answer {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 10px;
    font-weight: 600;
}

.your-answer.correct {
    background: #d4edda;
    color: #155724;
}

.your-answer.wrong {
    background: #f8d7da;
    color: #721c24;
}

.your-answer.pending {
    background: #fff3cd;
    color: #856404;
}

.your-answer.missed {
    background: #e9ecef;
    color: #6c757d;
}

/* Final Screen */
.final-score {
    font-size: 1.5rem;
    margin-top: 20px;
}

.final-score span {
    font-weight: bold;
    color: #667eea;
    font-size: 2rem;
}

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

.admin-container {
    max-width: 1200px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.status-bar {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.status-item {
    color: white;
}

.status-label {
    opacity: 0.8;
    margin-right: 5px;
}

.status-value {
    font-weight: bold;
    color: white;
}

.control-panel {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 15px;
    margin-top: 15px;
    box-shadow: none;
}

.control-panel h2 {
    display: none;
}

.current-question-panel, .leaderboard-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.current-question-panel h2, .leaderboard-panel h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-admin {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

.btn-admin:hover {
    opacity: 1;
}

.btn-admin.btn-primary {
    background: rgba(255,255,255,0.2);
    color: white;
}

.btn-admin.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
}

.btn-admin.btn-success {
    background: rgba(40, 167, 69, 0.3);
    color: white;
}

.btn-admin.btn-danger {
    background: rgba(220, 53, 69, 0.3);
    color: white;
}

/* Admin Question Display */
.admin-question {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.q-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.q-num {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.q-type {
    background: #e9ecef;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.q-type.two_truths {
    background: #fff3cd;
}

.revealed-badge {
    background: #d4edda;
    color: #155724;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.q-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

.q-options {
    margin-bottom: 15px;
}

.admin-option {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.admin-option:last-child {
    margin-bottom: 0;
}

.admin-option.correct {
    background: #d4edda;
    border-color: #28a745;
}

.opt-key {
    font-weight: bold;
    color: #667eea;
    min-width: 25px;
}

.correct-answer {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 0;
}

.no-question, .no-participants {
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

/* Leaderboard */
.leaderboard-panel {
    position: sticky;
    top: 20px;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 30px 1fr 40px 40px;
    gap: 6px;
    padding: 8px 10px;
    background: #667eea;
    color: white;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    font-size: 0.7rem;
}

.leaderboard-body {
    max-height: 500px;
    overflow-y: auto;
}

.lb-row {
    display: grid;
    grid-template-columns: 30px 1fr 40px 40px;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
    font-size: 0.75rem;
}

.lb-row.rank-1 {
    background: linear-gradient(90deg, #fff9e6 0%, white 100%);
}

.lb-row.rank-1 .lb-rank::after {
    content: ' 🥇';
}

.lb-row.rank-2 .lb-rank::after {
    content: ' 🥈';
}

.lb-row.rank-3 .lb-rank::after {
    content: ' 🥉';
}

.lb-rank {
    font-weight: bold;
    color: #667eea;
}

.lb-name {
    font-weight: 500;
    word-break: break-word;
    line-height: 1.2;
}

.lb-status {
    text-align: center;
    font-size: 0.8rem;
}

.lb-score {
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: #333;
}

/* Tiebreaker Styles */
.tiebreaker-box {
    background: white;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.tiebreaker-box h2 {
    color: #333;
    margin-bottom: 8px;
}

.tiebreaker-box p {
    color: #666;
    margin-bottom: 15px;
}

.tiebreaker-input {
    width: 180px;
    padding: 12px 15px;
    font-size: 1.3rem;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 10px;
    margin-bottom: 15px;
}

.tiebreaker-input:focus {
    outline: none;
    border-color: #764ba2;
}

.tiebreaker-submitted {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1rem;
}

.tiebreaker-guesses {
    margin: 20px 0;
}

.tiebreaker-guess-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.tiebreaker-guess-row.winner {
    background: #d4edda;
    border: 2px solid #28a745;
}

.tiebreaker-guess-row .name {
    font-weight: 600;
}

.tiebreaker-guess-row .guess {
    color: #667eea;
    font-weight: bold;
}

.tiebreaker-guess-row .years {
    color: #888;
    font-size: 0.9rem;
}

.tiebreaker-answer {
    background: #667eea;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.2rem;
}

.tiebreaker-winner {
    background: #28a745;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.3rem;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .quiz-container {
        padding: 10px;
    }
    
    .quiz-title, .admin-title {
        font-size: 1.3rem;
    }
    
    .question-box {
        padding: 25px 20px;
    }
    
    .question-box h2 {
        font-size: 1.2rem;
    }
    
    .option-btn,
    .option-display {
        padding: 14px 16px;
    }
    
    .option-letter {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.9rem;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    .question-header {
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
    }
}
