/* ===================================================
   COGNITIA – Clean Minimal Light Theme
   =================================================== */

:root {
    --primary: #111111;
    --primary-hover: #333333;
    --accent: #22c55e;
    --accent-light: #dcfce7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #22c55e;

    --bg: #f0f0f0;
    --surface: #ffffff;
    --surface-2: #f9f9f9;

    --sidebar-bg: #1a1a1a;
    --sidebar-width: 220px;

    --text-primary: #111111;
    --text-secondary: #6b7280;
    --text-muted: #adb5bd;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 999px;

    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    font-size: 14px;
}

input,
textarea,
select,
.form-control {
    color: #000000 !important;
}

::placeholder {
    color: #999999 !important;
    opacity: 1;
}

/* ===================================================
   AUTH PAGE
   =================================================== */
.auth-body {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-body::before,
.auth-body::after {
    display: none;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 17px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

/* Auth form fields */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-input {
    width: 100%;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    padding: 0 14px;
    outline: none;
    transition: var(--transition);
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

/* Fix browser autofill */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 5000s ease-in-out 0s;
}

.btn-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    z-index: 10;
    transition: var(--transition);
}

.btn-toggle-pass:hover {
    color: var(--text-primary);
}

.auth-card .form-check-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-card .form-check-input {
    border-color: var(--border);
}

.auth-card .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-auth {
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    background: var(--primary);
    border: none;
    color: white;
    transition: var(--transition);
}

.btn-auth:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-demo-hint {
    margin-top: 20px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.auth-demo-hint strong {
    color: var(--text-primary);
}

/* ===================================================
   SIDEBAR LAYOUT
   =================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-logo {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo .logo-icon {
    background: white;
    color: var(--primary);
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 8px 10px 4px;
    margin-top: 6px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* ===================================================
   MAIN CONTENT
   =================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-area {
    padding: 24px;
    flex: 1;
}

/* ===================================================
   PAGE HEADER
   =================================================== */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===================================================
   CARDS
   =================================================== */
.card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* ===================================================
   CREATE EVENT CARD
   =================================================== */
.create-event-card {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 480px;
    margin: 48px auto;
}

.create-event-card:hover {
    border-color: var(--primary);
    background: var(--surface-2);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.create-event-card .create-icon {
    width: 72px;
    height: 72px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    transition: var(--transition);
}

.create-event-card:hover .create-icon {
    transform: scale(1.08) rotate(4deg);
}

.create-event-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.create-event-card p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 280px;
}

/* ===================================================
   EVENT LIST
   =================================================== */
.events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.events-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.event-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.event-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.event-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Status badges */
.badge-status {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-draft {
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-active {
    background: var(--accent-light);
    color: #15803d;
}

.badge-ended {
    background: var(--danger-light);
    color: #b91c1c;
}

/* ===================================================
   TABLES & LISTS
   =================================================== */
.table {
    --bs-table-hover-bg: rgba(0, 0, 0, 0.02);
    margin-bottom: 0;
}

.table thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.interaction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.interaction-type-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.interaction-type-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #d1d5db;
}

/* Color variants */
.card-qa {
    --card-color: #6c47ff;
    --card-bg: #ede9ff;
}

.card-mc {
    --card-color: #3b82f6;
    --card-bg: #dbeafe;
}

.card-wc {
    --card-color: #22c55e;
    --card-bg: #dcfce7;
}

.card-ot {
    --card-color: #f59e0b;
    --card-bg: #fef3c7;
}

.card-rk {
    --card-color: #ef4444;
    --card-bg: #fee2e2;
}

.card-rt {
    --card-color: #ec4899;
    --card-bg: #fce7f3;
}

.card-qz {
    --card-color: #8b5cf6;
    --card-bg: #ede9fe;
}

.card-sv {
    --card-color: #06b6d4;
    --card-bg: #cffafe;
}

.interaction-type-card:hover {
    border-color: var(--card-color);
}

.type-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-color);
    margin: 0 auto 12px;
    transition: var(--transition);
}

.interaction-type-card:hover .type-icon {
    background: var(--card-color);
    color: white;
    transform: scale(1.08);
}

.type-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.type-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===================================================
   WORD CLOUD ENHANCEMENTS
   =================================================== */
.word-cloud-wrapper {
    transition: all 0.5s ease;
}

.word-cloud-wrapper canvas {
    transition: opacity 0.8s ease-in-out;
}

.word-cloud-wrapper:hover {
    transform: scale(1.01);
}

.interaction-builder {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.builder-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
}

.builder-body {
    padding: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: var(--transition);
}

.option-item:hover {
    border-color: #d1d5db;
}

.option-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}

/* ===================================================
   ANALYTICS ENHANCEMENTS
   =================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom coloring for cards */
.stat-card:nth-child(2) .stat-value {
    color: var(--info);
}

.stat-card:nth-child(2)::before {
    background: var(--info);
}

.stat-card:nth-child(3) .stat-value {
    color: var(--accent);
}

