/* =============================================
   ecg Events – Global Styles
   Colors: #ffffff, #003333, #50d699
   ============================================= */

:root {
  --primary: #003333;
  --accent: #50d699;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4ecf1 100%);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.header {
  background-color: var(--primary, #003333);
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 20px;
}

.logo {
  height: 45px;
  width: auto;
}

.event-title-header {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
}

.admin-nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
}

.nav-link {
  color: var(--accent, #50d699);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(80, 214, 153, 0.15);
  color: var(--accent, #50d699);
}

/* Footer */
.footer {
  background-color: transparent;
  color: #999999;
  text-align: center;
  padding: 16px 24px;
  margin-top: auto;
  font-size: 13px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer a {
  color: #999999;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #666666;
}

.footer-links {
  display: flex;
  gap: 20px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--accent, #50d699);
  color: var(--primary, #003333);
}

.btn-primary:hover {
  background-color: color-mix(in srgb, var(--accent, #50d699) 85%, black);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #333;
}

.btn-secondary:hover {
  background-color: #cbd5e0;
}

.btn-danger {
  background-color: #e53e3e;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c53030;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-live-off {
  background-color: #718096;
  color: #fff;
  min-width: 90px;
  text-align: center;
}

.btn-live-off:hover {
  background-color: #4a5568;
}

.btn-live-on {
  background-color: #e53e3e;
  color: #fff;
  min-width: 90px;
  text-align: center;
  animation: pulse-live 1.5s infinite;
}

.btn-live-on:hover {
  background-color: #c53030;
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(229, 62, 62, 0); }
}

.btn-full {
  width: 100%;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background-color: #fed7d7;
  color: #c53030;
  border: 1px solid #feb2b2;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #003333);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent, #50d699);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #718096;
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.code-input-group {
  display: flex;
  gap: 8px;
}

.code-input-group input {
  flex: 1;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.inline-form {
  display: inline;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4ecf1 100%);
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(0, 51, 51, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 48px rgba(0, 51, 51, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #50d699), var(--primary, #003333));
  color: #ffffff;
  margin-bottom: 24px;
}

.login-card h1 {
  color: var(--primary, #003333);
  font-size: 28px;
  margin-bottom: 8px;
}

.login-subtitle {
  color: #718096;
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.login-form .form-group {
  text-align: left;
}

.login-input-wrapper {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  pointer-events: none;
  transition: color 0.2s;
}

.login-input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.login-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent, #50d699);
  box-shadow: 0 0 0 3px rgba(80, 214, 153, 0.15);
}

.login-input-wrapper input:focus ~ .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
  color: var(--accent, #50d699);
}

.login-form .btn-full {
  margin-top: 8px;
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.login-form .btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(80, 214, 153, 0.3);
}

/* =============================================
   ADMIN DASHBOARD
   ============================================= */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  flex: 1;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 {
  color: var(--primary, #003333);
  font-size: 24px;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-state p {
  color: #718096;
  font-size: 16px;
  margin-bottom: 16px;
}

/* Online indicator */
.online-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--primary, #003333);
}

.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent, #50d699);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.participants-summary {
  margin-top: 4px;
  font-size: 14px;
  color: #718096;
}

/* Events Table */
.events-table-wrapper {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.events-table {
  width: 100%;
  border-collapse: collapse;
}

.events-table th {
  background-color: var(--primary, #003333);
  color: #ffffff;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.events-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.events-table tbody tr:hover {
  background-color: #f7fafc;
}

.events-table .actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.events-table .actions .btn {
  white-space: nowrap;
}

.code-badge {
  background-color: #e6fffa;
  color: var(--primary, #003333);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background-color: #c6f6d5;
  color: #22543d;
}

.status-badge.inactive {
  background-color: #fed7d7;
  color: #c53030;
}

/* Event Form */
.event-form {
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: 16px;
}

/* Questions Admin */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--accent, #50d699);
}

.question-card.answered {
  border-left-color: #cbd5e0;
  opacity: 0.7;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.question-header strong {
  color: var(--primary, #003333);
}

.question-time {
  font-size: 12px;
  color: #a0aec0;
}

.question-body p {
  font-size: 14px;
  line-height: 1.6;
  color: #4a5568;
}

.question-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.question-actions .toggle-form {
  margin-left: auto;
}

/* Question answer display */
.question-answer {
  margin-top: 10px;
  padding: 10px 14px;
  background-color: #e6fffa;
  border-left: 3px solid var(--accent, #50d699);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--primary, #003333);
}

.question-answer strong {
  color: var(--primary, #003333);
}

.question-answers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.question-answers-list .question-answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-answers-list .btn-danger {
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* Answer Modal */
.answer-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.answer-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.answer-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.answer-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--primary, #003333);
}

.answer-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
}

.answer-modal-close:hover {
  color: var(--primary, #003333);
}

.answer-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.answer-modal textarea:focus {
  outline: none;
  border-color: var(--accent, #50d699);
}

.answer-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Confirm Modal */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.confirm-overlay.visible {
  opacity: 1;
}

.confirm-dialog {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.confirm-overlay.visible .confirm-dialog {
  transform: scale(1);
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 26px;
}

.confirm-icon.danger {
  background: #fed7d7;
  color: #c53030;
}

.confirm-icon.warning {
  background: #fefcbf;
  color: #d69e2e;
}

.confirm-icon.live {
  background: #c6f6d5;
  color: #22543d;
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary, #003333);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: #718096;
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions .btn {
  min-width: 110px;
}

/* =============================================
   EVENT / LIVESTREAM PAGE
   ============================================= */
.event-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1;
}

.stream-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-bottom: 32px;
  transition: grid-template-columns 0.3s ease;
}

.stream-row.qa-hidden {
  grid-template-columns: 1fr 48px;
}

.stream-row.no-qa {
  grid-template-columns: 1fr;
}

/* Livestream */
.stream-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.iframe-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.stream-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #a0aec0;
  font-size: 16px;
}

/* Q&A Panel */
.qa-panel {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  /* JS sets max-height to match stream height */
}

.qa-panel.qa-collapsed {
  border-radius: 12px;
}

.qa-panel.qa-collapsed .qa-body {
  display: none;
}

.qa-panel.qa-collapsed .qa-header {
  border-radius: 12px;
  border-bottom: none;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.qa-panel.qa-collapsed .qa-header h3 {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  justify-content: center;
}

.qa-panel.qa-collapsed .qa-header-text {
  display: none;
}

.qa-panel.qa-collapsed .qa-toggle-icon {
  font-size: 22px;
}

.qa-header {
  padding: 16px 20px;
  border-bottom: 2px solid var(--accent, #50d699);
  background-color: var(--primary, #003333);
  border-radius: 12px 12px 0 0;
  user-select: none;
}

.qa-header h3 {
  color: #ffffff;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qa-toggle-icon {
  font-size: 18px;
  transition: transform 0.2s;
}

.qa-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.qa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-message {
  background: #f7fafc;
  border-radius: 8px;
  padding: 12px;
  border-left: 3px solid var(--accent, #50d699);
}

.qa-message.answered {
  border-left-color: #cbd5e0;
}

.qa-author {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary, #003333);
  margin-bottom: 4px;
}

.qa-text {
  font-size: 13px;
  line-height: 1.5;
  color: #4a5568;
}

.qa-answer {
  margin-top: 6px;
  padding: 6px 10px;
  background-color: #e6fffa;
  border-left: 3px solid var(--accent, #50d699);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--primary, #003333);
}

.qa-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  background-color: #c6f6d5;
  color: #22543d;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.qa-form {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
}

.qa-form .form-group {
  margin-bottom: 10px;
}

.qa-form input,
.qa-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.qa-form input:focus,
.qa-form textarea:focus {
  outline: none;
  border-color: var(--accent, #50d699);
}

/* Countdown */
.countdown-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  margin-bottom: 32px;
}

.countdown-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 51, 51, 0.1);
  max-width: 600px;
  width: 100%;
}

.countdown-card h2 {
  color: var(--primary, #003333);
  font-size: 22px;
  margin-bottom: 32px;
  font-weight: 600;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary, #003333);
  background: #f7fafc;
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 80px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 12px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  font-weight: 600;
}

.countdown-separator {
  font-size: 40px;
  font-weight: 700;
  color: var(--accent, #50d699);
  margin-bottom: 24px;
}

.countdown-date {
  color: #718096;
  font-size: 14px;
}

/* Event Info */
.event-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.info-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.info-section h2 {
  color: var(--primary, #003333);
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--accent, #50d699);
}

.info-content {
  font-size: 14px;
  line-height: 1.8;
  color: #4a5568;
}

.info-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}

.info-content ul, .info-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet landscape & smaller desktops */
@media (max-width: 1024px) {
  .stream-row {
    grid-template-columns: 1fr 320px;
  }

  .event-info {
    grid-template-columns: 1fr;
  }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .stream-row {
    grid-template-columns: 1fr;
  }

  .qa-panel {
    max-height: 450px;
    min-height: 300px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .header-inner {
    gap: 12px;
  }

  .event-title-header {
    font-size: 14px;
  }

  .admin-nav {
    gap: 8px;
  }

  /* Table → card layout on tablet */
  .events-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .events-table .actions {
    flex-direction: column;
  }

  .event-form {
    padding: 24px;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .question-actions {
    flex-wrap: wrap;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .header {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo {
    height: 32px;
  }

  .event-title-header {
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-nav {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }

  .nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  /* Login */
  .login-container {
    padding: 20px 16px;
  }

  .login-card {
    padding: 24px 20px;
  }

  .login-card h1 {
    font-size: 22px;
  }

  /* Event page */
  .event-container {
    padding: 12px;
  }

  .stream-row {
    gap: 16px;
    margin-bottom: 20px;
  }

  .stream-placeholder {
    min-height: 200px;
    font-size: 14px;
  }

  .qa-panel {
    max-height: 450px;
    min-height: 300px;
  }

  .qa-header {
    padding: 12px 14px;
  }

  .qa-messages {
    padding: 12px;
    gap: 8px;
  }

  .qa-message {
    padding: 10px;
  }

  .qa-form {
    padding: 12px;
  }

  .info-section {
    padding: 16px;
  }

  .info-section h2 {
    font-size: 17px;
  }

  /* Admin */
  .admin-container {
    padding: 16px 12px;
  }

  .admin-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .admin-header h1 {
    font-size: 20px;
  }

  /* Table → stacked cards on mobile */
  .events-table thead {
    display: none;
  }

  .events-table,
  .events-table tbody,
  .events-table tr,
  .events-table td {
    display: block;
    width: 100%;
  }

  .events-table tr {
    background: #ffffff;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 16px;
    border-bottom: none;
  }

  .events-table td {
    padding: 4px 0;
    border-bottom: none;
    font-size: 14px;
  }

  .events-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary, #003333);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
  }

  .events-table .actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
  }

  .event-form {
    padding: 16px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
  }

  .code-input-group {
    flex-direction: column;
  }

  .code-input-group .btn {
    width: 100%;
  }

  /* Question cards */
  .question-card {
    padding: 14px;
  }

  .question-actions {
    flex-direction: column;
  }

  .question-actions .btn {
    width: 100%;
    text-align: center;
  }

  /* Footer */
  .footer {
    padding: 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-links {
    gap: 16px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .logo {
    height: 28px;
  }

  .login-card {
    padding: 20px 16px;
  }

  .login-card h1 {
    font-size: 20px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn-small {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* Scrollbar styling */
.qa-messages::-webkit-scrollbar {
  width: 6px;
}

.qa-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.qa-messages::-webkit-scrollbar-thumb {
  background: var(--accent, #50d699);
  border-radius: 3px;
}

.qa-messages::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent, #50d699) 85%, black);
}
