/* CollaBoard - Component & Application Specific Styles */

/* ==========================================================================
   Lobby & Landing Page
   ========================================================================== */
.lobby-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.lobby-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-full);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title span {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 680px;
}

/* Philosophy Banner */
.philosophy-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--shadow-md);
}

.banner-content h4 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: #38bdf8;
}

.banner-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.banner-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Alert Banner for Room Not Found / Notices */
.lobby-alert-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(185, 28, 28, 0.28));
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}

.lobby-alert-banner .alert-icon {
  font-size: 2.25rem;
  flex-shrink: 0;
}

.lobby-alert-banner .alert-content {
  flex: 1;
}

.lobby-alert-banner .alert-content strong {
  color: #fca5a5;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.lobby-alert-banner .alert-content p {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

/* Lobby Action Cards Grid */
.lobby-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s;
}

.action-card:hover {
  border-color: #475569;
}

.card-header-icon {
  font-size: 2.25rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
}

.action-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.action-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* App Selection Grid in Create Room */
.app-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.app-select-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.app-select-chip:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.app-select-chip.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.15);
  box-shadow: 0 0 0 1px var(--primary);
}

.chip-icon {
  font-size: 1.25rem;
}

.chip-info {
  display: flex;
  flex-direction: column;
}

.chip-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.chip-badge {
  font-size: 0.65rem;
  color: var(--text-subtle);
}

/* Apps Catalog Showcase */
.apps-showcase-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-header {
  text-align: center;
}

.section-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.showcase-icon {
  font-size: 2rem;
}

.showcase-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.showcase-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
}

.showcase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.showcase-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #94a3b8;
}

/* ==========================================================================
   Room Shell & Top Bar
   ========================================================================== */
.room-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 61px);
  overflow: hidden;
}

.room-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.room-app-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.room-app-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.room-app-tab:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.room-app-tab.active {
  background: rgba(79, 70, 229, 0.2);
  border-color: var(--primary-border);
  color: #a5b4fc;
}

.room-app-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: var(--bg-main);
}

/* ==========================================================================
   1. Whiteboard App
   ========================================================================== */
.app-whiteboard-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
}

.wb-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.wb-tool-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wb-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

.wb-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.wb-btn:hover {
  background: #475569;
}

.wb-btn.active {
  background: var(--primary);
  border-color: var(--primary-hover);
}

.wb-color-picker {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.wb-palette {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.wb-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wb-range {
  width: 80px;
}

.wb-width-value {
  font-size: 0.75rem;
  min-width: 32px;
  font-family: monospace;
}

.wb-toolbar-spacer {
  flex: 1;
}

.wb-canvas-container {
  flex: 1;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  cursor: crosshair;
}

#whiteboardCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   2. Brainstorming App
   ========================================================================== */
.app-brainstorm-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.bs-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bs-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f59e0b;
}

.bs-prompt-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.bs-host-edit-prompt {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.bs-prompt-input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
}

.bs-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.bs-status-badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
}

.badge-hidden {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.badge-revealed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.bs-host-controls {
  display: flex;
  gap: 0.5rem;
}

.bs-content-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .bs-content-grid {
    grid-template-columns: 1fr;
  }
}

.bs-submit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.bs-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bs-textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.bs-submit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bs-feedback {
  font-size: 0.85rem;
  color: #34d399;
}

.bs-stat-chip {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.bs-board-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bs-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bs-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.bs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}

.bs-card:hover {
  border-color: #475569;
  transform: translateY(-2px);
}

.bs-card-mine {
  border-left: 4px solid var(--primary);
}

.bs-card-top.rank-1 {
  border: 2px solid #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), var(--bg-surface));
}

.bs-rank-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: #fbbf24;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.bs-card-body {
  flex: 1;
}

.bs-card-text {
  font-size: 1rem;
  line-height: 1.4;
  word-break: break-word;
}

.bs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bs-vote-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.bs-vote-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.bs-vote-btn.voted {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

.bs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

/* ==========================================================================
   3. Q&A Board App
   ========================================================================== */
.app-qna-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.qna-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qna-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.qna-topic-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.qna-host-topic-edit {
  display: flex;
  gap: 0.5rem;
}

.qna-topic-input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}

.qna-stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.qna-stat-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qna-layout-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .qna-layout-grid {
    grid-template-columns: 1fr;
  }
}

.qna-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.qna-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qna-textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

.qna-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qna-anon-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.qna-stream-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qna-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qna-stream-legend {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.qna-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qna-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  transition: all 0.15s;
}