.stat-card:nth-child(3)::before {
    background: var(--accent);
}

.stat-card:nth-child(4) .stat-value {
    color: var(--warning);
}

.stat-card:nth-child(4)::before {
    background: var(--warning);
}

/* ===================================================
   AUDIENCE PAGE
   =================================================== */
.audience-body {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.audience-header {
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.audience-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: calc(100vh - 57px);
    overflow-y: auto;
}

.join-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.join-card h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.join-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.join-input {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
    padding: 14px;
    width: 100%;
    text-transform: uppercase;
    transition: var(--transition);
    outline: none;
}

.join-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.join-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 4px;
    font-size: 18px;
}

/* Question Card for Audience */
.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
}

.question-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 14px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.question-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
    text-align: left;
}

.option-btn:hover {
    background: var(--surface-2);
    border-color: #9ca3af;
    transform: translateX(3px);
}

.option-btn.selected {
    background: #f0fdf4;
    border-color: var(--accent);
    color: var(--text-primary);
}

.option-btn.selected::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    margin-left: auto;
    color: var(--accent);
}

.option-letter {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--text-secondary);
}

/* Results Bar */
.result-bar-wrap {
    margin-bottom: 12px;
}

.result-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-primary);
}

.result-bar-track {
    height: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Word Cloud */
.word-cloud-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px;
    min-height: 120px;
}

.word-tag {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: default;
    transition: var(--transition);
    animation: wordPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wordPop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Rating Stars */
.star-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 14px 0;
}

.star-btn {
    font-size: 34px;
    color: var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    padding: 4px;
}

.star-btn:hover,
.star-btn.active {
    color: #f59e0b;
    transform: scale(1.15);
}

/* ===================================================
   PRESENTER VIEW (Live Display)
   =================================================== */
.presenter-view {
    background: var(--bg);
    min-height: 100vh;
    color: var(--text-primary);
}

.presenter-topbar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: #f87171;
    letter-spacing: 0.8px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* ===================================================
   MODALS
   =================================================== */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
}

.modal-title {
    font-weight: 700;
    font-size: 16px;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 22px;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    color: white;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.btn-outline-primary {
    border-color: var(--border);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    background: var(--surface);
}

.btn-outline-primary:hover {
    background: var(--surface-2);
    border-color: #9ca3af;
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
}

.btn-icon:hover {
    border-color: #9ca3af;
    color: var(--text-primary);
    background: var(--surface-2);
}

/* ===================================================
   FORMS
   =================================================== */
.form-control,
.form-select {
    border-radius: var(--radius);
    border-color: var(--border);
    font-size: 13px;
    transition: var(--transition);
    color: var(--text-primary);
    background-color: var(--surface);
}

.form-control:focus,
.form-select:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

/* ===================================================
   UTILITIES
   =================================================== */
.text-primary {
    color: var(--text-primary) !important;
}

.bg-primary-light {
    background: var(--surface-2);
}

.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 44px;
    color: var(--border);
    margin-bottom: 14px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.pulse-ring {
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.15);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(17, 17, 17, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(17, 17, 17, 0);
    }
}

/* ===================================================
   INTERACTION LIST (Presenter Live)
   =================================================== */
.interaction-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.interaction-list-item:hover {
    border-color: #9ca3af;
    box-shadow: var(--shadow-sm);
}

.interaction-list-item.active-interaction {
    border-color: var(--primary);
    background: var(--surface-2);
}

.interaction-list-item .item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ===================================================
   TEAM
   =================================================== */
.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.team-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.team-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin: 0 auto 10px;
}

/* ===================================================
   SIDEBAR OVERLAY (mobile)
   =================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ===================================================
   QR / TOAST / QUIZ
   =================================================== */
.qr-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.toast-container {
    z-index: 9999;
}

.custom-toast {
    background: var(--primary);
    border: none;
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* Quiz Buttons in Audience View */
.quiz-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    margin-bottom: 8px;
}

.quiz-option-btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: #9ca3af;
    transform: translateX(2px);
}

.quiz-option-btn.selected {
    background: #f0fdf4;
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--accent);
}

.quiz-option-btn.selected .option-letter {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.quiz-question-container {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.quiz-question-container:last-child {
    border-bottom: none;
}

.waiting-screen {
    text-align: center;
    padding: 36px 20px;
}

/* Presenter Timer Styles */
.presenter-timer-box {
    background: #fff;
    border: 3px solid #f3f4f6;
    padding: 12px 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.presenter-timer-box.timer-warning {
    color: #ef4444;
    border-color: #fee2e2;
    animation: pulse-timer 1s infinite;
}

.presenter-timer-box.timer-finished {
    opacity: 0.5;
    background: #f9fafb;
}

@keyframes pulse-timer {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Audience Timer Styles */
.audience-timer-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.timer-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(59, 130, 246, 0.1);
    transition: width 1s linear;
}

.audience-timer-card.timer-warning {
    background: #fef2f2;
    border-color: #fee2e2;
    animation: timer-shake 0.5s infinite;
}

.audience-timer-card.timer-warning .timer-progress-bar {
    background: rgba(239, 68, 68, 0.1);
}

.audience-timer-card.timer-warning #audienceTimerDisplay {
    color: #ef4444;
}

@keyframes timer-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(1px);
    }

    50% {
        transform: translateX(0);
    }

    75% {
        transform: translateX(-1px);
    }

    100% {
        transform: translateX(0);
    }
}

