/**
 * character-voice.css — P4 Sprint 8 Task 8.2
 * ===========================================
 * Styles for character voice layer
 * 
 * Character colors from Character Bible:
 * - Kappy (Ancient Sage): Cosmic Blue #0C4A6E
 * - Gopala (Living Master): Living Green #15803D
 * - Neil (Socratic Guide): Golden Wisdom #F59E0B
 * - Sophie (Intrepid Learner): Earth Black #0F172A
 */

.discovery-zone {
  --char-sophie: #0F172A;
  --char-neil: #F59E0B;
  --char-gopala: #15803D;
  --char-kappy: #0C4A6E;
}

/* ========================================================================
   CHARACTER VOICE PANEL
   ======================================================================== */

.character-voice-panel {
  background: #FFFFFF;
  border: 2px solid #D6E4F0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(13, 59, 110, 0.08);
}

.character-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #E8F0F7;
}

.character-voice-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ocean);
  margin: 0;
}

.character-voice-hide-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #E8F0F7;
  color: var(--ocean);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-voice-hide-btn:hover {
  background: #D6E4F0;
  transform: scale(1.1);
}

.character-voice-hide-btn:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ========================================================================
   CHARACTER TABS
   ======================================================================== */

.character-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #E8F0F7;
  padding-bottom: 0.5rem;
}

.character-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  flex: 1;
}

.character-tab:hover {
  background: #F8FAFB;
}

.character-tab.active {
  background: #F8FAFB;
}

.character-tab:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.character-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.character-tab-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate);
}

.character-tab.active .character-tab-name {
  color: var(--ocean);
}

/* ========================================================================
   CHARACTER DIALOGUE
   ======================================================================== */

.character-dialogue {
  padding: 1rem;
  background: #F8FAFB;
  border-radius: 8px;
  border-left: 4px solid var(--ocean);
}

.character-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.character-voice-label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #666;
  font-style: italic;
}

.character-speech {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--slate);
}

/* Sophie border */
.character-tabs .character-tab:nth-child(1).active ~ .character-dialogue,
.character-dialogue[data-character="sophie"] {
  border-left-color: var(--char-sophie);
}

/* Neil border */
.character-tabs .character-tab:nth-child(2).active ~ .character-dialogue,
.character-dialogue[data-character="neil"] {
  border-left-color: var(--char-neil);
}

/* Gopala border */
.character-tabs .character-tab:nth-child(3).active ~ .character-dialogue,
.character-dialogue[data-character="gopala"] {
  border-left-color: var(--char-gopala);
}

/* Kappy border */
.character-tabs .character-tab:nth-child(4).active ~ .character-dialogue,
.character-dialogue[data-character="kappy"] {
  border-left-color: var(--char-kappy);
}

/* ========================================================================
   SHOW/HIDE TOGGLE
   ======================================================================== */

.character-voice-toggle {
  margin: 1rem 0;
  text-align: center;
}

.character-voice-show-btn {
  padding: 0.75rem 1.5rem;
  background: var(--ocean);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 59, 110, 0.2);
}

.character-voice-show-btn:hover {
  background: #0A2D54;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 59, 110, 0.3);
}

.character-voice-show-btn:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ========================================================================
   LIGHTWEIGHT PROMPTS (Other Sandboxes)
   ======================================================================== */

.character-prompt-card {
  background: #F8FAFB;
  border-left: 4px solid var(--ocean);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.character-prompt-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.character-prompt-content {
  flex: 1;
}

.character-prompt-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ocean);
  margin-bottom: 0.5rem;
}

.character-prompt-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--slate);
}

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

@media (max-width: 768px) {
  .character-tabs {
    flex-wrap: wrap;
  }

  .character-tab {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem;
    flex: 1 1 calc(50% - 0.25rem);
  }

  .character-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .character-tab-name {
    font-size: 0.8125rem;
  }

  .character-dialogue {
    padding: 0.875rem;
  }

  .character-name {
    font-size: 0.9375rem;
  }

  .character-speech {
    font-size: 0.9375rem;
  }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
  .character-tab,
  .character-voice-hide-btn,
  .character-voice-show-btn {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .character-voice-panel {
    border-width: 3px;
  }

  .character-dialogue {
    border-left-width: 5px;
  }

  .character-tab.active {
    background: #E8F0F7;
  }
}
