/* 
   Mindset Mastery Assessment - Premium Stylesheet
   Designed with glassmorphism, glowing custom gradients, and responsive micro-animations.
*/

:root {
  /* Colors */
  --bg-color: #0c0f17;
  --panel-bg: rgba(22, 28, 45, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(88, 101, 242, 0.4);
  
  --color-primary: #5865f2; /* Discord Blurple */
  --color-primary-hover: #4752c4;
  --color-primary-glow: rgba(88, 101, 242, 0.35);
  
  --color-secondary: #4f545c;
  --color-secondary-hover: #686d73;
  
  --color-success: #23a55a; /* Discord Green */
  --color-success-bg: rgba(35, 165, 90, 0.08);
  --color-success-border: rgba(35, 165, 90, 0.25);
  --color-success-hover-border: rgba(35, 165, 90, 0.5);
  
  --color-danger: #f23f43; /* Discord Red */
  --color-danger-bg: rgba(242, 63, 67, 0.08);
  --color-danger-border: rgba(242, 63, 67, 0.25);
  --color-danger-hover-border: rgba(242, 63, 67, 0.5);
  
  --text-main: #f2f3f5;
  --text-muted: #949ba4;
  --text-header: #ffffff;

  /* Typography */
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  
  /* Layout */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background Decorative Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
  animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background-color: var(--color-primary);
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background-color: #eb459e; /* Pinkish-Red */
  bottom: -5%;
  right: -5%;
  animation-duration: 20s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background-color: #57f287; /* Greenish-Cyan */
  top: 40%;
  right: 15%;
  animation-duration: 30s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, 30px) scale(1.15);
  }
}

/* App Layout Container */
.app-container {
  width: 100%;
  max-width: 760px;
  margin: 20px;
  display: flex;
  flex-direction: column;
  min-height: 85vh;
  z-index: 2;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(15, 18, 30, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-header);
}

.accent-text {
  color: var(--color-primary);
  background: linear-gradient(135deg, #7289da, #5865f2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* User Profile Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.user-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-header);
}

.logout-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-left: 4px;
  transition: var(--transition-smooth);
}

.logout-link:hover {
  color: var(--color-danger);
  transform: translateX(2px);
}

.hidden {
  display: none !important;
}

/* Main Panel Frame */
.main-content {
  flex-grow: 1;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Panel Views (Single Page Application Switch) */
.view-panel {
  display: none;
  flex-direction: column;
  padding: 40px;
  width: 100%;
  animation: viewFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-panel.active-view {
  display: flex;
}

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

.text-center {
  text-align: center;
  align-items: center;
}

/* Landing View Aesthetics */
.badge {
  background: rgba(88, 101, 242, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(88, 101, 242, 0.3);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: inline-block;
  margin-bottom: 20px;
}

.title-primary {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-header);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.desc-text {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 36px auto;
  line-height: 1.6;
}

/* Auth Section Buttons */
.auth-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  width: 100%;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
  padding: 0 10px;
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-discord {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-discord:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.btn-discord:active {
  transform: translateY(0);
}

.discord-logo-svg {
  width: 22px;
  height: 22px;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-outline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #7289da, #5865f2);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(88, 101, 242, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- QUIZ PANEL STYLING --- */
.quiz-progress-wrapper {
  margin-bottom: 30px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-percentage {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.progress-bar-container {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7289da, var(--color-primary));
  border-radius: 50px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.4);
}

.quiz-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
}

.question-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-header);
  margin-bottom: 24px;
}

/* Options Wrapper */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition-smooth);
  position: relative;
}

/* Option-specific Colors (Optimal Green vs Sub-optimal Red) */
.option-item.opt-green {
  border: 1px solid var(--color-success-border);
}

.option-item.opt-green:hover {
  background: rgba(35, 165, 90, 0.04);
  border-color: var(--color-success-hover-border);
  transform: scale(1.005);
}

