/* ============================================================
   Event Platform - Corporate Elegant Design
   ============================================================ */

:root {
    --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background: #f5f5f0;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Branded Theme (dynamic via inline CSS vars) ---- */
.themed { --event-primary: #1a6b4a; --event-secondary: #0f1f15; }

/* ---- Typography ---- */
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 500; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-family: var(--font-main); font-size: 0.9375rem; font-weight: 500;
    border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; gap: 8px;
}
.btn-primary {
    background: var(--event-primary, #1a6b4a); color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: #fff; color: #1a1a1a; border: 1px solid #e0e0db;
}
.btn-secondary:hover { background: #f5f5f0; }
.btn-success { background: #e8f5e9; color: #2e7d32; }
.btn-success:hover { background: #c8e6c9; }
.btn-danger { background: #fce4ec; color: #c62828; }
.btn-danger:hover { background: #f8bbd0; }
.btn-warning { background: #fff3e0; color: #e65100; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1.125rem; border-radius: var(--radius); }

/* ---- Cards ---- */
.card {
    background: #fff; border-radius: var(--radius);
    border: 1px solid #e8e8e3; padding: 20px;
}
.card-flat {
    background: #f5f5f0; border-radius: var(--radius-sm);
    padding: 12px 16px;
}

/* ---- Form elements ---- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 0.8125rem; font-weight: 500;
    color: #666; margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 12px 14px;
    font-family: var(--font-main); font-size: 0.9375rem;
    border: 1px solid #e0e0db; border-radius: var(--radius-sm);
    background: #fff; color: #1a1a1a;
    transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none; border-color: var(--event-primary, #1a6b4a);
    box-shadow: 0 0 0 3px rgba(26,107,74,0.1);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-hint { font-size: 0.75rem; color: #999; margin-top: 4px; }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500;
}
.badge-primary { background: var(--event-primary, #1a6b4a); color: #fff; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-danger { background: #fce4ec; color: #c62828; }
.badge-neutral { background: #f0f0eb; color: #666; }

/* ---- Stat counters ---- */
.stats-grid {
    display: grid; gap: 8px;
    grid-template-columns: repeat(4, 1fr);
}
.stat-card {
    text-align: center; padding: 14px 8px;
    border-radius: var(--radius-sm);
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 600; }
.stat-card .stat-label { font-size: 0.6875rem; margin-top: 2px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 6px; }
.tab {
    padding: 7px 16px; border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 500; cursor: pointer;
    transition: all var(--transition); border: 1px solid transparent;
}
.tab.active { background: var(--event-primary, #1a6b4a); color: #fff; }
.tab:not(.active) { background: #fff; color: #666; border-color: #e0e0db; }
.tab:not(.active):hover { background: #f5f5f0; }

/* ---- Connection indicator ---- */
.connection-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.connection-dot.online { background: #22c55e; }
.connection-dot.offline { background: #ef4444; }

/* ---- Question cards (validator) ---- */
.question-card {
    background: #fff; border-radius: var(--radius);
    border: 1px solid #e8e8e3; padding: 16px 18px;
    margin-bottom: 10px; border-left: 3px solid #e0e0db;
    transition: all var(--transition);
}
.question-card.pending { border-left-color: #f59e0b; }
.question-card.approved { border-left-color: #22c55e; }
.question-card.rejected { border-left-color: #ef4444; }
.question-card .q-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 8px;
}
.question-card .q-author { font-size: 0.8125rem; font-weight: 500; }
.question-card .q-time { font-size: 0.6875rem; color: #999; }
.question-card .q-text {
    font-size: 0.9375rem; line-height: 1.6;
    margin-bottom: 14px; color: #333;
}
.question-card .q-actions { display: flex; gap: 8px; }
.question-card .q-actions .btn { padding: 8px 16px; font-size: 0.8125rem; }

/* ---- Moderator view ---- */
.mod-question-display {
    padding: 40px 32px; text-align: left;
}
.mod-question-number {
    display: inline-flex; align-items: center;
    background: var(--event-primary, #1a6b4a); color: #fff;
    padding: 6px 18px; border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 500;
}
.mod-question-author {
    font-size: 0.875rem; color: #888; margin: 16px 0 8px;
}
.mod-question-text {
    font-size: 1.375rem; line-height: 1.6; color: #1a1a1a;
    font-weight: 400; margin-bottom: 40px;
}
.mod-waiting {
    text-align: center; padding: 60px 20px; color: #888;
}
.mod-waiting p { font-size: 1rem; margin-bottom: 8px; }
.mod-waiting small { font-size: 0.8125rem; color: #bbb; }

/* ---- Projection screen ---- */
.projection-screen {
    width: 100vw; height: 100vh;
    display: flex; flex-direction: column;
    overflow: hidden; position: relative;
}
.projection-screen .proj-hero {
    height: 25vh; background-size: cover;
    background-position: center; position: relative;
}
.projection-screen .proj-hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
}
.projection-screen .proj-hero-content {
    position: absolute; bottom: 20px; left: 40px; right: 40px;
    z-index: 1; display: flex; align-items: flex-end;
    justify-content: space-between;
}
.projection-screen .proj-event-name {
    color: #fff; font-size: 1.25rem; font-weight: 500;
}
.projection-screen .proj-badge {
    color: #fff; font-size: 0.875rem; padding: 6px 20px;
    border-radius: 24px; font-weight: 500;
}
.projection-screen .proj-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 80px; text-align: center;
}
.projection-screen .proj-q-number {
    font-size: 1.125rem; font-weight: 500;
    letter-spacing: 2px; margin-bottom: 24px;
}
.projection-screen .proj-q-text {
    font-size: 2.5rem; line-height: 1.45; font-weight: 400;
    max-width: 900px;
}
.projection-screen .proj-q-author {
    font-size: 1rem; margin-top: 24px; opacity: 0.5;
}
.projection-screen .proj-footer {
    padding: 16px 40px; display: flex;
    align-items: center; justify-content: space-between;
    font-size: 0.75rem; opacity: 0.4;
}

/* Dark projection theme */
.projection-dark {
    background: #0a0a0a; color: #ffffff;
}
.projection-dark .proj-body { background: #0a0a0a; }
.projection-dark .proj-q-number { color: rgba(255,255,255,0.5); }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-muted { color: #888; }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* ---- Mobile-first responsive ---- */
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mod-question-text { font-size: 1.125rem; }
    .projection-screen .proj-q-text { font-size: 1.5rem; padding: 20px; }
}

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.fade-in { animation: fadeIn 0.3s ease forwards; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ---- Powered by ---- */
.powered-by {
    text-align: center; font-size: 0.6875rem;
    color: #bbb; margin-top: 24px; padding: 12px;
}
.powered-by a { color: #999; text-decoration: none; }

/* ---- Edit modal overlay ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-content {
    background: #fff; border-radius: var(--radius);
    padding: 24px; width: 100%; max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-content h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
