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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

.presenter-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 0;
  color: #7c6ff7;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.brand-icon {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: #e0e0e0;
}

h3 {
  font-size: 1rem;
  color: #aaa;
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #2a2a3d;
  border-radius: 8px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: #7c6ff7;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #7c6ff7;
  color: #fff;
}

.btn-primary:hover {
  background: #6a5ce0;
}

.btn-secondary {
  background: #2a2a3d;
  color: #e0e0e0;
}

.btn-secondary:hover {
  background: #3a3a4d;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-large {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  border-radius: 10px;
}

.btn-submit {
  margin-top: 4px;
}

.btn-loading {
  opacity: 0.7;
}

.btn-leave {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 0.9rem;
}

.btn-outline {
  padding: 8px 18px;
  border: 1px solid #2a2a3d;
  border-radius: 8px;
  background: transparent;
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #3a3a4d;
}

.btn-outline-danger:hover {
  background: #2a1a1a;
  color: #ef5350;
  border-color: #e74c3c44;
}

.status {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
  font-size: 0.9rem;
}

.status.success {
  background: #1a3a1a;
  color: #4caf50;
  display: block;
}

.status.error {
  background: #3a1a1a;
  color: #ef5350;
  display: block;
}

.card {
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 16px;
}

.card h2 {
  margin-bottom: 8px;
}

.hint {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.room-code-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #2a2a3d;
  border-radius: 12px;
  background: #0f0f1a;
  color: #7c6ff7;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 12px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
  font-family: inherit;
}

.room-code-input:focus {
  border-color: #7c6ff7;
}

.room-code-input::placeholder {
  color: #333;
  letter-spacing: 8px;
}

.response-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #2a2a3d;
  border-radius: 10px;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
  margin-bottom: 4px;
}

.response-textarea:focus {
  border-color: #7c6ff7;
}

.response-textarea::placeholder {
  color: #444;
}

.char-counter {
  text-align: right;
  color: #444;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.room-info {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px;
  background: #1a1a2e;
  border-radius: 12px;
  border: 1px solid #2a2a3d;
}

.room-info .room-code-display {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #7c6ff7;
  margin-top: 8px;
}

.room-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 1.2rem;
  padding: 64px 16px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ===================== PARTICIPANT SLIDE VIEWS ===================== */

.slide-participant-view {
  animation: fadeSlideIn 0.3s ease;
}

.info-participant-card {
  text-align: center;
  padding: 48px 24px;
}

.info-participant-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.info-participant-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 12px;
}

.info-participant-hint {
  color: #555;
  font-size: 0.95rem;
}

.poll-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-poll-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: #1a1a2e;
  border: 2px solid #2a2a3d;
  border-radius: 10px;
  color: #e0e0e0;
  font-size: 1rem;
  text-align: left;
  transition: all 0.2s;
}

.btn-poll-option:hover {
  background: #22223a;
  border-color: #7c6ff7;
}

.btn-poll-option:active {
  transform: scale(0.98);
}

.btn-poll-option.poll-option-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #2a2a3d;
}

.btn-poll-option.poll-option-disabled:hover {
  background: #1a1a2e;
  border-color: #2a2a3d;
}

.poll-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #7c6ff722;
  color: #7c6ff7;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.poll-option-text {
  flex: 1;
  font-weight: 500;
}

.poll-voted-message {
  text-align: center;
  padding: 12px;
  margin-top: 12px;
  background: #1a3a1a;
  border-radius: 8px;
  color: #4caf50;
  font-weight: 600;
}

.voted-check {
  margin-right: 6px;
}

/* ===================== PRESENTER LAYOUT ===================== */

.presenter-setup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.setup-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.presenter-badge {
  font-size: 0.45em;
  background: #7c6ff7;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 1px;
}

.presenter-live {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.presenter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0a0a14;
  border-bottom: 1px solid #1e1e30;
  flex-shrink: 0;
  gap: 16px;
}

.presenter-header-left {
  flex: 1;
  min-width: 0;
}

.presenter-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.qr-canvas {
  border-radius: 6px;
  border: 1px solid #2a2a3d;
  flex-shrink: 0;
}

.join-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.join-label {
  color: #555;
  font-size: 0.9rem;
}

.join-url {
  color: #888;
  font-size: 0.9rem;
  font-weight: 600;
  background: #1a1a2e;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #2a2a3d;
}

.join-code {
  color: #7c6ff7;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 4px;
  background: #1a1a2e;
  padding: 4px 16px;
  border-radius: 6px;
  border: 1px solid #7c6ff733;
}

.presenter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-counter {
  color: #555;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===================== DYNAMIC TITLE BAR ===================== */

.dynamic-title-bar {
  text-align: center;
  padding: 12px 24px;
  background: #0f0f1a;
  border-bottom: 1px solid #1e1e30;
  flex-shrink: 0;
  animation: fadeSlideIn 0.3s ease;
}

.dynamic-slide-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #7c6ff7;
  letter-spacing: 0.5px;
}

/* ===================== PRESENTER SLIDE CONTAINER ===================== */

.slide-container {
  flex: 1;
  width: 100%;
  position: relative;
  background: #0f0f1a;
  overflow: hidden;
}

