/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --brand-blue: rgb(0, 25, 101);
    --brand-blue-dark: rgb(0, 18, 75);
    --brand-blue-light: rgba(0, 25, 101, 0.1);
    --brand-black: #212121;
    --brand-white: #FFFFFF;

    /* Functional Colors */
    --primary: rgb(0, 25, 101);
    --primary-dark: rgb(0, 18, 75);
    --primary-light: rgba(0, 25, 101, 0.1);
    --secondary: rgba(0, 25, 101, 0.1);
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #d1fae5;
    --danger: rgb(0, 25, 101);
    --danger-dark: rgb(0, 18, 75);
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    /* Borders */
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background:
        linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-blend-mode: overlay;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* ===== LAYOUT ===== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: visible;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.app-header {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    color: white;
    padding: 24px 32px;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}


.logo-icon {
    width: 48px;
    height: 48px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 4px 0 0 0;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.status-indicator.test-mode {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.connected {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.disconnected {
    background: var(--danger);
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 32px;
    padding-bottom: 32px;
    background: var(--bg-secondary);
    overflow-y: auto;
    position: relative;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
}

.stat-icon.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.rejected {
    background: rgba(0, 25, 101, 0.1);
    color: var(--brand-blue);
}

.stat-icon.total {
    background: rgba(251, 207, 200, 0.2);
    color: var(--brand-blue);
}

.stat-icon.participants {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== QUESTIONS CONTAINER ===== */
.questions-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.questions-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.questions-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tab:hover {
    background: rgba(0, 25, 101, 0.1);
    color: var(--brand-blue);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.filter-tab.active .filter-badge {
    background: rgba(255, 255, 255, 0.25);
}

.filter-tab:hover:not(.active) .filter-badge {
    background: rgba(0, 25, 101, 0.15);
}

/* ===== QUESTIONS LIST ===== */
.questions-list {
    max-height: 600px;
    overflow-y: auto;
}

.empty-state {
    padding: 80px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    grid-column: 1 / -1;
}

.empty-state svg {
    margin: 0 auto 24px;
    display: block;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Question Card */
.question-card {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.question-card:hover {
    background: var(--bg-secondary);
}

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

.question-card.status-approved {
    border-left: 4px solid var(--success);
}

.question-card.status-rejected {
    border-left: 4px solid var(--danger);
    opacity: 0.6;
}

.question-card.status-pending {
    border-left: 4px solid var(--warning);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.question-time {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.question-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.question-status.pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
}

.question-status.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.question-status.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.question-status svg {
    width: 14px;
    height: 14px;
}

.question-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.question-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

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

.btn-primary {
    background: white;
    color: var(--primary);
    border: 2px solid white;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
    box-shadow: var(--shadow-md);
}

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

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== FORMS ===== */
.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-label:hover {
    background: var(--bg-tertiary);
}

.toggle-label-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label-text small {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.toggle-switch {
    position: relative;
    width: 120px;
    height: 36px;
    background: var(--gray-300);
    border-radius: 20px;
    transition: var(--transition);
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 54px;
    height: 30px;
    background: white;
    border-radius: 18px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked ~ .toggle-slider {
    left: 63px;
    background: white;
}

.toggle-switch input:checked {
    background: var(--success);
}

.toggle-label-left,
.toggle-label-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.toggle-label-left {
    left: 12px;
    color: white;
}

.toggle-label-right {
    right: 12px;
    color: var(--text-secondary);
}

.toggle-switch input:checked ~ .toggle-label-left {
    color: var(--text-secondary);
}

.toggle-switch input:checked ~ .toggle-label-right {
    color: white;
}

.toggle-switch input:checked + .toggle-slider {
    background: white;
}

.toggle-switch input:not(:checked) + .toggle-slider {
    background: white;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== QUESTION DETAIL ===== */
.question-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    align-items: center;
}

.toast {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .app-container {
        border-radius: 0;
        min-height: 100vh;
    }

    .app-header {
        padding: 20px;
    }

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

    .subtitle {
        font-size: 13px;
    }

    .main-content {
        padding: 20px;
    }

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

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

    .questions-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .modal-content {
        margin: 20px;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 120px;
    }

    .toast-container {
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 40px);
    }
}

/* ===== SCROLLBAR STYLING ===== */
.questions-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.questions-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.questions-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.questions-list::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== EVENTS STYLES ===== */
.events-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.events-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.event-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.event-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 25, 101, 0.1);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.event-card-title h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.event-code {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.event-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-link-inline:hover {
    background: var(--primary-light);
}

.btn-link-danger {
    color: var(--danger);
}

.btn-link-danger:hover {
    background: #fee2e2;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.event-card-body {
    margin-bottom: 16px;
}

.event-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.event-date {
    font-size: 13px;
    color: var(--text-tertiary);
}

.event-visitors {
    color: #6366f1;
    font-weight: 500;
}

.event-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.event-card-actions .actions-left {
    display: flex;
    gap: 8px;
}

.event-card-actions .actions-right {
    display: flex;
    gap: 8px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-priority {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.btn-warning {
    background: #fbbf24;
    color: #78350f;
    border: 1px solid #f59e0b;
}

.btn-warning:hover {
    background: #f59e0b;
    color: white;
}

/* ===== PARTICIPANT FORM STYLES ===== */
.participant-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.participant-form {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.participant-form h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.participant-form .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.success-message {
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: none;
}

.success-message.show {
    display: block;
}

.success-message h3 {
    color: var(--success-dark);
    font-size: 16px;
    margin-bottom: 4px;
}

.success-message p {
    color: var(--success-dark);
    font-size: 14px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: none;
}

.error-message.show {
    display: block;
}

.error-message h3 {
    color: var(--danger);
    font-size: 16px;
    margin-bottom: 4px;
}

.error-message p {
    color: var(--danger-dark);
    font-size: 14px;
}

/* ===== SPEAKER DASHBOARD STYLES ===== */
.answer-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.answer-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.answer-text {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.answer-form {
    margin-top: 12px;
}

.answer-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ===== CONTACTO LOGO ===== */
.contacto-logo {
    text-align: center;
    padding: 24px 0;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    background: var(--bg-primary);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.contacto-logo:hover {
    opacity: 1;
}

.contacto-logo img {
    height: 32px;
    width: auto;
    display: inline-block;
}

/* ===== IMAGE UPLOAD STYLES ===== */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload-placeholder {
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.image-upload-placeholder p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.image-upload-placeholder small {
    font-size: 12px;
    color: var(--text-tertiary);
}

.image-preview {
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.btn-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-image:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* ===== EVENT HEADER BANNER ===== */
.event-header-banner {
    width: 100%;
    overflow: hidden;
}

.event-header-banner img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.participant-banner {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    margin-bottom: -12px;
}

.participant-banner img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .event-header-banner img {
        max-height: 150px;
    }

    .participant-banner img {
        max-height: 140px;
    }

    .image-preview img {
        height: 150px;
    }
}

/* ===== WAITING MESSAGE (Partecipante) ===== */
.waiting-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.waiting-icon {
    color: #f59e0b;
    margin-bottom: 16px;
}

.waiting-message h3 {
    font-size: 20px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.waiting-message p {
    font-size: 14px;
    color: #a16207;
    margin-bottom: 24px;
}

.waiting-dots {
    display: flex;
    gap: 8px;
}

.waiting-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f59e0b;
    animation: waitingBounce 1.4s infinite ease-in-out both;
}

.waiting-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.waiting-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.waiting-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes waitingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== BADGE WARNING (In Attesa) ===== */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ===== EVENT STATUS INDICATOR (Moderatore/Relatore header) ===== */
.event-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(10px);
}

.event-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-400);
    transition: background 0.3s ease;
}

.event-status-dot.status-active {
    background: #10b981;
    animation: pulse 2s ease-in-out infinite;
}

.event-status-dot.status-waiting {
    background: #f59e0b;
    animation: pulse 2s ease-in-out infinite;
}

.event-status-dot.status-inactive {
    background: #ef4444;
}

.event-status-label {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

/* ===== EVENT CARD ACTION BUTTONS (Admin cards) ===== */
/* Base stile unificato: outline con accento colore */
.btn-toggle-active,
.btn-toggle-inactive,
.btn-open-questions,
.btn-close-questions,
.event-card-actions .btn-outline,
.event-card-actions .btn-danger {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
    cursor: pointer;
}

/* Attiva - verde */
.btn-toggle-active {
    color: #059669;
    border-color: #86efac;
}
.btn-toggle-active:hover {
    background: #ecfdf5;
    border-color: #10b981;
}

/* Disattiva - rosso tenue */
.btn-toggle-inactive {
    color: #dc2626;
    border-color: #fca5a5;
}
.btn-toggle-inactive:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Apri Domande - blu */
.btn-open-questions {
    color: #2563eb;
    border-color: #93c5fd;
}
.btn-open-questions:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

/* Chiudi Domande - ambra */
.btn-close-questions {
    color: #d97706;
    border-color: #fcd34d;
}
.btn-close-questions:hover {
    background: #fffbeb;
    border-color: #f59e0b;
}

/* Modifica - grigio neutro (già outline) */
.event-card-actions .btn-outline {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.event-card-actions .btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--gray-400);
    color: var(--text-primary);
}

/* Elimina - rosso, stesso stile outline */
.event-card-actions .btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
    background: transparent;
}
.event-card-actions .btn-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Badge domande */
.badge-questions-open {
    background: #d1fae5;
    color: #065f46;
}

.badge-questions-closed {
    background: #fef3c7;
    color: #92400e;
}

.event-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.event-badges-row {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* ===== QUESTION CARD INNER LAYOUT (drag handle + order number) ===== */
.question-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.question-card-content {
    flex: 1;
    min-width: 0;
}

.drag-handle {
    cursor: grab;
    font-size: 20px;
    color: var(--text-tertiary);
    padding: 4px 2px;
    user-select: none;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.drag-handle:hover {
    color: var(--text-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

.order-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== QUESTION FOOTER & INLINE ACTIONS ===== */
.question-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ===== SORTABLE.JS DRAG FEEDBACK ===== */
.sortable-ghost {
    opacity: 0.3;
}

.sortable-drag {
    box-shadow: 0 8px 24px rgba(0, 25, 101, 0.15);
    border-radius: 8px;
}

/* ===== RELATORE PAGE — TABLET OPTIMIZED ===== */

/* Header compatto */
.relatore-page .app-header {
    padding: 14px 20px;
}

.relatore-page .app-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.relatore-page .subtitle {
    display: none;
}

/* Stats inline nel header */
.relatore-stats-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.relatore-stat {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
}

.relatore-stat.answered {
    opacity: 0.6;
}

.relatore-stat-divider {
    opacity: 0.4;
    font-weight: 400;
}

/* Pulsante aggiorna solo icona */
.btn-icon-only {
    padding: 8px !important;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main content più stretto */
.relatore-page .main-content {
    padding: 16px;
    padding-bottom: 24px;
}

/* Banner compatto */
.relatore-page .event-header-banner img {
    max-height: 120px;
}

/* Container domande senza ombra superflua */
.relatore-page .questions-container {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* Header domande compatto */
.relatore-page .questions-header {
    padding: 12px 16px;
}

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

/* Card domande — spaziosa per leggere */
.relatore-page .question-card {
    padding: 16px 20px;
    cursor: default;
}

.relatore-page .question-card:hover {
    background: transparent;
}

/* Testo domanda grande e leggibile */
.relatore-question-text {
    font-size: 19px !important;
    line-height: 1.5 !important;
    margin-bottom: 8px !important;
    color: var(--text-primary);
}

/* Numero ordine più grande */
.relatore-order {
    width: 34px;
    height: 34px;
    font-size: 16px;
    margin-top: 0;
}

/* Footer: autore a sinistra, pulsante a destra */
.relatore-footer {
    justify-content: space-between !important;
    align-items: center;
    margin-top: 12px !important;
}

.relatore-author {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Pulsante "Risposto" — grande, touch-friendly */
.btn-relatore-answered {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.btn-relatore-answered:hover {
    background: var(--success-dark);
}

.btn-relatore-answered:active {
    transform: scale(0.97);
}

/* Label "Risposto" per domande già risposte */
.relatore-done-label {
    font-size: 14px;
    color: var(--success);
    font-weight: 500;
}

/* Logo Contacto su relatore — compatto */
.relatore-page .contacto-logo {
    padding: 16px 0;
}

/* Lista domande senza max-height (scroll intera pagina) */
.relatore-page .questions-list {
    max-height: none;
}

/* Filter tabs touch-friendly */
.relatore-page .filter-tab {
    padding: 10px 18px;
    font-size: 14px;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ===== RELATORE TABLET MEDIA QUERIES ===== */

/* Relatore sempre full-bleed (niente body padding) */
.relatore-page {
    padding: 0 !important;
}

.relatore-page .app-container {
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
}

.relatore-page .app-header {
    border-radius: 0;
}

.relatore-page .main-content {
    border-radius: 0;
}

@media (max-width: 1024px) {
    .relatore-page .app-header {
        padding: 12px 16px;
    }

    .relatore-page .main-content {
        padding: 12px;
        padding-bottom: 16px;
    }

    .relatore-page .event-header-banner img {
        max-height: 100px;
    }

    .relatore-question-text {
        font-size: 18px !important;
    }
}

@media (max-width: 768px) {
    .relatore-page body {
        padding: 0;
    }

    .relatore-page .app-header {
        padding: 10px 12px;
    }

    .relatore-page .app-header h1 {
        font-size: 16px;
    }

    .relatore-page .main-content {
        padding: 8px;
    }

    .relatore-question-text {
        font-size: 17px !important;
    }

    .relatore-order {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .btn-relatore-answered {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }

    .relatore-footer {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
}
