/* ============================================
   Debate Mode - Professional Style
   ============================================ */

/* Debate Setup */
.debate-setup {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

/* Topic Card */
.topic-card {
  padding: 24px;
  background: rgba(58, 123, 255, 0.05);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  animation: slideUp 0.3s var(--ease-out);
}

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

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

.topic-card h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.topic-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.topic-difficulty {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.topic-difficulty.easy {
  background: rgba(0, 214, 122, 0.1);
  color: var(--accent-green);
}

.topic-difficulty.medium {
  background: rgba(255, 176, 32, 0.1);
  color: var(--accent-yellow);
}

.topic-difficulty.hard {
  background: rgba(255, 77, 79, 0.1);
  color: var(--accent-red);
}

/* Time Options */
.time-options {
  display: flex;
  gap: 12px;
}

.time-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.time-btn:hover {
  border-color: var(--border-default);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.time-btn.active {
  background: rgba(58, 123, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.time-value {
  font-size: 28px;
  font-weight: 700;
  color: inherit;
}

.time-btn.active .time-value {
  color: var(--accent-blue);
}

.time-unit {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Active Debate */
.debate-active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.debate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(20, 22, 32, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.debate-timer-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(58, 123, 255, 0.1);
  border-radius: 100px;
}

.timer-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-blue);
}

.debate-timer {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Inter', monospace;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
}

.debate-timer.warning {
  color: var(--accent-yellow);
}

.debate-timer-container:has(.warning) {
  background: rgba(255, 176, 32, 0.1);
}

.debate-timer-container:has(.warning) .timer-icon {
  color: var(--accent-yellow);
}

.debate-timer.danger {
  color: var(--accent-red);
  animation: timerPulse 1s infinite;
}

.debate-timer-container:has(.danger) {
  background: rgba(255, 77, 79, 0.1);
}

.debate-timer-container:has(.danger) .timer-icon {
  color: var(--accent-red);
}

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

.debate-topic-bar {
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.debate-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.debate-form {
  padding: 20px 24px;
  background: rgba(20, 22, 32, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
}

/* Debate Results */
.debate-results {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.results-header {
  margin-bottom: 40px;
}

.results-header h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.results-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

.score-display {
  margin-bottom: 40px;
}

.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 8;
}

.score-progress {
  fill: none;
  stroke: url(#score-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1.5s var(--ease-out);
}

.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value {
  font-size: 48px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-label {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.breakdown-item {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.breakdown-item .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.breakdown-item .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue);
}

.score-feedback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
  text-align: left;
}

.feedback-section {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.feedback-section h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.feedback-section.strengths h4 {
  color: var(--accent-green);
}

.feedback-section.weaknesses h4 {
  color: var(--accent-yellow);
}

.feedback-section h4 svg {
  width: 18px;
  height: 18px;
}

.feedback-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feedback-section li {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Leaderboard */
.debate-leaderboard {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.leaderboard-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.leaderboard-header h2 {
  flex: 1;
  font-size: 28px;
  font-weight: 700;
}

.leaderboard-topic {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.2s var(--ease-out);
}

.leaderboard-entry:hover {
  border-color: var(--border-default);
}

.leaderboard-entry.top-3 {
  background: linear-gradient(90deg, rgba(58, 123, 255, 0.08), transparent);
  border-color: var(--border-accent);
}

.leaderboard-rank {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-muted);
}

.leaderboard-entry.top-3:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, #FFD700, #FFAA00);
  color: #000;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.leaderboard-entry.top-3:nth-child(2) .leaderboard-rank {
  background: linear-gradient(135deg, #E0E0E0, #B0B0B0);
  color: #000;
}

.leaderboard-entry.top-3:nth-child(3) .leaderboard-rank {
  background: linear-gradient(135deg, #CD7F32, #A05A20);
  color: #fff;
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-default);
}

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

.leaderboard-score {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-blue);
}

.leaderboard-time {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 70px;
  text-align: right;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

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

/* Mobile Adjustments */
@media (max-width: 768px) {
  .topic-header {
    flex-direction: column;
    gap: 12px;
  }

  .time-options {
    gap: 8px;
  }

  .time-btn {
    padding: 16px;
  }

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

  .debate-header {
    padding: 14px 16px;
  }

  .debate-timer-container {
    padding: 8px 16px;
  }

  .debate-timer {
    font-size: 20px;
  }

  .debate-topic-bar {
    padding: 12px 16px;
    font-size: 13px;
  }

  .debate-messages {
    padding: 16px;
    gap: 16px;
  }

  .debate-form {
    padding: 14px 16px;
  }

  .results-container {
    padding: 32px 16px;
  }

  .results-header h2 {
    font-size: 28px;
  }

  .score-ring {
    width: 140px;
    height: 140px;
  }

  .score-value {
    font-size: 40px;
  }

  .score-feedback {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .results-actions {
    flex-direction: column;
  }

  .leaderboard-container {
    padding: 24px 16px;
  }

  .leaderboard-entry {
    padding: 14px 16px;
    gap: 12px;
  }

  .leaderboard-rank {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .leaderboard-avatar {
    width: 38px;
    height: 38px;
  }

  .leaderboard-score {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .time-options {
    flex-wrap: wrap;
  }

  .time-btn {
    flex: 1 1 calc(33% - 8px);
    min-width: 80px;
  }
}
