/**
 * VOC Live - Application Stylesheet
 *
 * Single CSS file with body-class scoped sections:
 *   - Shared / Reset
 *   - body.admin (top nav, body content, print @media)
 *   - body.facilitator (large fonts, projection-ready)
 *   - body.display (full-screen, no controls)
 *   - body.participant (mobile-first)
 */

/* ============================================================
   SHARED / RESET
   ============================================================ */

:root {
    --voc-primary: #0d6efd;
    --voc-success: #198754;
    --voc-danger: #dc3545;
    --voc-warning: #ffc107;
    --voc-info: #0dcaf0;
    --voc-dark: #212529;
    --voc-light: #f8f9fa;
    --voc-muted: #6c757d;
}

* {
    box-sizing: border-box;
}

/* Utility class to hide elements when printing */
.no-print {
    /* Intentionally empty - used by print @media below */
}

/* Toast container for JS-triggered notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Confirmation modal styling */
.modal-confirm .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-confirm .modal-body {
    padding-top: 10px;
}

.modal-confirm .modal-footer {
    border-top: none;
}

/* ============================================================
   ADMIN (body.admin)
   ============================================================ */

body.admin {
    background-color: #f5f6fa;
    min-height: 100vh;
}

/* Login page specific */
body.admin.login-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Cards */
body.admin .card {
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

body.admin .card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}

body.admin .card-body {
    padding: 20px;
}

/* Tables */
body.admin .table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--voc-muted);
}

body.admin .table td {
    vertical-align: middle;
}

/* Status badges - consistent sizing */
body.admin .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Action buttons in tables */
body.admin .btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Page headers */
body.admin .page-header {
    margin-bottom: 1.5rem;
}

body.admin .page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Empty state */
body.admin .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--voc-muted);
}

body.admin .empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Form sections */
body.admin .form-section {
    margin-bottom: 30px;
}

body.admin .form-section h4 {
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* Test mode banner */
.test-mode-banner {
    background-color: var(--voc-warning);
    color: #000;
    text-align: center;
    padding: 8px;
    font-weight: 700;
    font-size: 1rem;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 1030;
}

/* Admin Print CSS - A4 portrait */
@media print {
    @page {
        size: A4 portrait;
        margin: 20mm;
    }

    body.admin {
        width: 100%;
        margin: 0;
        background: #fff;
    }

    body.admin .container {
        max-width: 670px;
        margin: 0 auto;
        padding: 0;
    }

    /* Hide non-printable elements */
    body.admin .navbar,
    body.admin .btn,
    body.admin .no-print,
    body.admin .pagination,
    body.admin .toast-container,
    body.admin .alert-dismissible .btn-close {
        display: none !important;
    }

    body.admin main {
        padding-top: 0 !important;
    }

    body.admin .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    /* Print-visible elements */
    .d-print-block { display: block !important; }

    /* Report-specific print styles */
    body.admin .table-danger-subtle { background-color: #fce4e4 !important; }

    body.admin .badge {
        border: 1px solid #999;
        padding: 2px 6px;
    }
    body.admin .badge.bg-success { background: #d1e7dd !important; color: #0f5132 !important; }
    body.admin .badge.bg-danger { background: #f8d7da !important; color: #842029 !important; }
    body.admin .badge.bg-warning { background: #fff3cd !important; color: #664d03 !important; }
    body.admin .badge.bg-primary { background: #cfe2ff !important; color: #084298 !important; }

    /* Progress bars in print */
    body.admin .progress { background: #eee !important; border: 1px solid #ddd; }
    body.admin .progress-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}


/* ============================================================
   FACILITATOR (body.facilitator)
   ============================================================ */

body.facilitator {
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

body.facilitator .facilitator-header {
    text-align: center;
    padding: 15px 20px;
    background-color: #16213e;
    border-bottom: 1px solid #333;
}

body.facilitator .facilitator-header h1 {
    font-size: 1.6rem;
    margin: 0;
    color: #fff;
}

body.facilitator .question-counter {
    font-size: 1.2rem;
    color: var(--voc-info);
    font-weight: 600;
}

body.facilitator .answer-counter {
    font-size: 1.1rem;
    color: var(--voc-success);
}

body.facilitator .progress {
    height: 8px;
    border-radius: 4px;
}

body.facilitator .control-panel {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

body.facilitator .phase-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    font-weight: 600;
}

body.facilitator .participant-list {
    max-height: 300px;
    overflow-y: auto;
}


/* ============================================================
   DISPLAY (body.display)
   ============================================================ */

body.display {
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    overflow: hidden;
    min-height: 100vh;
}

body.display .display-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

body.display .question-text {
    font-size: 2.5rem;
    text-align: center;
    max-width: 90%;
    line-height: 1.4;
}

body.display .option-list {
    font-size: 1.8rem;
    list-style: none;
    padding: 0;
    margin-top: 40px;
    width: 80%;
}

body.display .option-item {
    padding: 15px 25px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 2px solid transparent;
}

body.display .option-item.correct {
    border-color: var(--voc-success);
    background: rgba(25, 135, 84, 0.2);
}


/* ============================================================
   PARTICIPANT (body.participant)
   ============================================================ */

body.participant {
    background-color: #f8f9fa;
    min-height: 100vh;
}

body.participant .participant-header {
    background-color: var(--voc-primary);
    color: #fff;
    padding: 15px 20px;
    text-align: center;
}

body.participant .participant-header h1 {
    font-size: 1.2rem;
    margin: 0;
}

body.participant .participant-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

body.participant .question-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

body.participant .option-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 8px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

body.participant .option-btn:hover {
    border-color: var(--voc-primary);
    background: rgba(13, 110, 253, 0.05);
}

body.participant .option-btn.selected {
    border-color: var(--voc-primary);
    background: rgba(13, 110, 253, 0.1);
    font-weight: 600;
}

body.participant .option-btn.correct {
    border-color: var(--voc-success);
    background: rgba(25, 135, 84, 0.1);
}

body.participant .option-btn.incorrect {
    border-color: var(--voc-danger);
    background: rgba(220, 53, 69, 0.1);
}

body.participant .timer-bar {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    overflow: hidden;
    margin-bottom: 20px;
}

body.participant .timer-bar .timer-fill {
    height: 100%;
    background: var(--voc-primary);
    transition: width 1s linear;
}

body.participant .timer-bar .timer-fill.warning {
    background: var(--voc-warning);
}

body.participant .timer-bar .timer-fill.danger {
    background: var(--voc-danger);
}

body.participant .catchup-banner {
    background: var(--voc-warning);
    color: #000;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
}

body.participant .waiting-screen {
    text-align: center;
    padding: 40px 20px;
}

body.participant .waiting-screen .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 20px;
}

/* Thank you screen */
body.participant .thankyou-screen {
    text-align: center;
    padding: 60px 20px;
}

body.participant .thankyou-screen .check-icon {
    font-size: 4rem;
    color: var(--voc-success);
    margin-bottom: 20px;
}

/* Offline indicator */
body.participant .offline-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--voc-danger);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    z-index: 9999;
    display: none;
}

body.participant .offline-indicator.show {
    display: block;
}