.slide-container.slide-transitioning {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.slide-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Info slide presenter */

#infoSlide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-content {
  text-align: center;
  padding: 48px;
}

.info-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #e0e0e0;
  line-height: 1.2;
  margin-bottom: 24px;
  animation: fadeSlideIn 0.5s ease;
}

.info-hint {
  color: #444;
  font-size: 1.1rem;
}

.info-image {
  max-width: 80vw;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto 24px;
  display: block;
  animation: fadeSlideIn 0.5s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Word cloud presenter */

.cloud-container {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.cloud-container svg {
  display: block;
}

#wordcloudSlide .cloud-container {
  padding: 16px;
}

/* Poll chart presenter */

.poll-chart-container {
  flex: 1;
  padding: 24px 48px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pollChart {
  max-height: 100%;
}

/* ===================== ADMIN LAYOUT ===================== */

.admin-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar {
  width: 300px;
  background: #0a0a14;
  border-right: 1px solid #1e1e30;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand {
  font-size: 1.3rem;
  color: #7c6ff7;
  margin: 0;
}

.sidebar-badge {
  font-size: 0.65rem;
  background: #7c6ff722;
  color: #7c6ff7;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
  font-weight: 700;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
}

.add-slide-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-add-slide {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-add-slide:hover {
  background: #22223a;
  border-color: #3a3a4d;
}

.slide-type-icon {
  font-size: 1.2rem;
}

.admin-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.main-title {
  font-size: 1.3rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 24px;
}

.slide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slide-card {
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 10px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.slide-card:hover {
  border-color: #3a3a4d;
}

.slide-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.slide-card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #7c6ff722;
  color: #7c6ff7;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.slide-card-type {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.slide-card-delete {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #555;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.slide-card-delete:hover {
  background: #2a1a1a;
  border-color: #e74c3c44;
  color: #ef5350;
}

.slide-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e0e0e0;
}

.slide-card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.poll-option-tag {
  font-size: 0.75rem;
  background: #2a2a3d;
  color: #888;
  padding: 3px 10px;
  border-radius: 4px;
}

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

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 8px;
}

.field-optional {
  font-weight: 400;
  color: #555;
  font-size: 0.8rem;
}

.slide-card-meta {
  font-size: 0.75rem;
  color: #555;
  margin-top: 6px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #2a2a3d;
  border-radius: 8px;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.input-field:focus {
  border-color: #7c6ff7;
}

.input-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #2a2a3d;
  border-radius: 8px;
  background: #0f0f1a;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  line-height: 1.5;
}

.input-textarea:focus {
  border-color: #7c6ff7;
}

/* ===================== ADMIN MODAL ===================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  overflow: hidden;
  animation: scaleIn 0.2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #2a2a3d;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  padding: 0;
}

.modal-close:hover {
  background: #2a2a3d;
  color: #e0e0e0;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #2a2a3d;
}

/* ===================== ADMIN CONTROLS LAYOUT ===================== */

.admin-controls-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #0a0a14;
  border-bottom: 1px solid #1e1e30;
  gap: 16px;
  flex-wrap: wrap;
}

.controls-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls-label {
  color: #555;
  font-size: 0.8rem;
}

.controls-code {
  color: #7c6ff7;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 3px;
}

.controls-url-banner {
  color: #555;
  font-size: 0.85rem;
}

.controls-url-banner strong {
  color: #888;
}

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

.controls-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.controls-slide-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.controls-slide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 8px;
  transition: all 0.2s;
}

.controls-slide-item.active {
  border-color: #7c6ff7;
  background: #7c6ff711;
}

.controls-slide-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a3d;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
}

.controls-slide-item.active .controls-slide-num {
  background: #7c6ff7;
  color: #fff;
}

.controls-slide-icon {
  font-size: 1.1rem;
}

.controls-slide-title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls-slide-type-label {
  font-size: 0.75rem;
  color: #555;
  background: #2a2a3d;
  padding: 2px 8px;
  border-radius: 4px;
}

.controls-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid #1e1e30;
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #1a1a2e;
  border: 1px solid #2a2a3d;
  border-radius: 10px;
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-nav:hover:not(:disabled) {
  background: #22223a;
  border-color: #3a3a4d;
}

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

.nav-arrow {
  font-size: 1.2rem;
}

.slide-indicator {
  font-size: 1.1rem;
  font-weight: 700;
  color: #555;
}

/* ===================== ANIMATIONS ===================== */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .room-info .room-code-display {
    font-size: 1.5rem;
  }

  .room-code-input {
    font-size: 1.5rem;
    letter-spacing: 8px;
    padding: 14px;
  }

  .card {
    padding: 20px 16px;
  }

  .btn-large {
    padding: 14px 20px;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid #1e1e30;
  }

  .admin-main {
    padding: 20px 16px;
  }

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

  .info-title {
    font-size: 2rem;
  }

  .presenter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .presenter-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .dynamic-slide-title {
    font-size: 1.2rem;
  }

  .info-image {
    max-width: 95vw;
    max-height: 40vh;
  }

  .poll-chart-container {
    padding: 16px;
  }
}