.option-item.opt-green.selected {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  box-shadow: 0 0 12px rgba(35, 165, 90, 0.15);
}

.option-item.opt-red {
  border: 1px solid var(--color-danger-border);
}

.option-item.opt-red:hover {
  background: rgba(242, 63, 67, 0.04);
  border-color: var(--color-danger-hover-border);
  transform: scale(1.005);
}

.option-item.opt-red.selected {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  box-shadow: 0 0 12px rgba(242, 63, 67, 0.15);
}

/* Radio circle helper */
.option-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  margin-right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.option-item.opt-green:hover .option-circle {
  border-color: var(--color-success);
}

.option-item.opt-green.selected .option-circle {
  border-color: var(--color-success);
  background-color: var(--color-success);
}

.option-item.opt-red:hover .option-circle {
  border-color: var(--color-danger);
}

.option-item.opt-red.selected .option-circle {
  border-color: var(--color-danger);
  background-color: var(--color-danger);
}

.option-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  transform: scale(0);
  transition: var(--transition-smooth);
}

.option-item.selected .option-circle::after {
  transform: scale(1);
}

/* Option Pill Badge */
.option-pill-badge {
  position: absolute;
  right: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
  opacity: 0.8;
}

.option-item.opt-green .option-pill-badge {
  background: rgba(35, 165, 90, 0.12);
  color: #57f287;
  border: 1px solid rgba(35, 165, 90, 0.25);
}

.option-item.opt-red .option-pill-badge {
  background: rgba(242, 63, 67, 0.12);
  color: #ff7376;
  border: 1px solid rgba(242, 63, 67, 0.25);
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.quiz-actions .btn {
  flex: 1;
}

/* --- RESULTS PANEL STYLING --- */
.results-stamp {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px auto;
}

.results-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--color-primary);
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
  object-fit: cover;
}

.stamp-overlay {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--color-primary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid var(--bg-color);
  box-shadow: var(--shadow-lg);
}

.results-username {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 24px;
}

/* Score Showcase Wheel */
.score-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.score-circle-container {
  position: relative;
  width: 120px;
  height: 120px;
}

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

.score-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.score-value {
  fill: none;
  stroke: var(--color-primary);
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-number-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
}

.score-number {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-header);
}

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

.score-label {
  text-align: left;
  max-width: 280px;
}

.rank-badge {
  display: inline-block;
  background: linear-gradient(135deg, #7289da, var(--color-primary));
  color: #ffffff;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.feedback-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Accordion Breakdown Review */
.breakdown-section {
  text-align: left;
  margin-bottom: 36px;
  width: 100%;
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.breakdown-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: var(--transition-smooth);
}

.breakdown-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.breakdown-card.correct {
  border-left: 4px solid var(--color-success);
}

.breakdown-card.incorrect {
  border-left: 4px solid var(--color-danger);
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 10px;
}

.breakdown-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-header);
  line-height: 1.4;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.status-badge.correct {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.status-badge.incorrect {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.answer-comparison {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.answer-line {
  display: flex;
  gap: 6px;
}

.answer-line.user-val {
  color: var(--text-muted);
}

.answer-line.correct-val {
  color: var(--color-success);
  font-weight: 500;
}

.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  max-width: 380px;
  margin: 0 auto;
}

.results-actions .btn {
  flex: 1;
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: rgba(15, 18, 30, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: -1px; /* Stitch to panel border */
}

/* Responsive adjust */
@media (max-width: 640px) {
  .view-panel {
    padding: 24px 16px;
  }
  
  .title-primary {
    font-size: 26px;
  }
  
  .score-showcase {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .score-label {
    text-align: center;
  }
  
  .results-actions {
    flex-direction: column;
  }
  
  .option-pill-badge {
    position: relative;
    right: auto;
    margin-left: auto;
    margin-top: 6px;
    display: inline-block;
  }
  
  .option-item {
    flex-wrap: wrap;
  }
}