.qna-pinned {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), var(--bg-surface));
}

.qna-answered {
  opacity: 0.65;
  background: rgba(15, 23, 42, 0.5);
}

.qna-vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qna-upvote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 48px;
  height: 52px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.qna-upvote-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.qna-upvote-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.qna-upvote-arrow {
  font-size: 0.8rem;
}

.qna-upvote-count {
  font-size: 0.95rem;
  font-weight: 700;
}

.qna-body-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qna-pin-pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.qna-done-pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.qna-text {
  font-size: 1.05rem;
  line-height: 1.4;
  word-break: break-word;
}

.qna-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.qna-host-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

.qna-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

/* ==========================================================================
   4. Study & Quiz App
   ========================================================================== */
.app-quiz-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.quiz-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.quiz-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a855f7;
  letter-spacing: 0.05em;
}

.quiz-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz-count-pill {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-layout-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .quiz-layout-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-creator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.quiz-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.quiz-input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
}

.quiz-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-opt-text {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
}

.quiz-pool-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-pool-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-num-badge {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.quiz-author-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quiz-card-question {
  font-size: 1.05rem;
  font-weight: 600;
}

.quiz-card-options-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.quiz-opt-chip {
  font-size: 0.8rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.opt-is-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.quiz-card-explain {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Quiz Play View */
.quiz-play-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.quiz-play-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-progress-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.quiz-progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quiz-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s;
}

.quiz-question-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.quiz-play-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-choice-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.quiz-choice-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: #64748b;
}

.quiz-choice-btn.selected {
  background: rgba(79, 70, 229, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.quiz-choice-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.quiz-play-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

/* Quiz Result View */
.quiz-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.quiz-result-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.quiz-score-badge {
  font-size: 3rem;
  font-weight: 900;
  color: #34d399;
}

.quiz-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .quiz-result-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-leaderboard-box, .quiz-review-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.quiz-rank-row.my-rank {
  border: 1px solid var(--primary);
  background: rgba(79, 70, 229, 0.15);
}

.quiz-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.quiz-review-item {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quiz-review-item.correct {
  border-left: 3px solid #10b981;
}

.quiz-review-item.wrong {
  border-left: 3px solid #ef4444;
}

.text-success { color: #34d399; }
.text-danger { color: #f87171; }

.quiz-result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   5. Instant Poll App
   ========================================================================== */
.app-poll-wrapper {
  padding: 2rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.poll-main-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  box-shadow: var(--shadow-md);
}

.poll-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #06b6d4;
  letter-spacing: 0.05em;
}

.poll-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.poll-question-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.poll-status-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  white-space: nowrap;
}

.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-closed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.poll-meta-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.poll-option-item {
  position: relative;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.poll-option-item:hover:not(.disabled) {
  border-color: #64748b;
}

.poll-option-item.selected {
  border-color: var(--accent);
}

.poll-option-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.2), rgba(79, 70, 229, 0.25));
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.poll-option-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  z-index: 2;
}

.poll-option-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.poll-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.poll-option-radio.checked {
  border-color: var(--accent);
}

.poll-option-radio.checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

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

.poll-my-vote-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: var(--accent);
  color: #0f172a;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.poll-pct {
  font-size: 1.1rem;
  color: #67e8f9;
}

.poll-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.poll-footer-controls {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.poll-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.poll-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 1rem;
}

.poll-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.poll-opt-input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.poll-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ==========================================================================
   6. P2P File & Photo Share App
   ========================================================================== */
.app-fileshare-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.fs-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.fs-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.05em;
}

.fs-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.fs-security-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.fs-main-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .fs-main-grid {
    grid-template-columns: 1fr;
  }
}

.fs-dropzone {
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  height: fit-content;
}

.fs-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
}

.fs-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.fs-drop-icon {
  font-size: 3rem;
}

.fs-dropzone h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.fs-dropzone p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fs-file-input {
  display: none;
}

.fs-list-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fs-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fs-count-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fs-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fs-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: border-color 0.15s;
}

.fs-item-card.fs-mine {
  border-left: 3px solid var(--primary);
}

.fs-item-preview {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.fs-img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fs-icon-thumb {
  font-size: 1.5rem;
}

.fs-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.fs-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
}

.fs-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.fs-progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.fs-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.1s;
}

.fs-progress-text {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
}

.fs-badge-transferring {
  font-size: 0.75rem;
  color: #38bdf8;
  padding: 0.2rem 0.5rem;
  background: rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-sm);
}

.fs-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}
