/* Event Q&A Platform - Clean Professional Design */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Subtle, professional palette */
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;

    /* Refined accent - soft indigo */
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-light: #EEF2FF;

    /* Semantic - muted, professional */
    --success: #059669;
    --success-light: #ECFDF5;
    --error: #DC2626;
    --error-light: #FEF2F2;
    --warning: #D97706;
    --warning-light: #FFFBEB;
    --info: #0284C7;
    --info-light: #F0F9FF;

    /* Layout */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Typography */
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm { max-width: 540px; }
.container-md { max-width: 720px; }

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.header-logo img {
    height: 32px;
    width: auto;
}

.header-logo span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-nav a {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

.header-nav a:hover {
    color: var(--gray-900);
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Buttons - Clean, functional */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--gray-800);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-900);
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-error:hover {
    background: #B91C1C;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 1.875rem;
    height: 1.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font);
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 0.25rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.badge-pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-approved {
    background: var(--info-light);
    color: var(--info);
}

.badge-selected {
    background: var(--accent);
    color: white;
    animation: pulse 2s infinite;
}

.badge-answered {
    background: var(--success-light);
    color: var(--success);
}

.badge-rejected {
    background: var(--error-light);
    color: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}

.table tr:hover td {
    background: var(--gray-50);
}

/* Question Card */
.question-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.15s ease;
}

.question-card:hover {
    border-color: var(--gray-300);
}

.question-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.question-asker {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.question-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.question-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
}

/* Presenter View */
.presenter-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111111;
    color: #ffffff;
}

.presenter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.presenter-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.presenter-question {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    max-width: 85%;
    margin-bottom: 2rem;
    color: #ffffff;
}

.presenter-asker {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.presenter-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.4);
}

.presenter-waiting {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
}

.presenter-waiting i {
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Message Overlay */
.message-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.message-content {
    background: var(--warning);
    color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 600px;
}

.message-text {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.message-from {
    font-size: 1rem;
    opacity: 0.85;
}

/* Session List */
.session-list {
    display: grid;
    gap: 0.75rem;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.session-item:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.session-icon {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.session-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

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

.session-name {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.session-event {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.session-arrow {
    color: var(--gray-400);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--info); }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

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

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Page */
.page {
    padding: 2rem 0;
    min-height: calc(100vh - 65px);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .header-nav {
        gap: 1rem;
    }

    .presenter-question {
        font-size: clamp(1.5rem, 5vw, 3rem);
        max-width: 95%;
    }

    .presenter-footer {
        flex-direction: column;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .card {
        padding: 1.25rem;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab {
        white-space: nowrap;
    }
}

/* Dark mode for presenter */
.dark {
    --gray-50: #18181B;
    --gray-100: #27272A;
    --gray-200: #3F3F46;
    --gray-300: #52525B;
    --gray-400: #71717A;
    --gray-500: #A1A1AA;
    --gray-600: #D4D4D8;
    --gray-700: #E4E4E7;
    --gray-800: #F4F4F5;
    --gray-900: #FAFAFA;
}

/* Color picker */
.color-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 2px;
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 2rem;
}

.qr-code {
    max-width: 280px;
    margin: 0 auto 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.qr-code img {
    width: 100%;
    display: block;
}

.qr-url {
    font-size: 0.8125rem;
    color: var(--gray-500);
    word-break: break-all;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

/* Focus */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print */
@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
