/* =========================================================================
   THE MIRROR QUESTION — STYLES
   Premium, minimal, philosophical mirror UI
   ========================================================================= */

.mirror-layout {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0e13;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mirror-layout.view-hidden {
  display: none !important;
}

/* --- Header --- */
.mirror-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: rgba(10, 14, 19, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
  z-index: 10;
}

.mirror-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mirror-back-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.mirror-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.mirror-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: rgba(226, 232, 240, 0.9);
}

/* --- Main Content Area --- */
.mirror-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
  position: relative;
}

/* --- Tabs (Sessions toggle) --- */
.mirror-tabs {
  display: flex;
  justify-content: center;
  padding: 16px 0 0;
  gap: 10px;
}

.mirror-tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(148, 163, 184, 0.8);
  padding: 7px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mirror-tab.active {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 2px 0 0 rgba(139, 92, 246, 0.5);
}

.mirror-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
}

/* --- Views --- */
.mirror-view {
  display: none;
  flex: 1;
  width: 100%;
}

.mirror-view.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- Question Phase --- */
.mirror-question-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: mirrorFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mirror-step-indicator {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: rgba(139, 92, 246, 0.7);
  font-weight: 600;
  margin-bottom: 20px;
}

.mirror-question-text {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.8px;
  color: #fff;
  margin-bottom: 40px;
  min-height: 80px;
}

.mirror-input-wrapper {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  transition: all 0.3s ease;
}

.mirror-input-wrapper:focus-within {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.04);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.08), 0 0 80px rgba(139, 92, 246, 0.03);
}

.mirror-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 17px;
  line-height: 1.7;
  resize: none;
  min-height: 100px;
  outline: none;
  font-family: inherit;
}

.mirror-textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
}

.mirror-submit-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #0a0e13;
  border: none;
  padding: 14px 36px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
}

.mirror-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
  background: #fff;
}

.mirror-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Progress Dots --- */
.mirror-progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.mirror-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
}

.mirror-dot.active {
  background: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.mirror-dot.done {
  background: rgba(139, 92, 246, 0.35);
}

/* --- Thinking State --- */
.mirror-thinking {
  text-align: center;
  animation: mirrorFadeUp 0.5s ease;
}

.mirror-thinking-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.mirror-thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.6);
  animation: mirrorPulse 1.4s ease-in-out infinite;
}

.mirror-thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.mirror-thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes mirrorPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.mirror-thinking-label {
  font-size: 14px;
  color: rgba(148, 163, 184, 0.6);
  letter-spacing: 0.5px;
}

/* --- Insight Reveal --- */
.mirror-insight-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: mirrorInsightReveal 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mirrorInsightReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mirror-insight-icon {
  font-size: 48px;
  margin-bottom: 24px;
  display: block;
  opacity: 0.9;
}

.mirror-insight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(139, 92, 246, 0.6);
  font-weight: 600;
  margin-bottom: 20px;
}

.mirror-insight-text {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.95);
  letter-spacing: -0.2px;
  margin-bottom: 40px;
}

.mirror-insight-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.mirror-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.8);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
}

.mirror-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.mirror-btn-primary {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
}

.mirror-btn-primary:hover {
  background: rgba(139, 92, 246, 0.25);
}

/* --- Past Sessions View --- */
.mirror-sessions-container {
  max-width: 600px;
  width: 100%;
  padding: 32px 24px 60px;
  margin: 0 auto;
}

.mirror-sessions-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #fff;
}

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

.mirror-session-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.mirror-session-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(139, 92, 246, 0.15);
}

.mirror-session-date {
  font-size: 11px;
  font-weight: 600;
  color: rgba(139, 92, 246, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.mirror-session-insight {
  font-size: 15px;
  color: rgba(226, 232, 240, 0.85);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mirror-session-q-count {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.5);
  margin-top: 10px;
}

.mirror-sessions-empty {
  text-align: center;
  color: rgba(148, 163, 184, 0.5);
  font-size: 14px;
  padding: 60px 0;
}

/* --- Session Detail Modal --- */
.mirror-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 19, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: mirrorFadeUp 0.4s ease;
}

.mirror-detail-content {
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(18, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 32px;
}

.mirror-detail-close {
  float: right;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.mirror-detail-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mirror-detail-qa {
  margin-top: 20px;
}

.mirror-detail-q {
  font-size: 14px;
  color: rgba(139, 92, 246, 0.7);
  font-weight: 600;
  margin-bottom: 6px;
}

.mirror-detail-a {
  font-size: 15px;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.5;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 2px solid rgba(139, 92, 246, 0.15);
}

.mirror-detail-insight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(139, 92, 246, 0.5);
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 8px;
}

.mirror-detail-insight {
  font-size: 18px;
  color: rgba(226, 232, 240, 0.95);
  line-height: 1.6;
  font-weight: 500;
}

/* --- Mobile Adjustments --- */
@media (max-width: 600px) {
  .mirror-header {
    padding: 16px 20px;
  }

  .mirror-question-text {
    font-size: 24px;
  }

  .mirror-insight-text {
    font-size: 18px;
  }

  .mirror-body {
    padding: 24px 16px;
  }

  .mirror-sessions-container {
    padding: 20px 16px 40px;
  }
}