.waiting-animation {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 18px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===================================================
   ANIMATIONS
   =================================================== */
.fade-in {
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================================
   RESPONSIVE – MOBILE FIRST
   =================================================== */

/* ---- Tablet & below (≤992px) ---- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    #sidebarToggle {
        display: inline-flex !important;
    }
}

/* ---- Mobile (≤768px) ---- */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 16px;
        max-width: 100%;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .auth-header h1 {
        font-size: 20px;
    }

    .logo-text {
        font-size: 18px;
    }

    .content-area {
        padding: 14px;
    }

    .topbar {
        padding: 0 14px;
        height: 52px;
    }

    .topbar-title {
        font-size: 15px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .page-header p {
        font-size: 12px;
    }

    .event-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px;
    }

    .event-info {
        width: calc(100% - 56px);
    }

    .event-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border-light);
        flex-wrap: wrap;
        gap: 6px;
    }

    .event-meta {
        gap: 6px;
        font-size: 11px;
    }

    .event-name {
        font-size: 14px;
    }

    .create-event-card {
        padding: 40px 20px;
        margin: 20px auto;
    }

    .create-event-card h3 {
        font-size: 17px;
    }

    .interaction-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .interaction-type-card {
        padding: 18px 10px;
    }

    .type-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .type-name {
        font-size: 12px;
    }

    .type-desc {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-value {
        font-size: 24px;
    }

    .join-card {
        padding: 26px 18px;
        border-radius: var(--radius-lg);
    }

    .join-card h2 {
        font-size: 20px;
    }

    .join-input {
        font-size: 20px;
        letter-spacing: 6px;
        padding: 12px;
    }

    .question-card {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }

    .question-title {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .option-btn {
        padding: 12px 12px;
        font-size: 13px;
    }

    .star-btn {
        font-size: 28px;
    }

    .audience-content {
        padding: 14px;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .audience-header {
        padding: 10px 14px;
    }

    .modal-dialog {
        margin: 8px;
    }

    .modal-content {
        border-radius: var(--radius-lg);
    }

    .btn-icon {
        width: 38px;
        height: 38px;
    }

    .btn-auth {
        height: 44px;
    }

    .presenter-topbar {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .team-card {
        padding: 16px;
    }

    .team-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .interaction-list-item {
        padding: 10px 12px;
        gap: 8px;
    }
}

/* ---- Small mobile (≤576px) ---- */
@media (max-width: 576px) {
    .auth-card {
        padding: 22px 16px;
    }

    .topbar-title {
        font-size: 14px;
    }

    .event-card {
        padding: 12px;
    }

    .event-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
        border-radius: 8px;
    }

    .event-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

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

    .join-input {
        font-size: 18px;
        letter-spacing: 4px;
    }

    .question-card {
        padding: 18px 14px;
    }

    .question-title {
        font-size: 15px;
    }

    .option-btn {
        padding: 13px 10px;
        min-height: 50px;
    }

    .option-letter {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .star-btn {
        font-size: 32px;
        padding: 5px;
    }

    .audience-content {
        padding: 10px;
        padding-top: 14px;
    }

    .page-header {
        margin-bottom: 14px;
    }

    .page-header h2 {
        font-size: 16px;
    }

    .content-area {
        padding: 10px;
    }

    .modal-dialog {
        margin: 4px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-header,
    .modal-footer {
        padding: 12px 14px;
    }

    .empty-state {
        padding: 36px 14px;
    }

    .create-event-card {
        padding: 32px 14px;
        margin: 12px auto;
    }

    .create-event-card .create-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .live-badge span:not(.live-dot) {
        display: none;
    }
}

/* ---- Extra small (≤400px) ---- */
@media (max-width: 400px) {
    .interaction-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .interaction-type-card {
        padding: 14px 8px;
    }

    .type-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
        border-radius: 10px;
    }

    .type-name {
        font-size: 11px;
    }

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

    .join-input {
        font-size: 16px;
        letter-spacing: 3px;
    }

    .auth-card {
        padding: 18px 12px;
    }

    .logo-text {
        font-size: 16px;
    }
}

/* ---- Landscape phone ---- */
@media (max-width: 768px) and (orientation: landscape) {
    .audience-content {
        justify-content: flex-start;
        padding-top: 10px;
    }

    .join-card {
        padding: 18px;
    }

    .auth-card {
        padding: 18px;
    }

    .auth-body {
        align-items: flex-start;
        padding-top: 14px;
    }

    .auth-wrapper {
        padding: 6px 14px;
    }
}