/* =========================================
   UI THEME — Muggs Of Mastery
   For: Assessment Diagnostics, Prep Tools, API-enabled pages
========================================= */
:root {
  --gold: #d4af37;
  --gold-light: #ffe8a8;
  --parchment: #f3ecd8;

  --deep-blue: #0c1a2e;
  --mid-blue: #17314d;
  --ink: #f3ecd8;

  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

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

/* ======================================================
   Base Body for UI Pages
====================================================== */
body {
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold-light);
  background: radial-gradient(circle, #1a2a3a 0%, #0a131f 90%);
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* ======================================================
   Typography
====================================================== */
h1, h2, h3 {
  font-family: 'Cinzel Decorative', serif;
  text-shadow:
    0 0 12px rgba(255,215,100,0.5),
    0 0 24px rgba(200,155,60,0.35);
}

h1 {
  font-size: 2.4rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

/* ======================================================
   Form Elements
====================================================== */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gold);
  font-size: 1.1rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(212,175,55,0.4);
  background: rgba(0,0,0,0.3);
  color: var(--gold-light);
  transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}

textarea {
  width: 100%;
  min-height: 150px;
  padding: 0.75rem 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  border-radius: var(--radius);
  border: 2px solid rgba(212,175,55,0.5);
  background: #ffffff;
  color: #1a1a1a;
  resize: vertical;
  line-height: 1.6;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-item input,
.radio-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

/* Select styling */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23d4af37' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ======================================================
   Buttons
====================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid rgba(212,175,55,0.5);
  background: rgba(10, 35, 60, 0.85);
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: rgba(10, 35, 60, 1);
  transform: translateY(-2px);
}

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

.btn-primary {
  background: linear-gradient(135deg, rgba(180,145,40,0.85), rgba(230,205,120,0.85));
  color: var(--deep-blue);
  border: 2px solid rgba(212,175,55,0.6);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(215,185,95,0.95), rgba(180,145,40,0.95));
}

.btn-success {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--error);
  color: var(--error);
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ======================================================
   Cards & Panels
====================================================== */
.card {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}

.card-body {
  color: var(--gold-light);
  line-height: 1.6;
}

/* ======================================================
   Assessment/Diagnostic Components
====================================================== */
.question-card {
  background: rgba(12, 26, 46, 0.5);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.question-number {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

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

.answer-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.answer-option:hover {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.5);
}

.answer-option.selected {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
}

.answer-option.correct {
  background: rgba(74, 222, 128, 0.15);
  border-color: var(--success);
}

.answer-option.incorrect {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--error);
}

/* ======================================================
   Progress & Score Display
====================================================== */
.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.score-display {
  text-align: center;
  padding: 2rem;
  background: rgba(12, 26, 46, 0.5);
  border: 2px solid var(--gold);
  border-radius: 16px;
}

.score-value {
  font-family: 'Cinzel Decorative', serif;
  font-size: 4rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
}

.score-label {
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-top: 0.5rem;
}

/* ======================================================
   AI Feedback Components
====================================================== */
.feedback-container {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(12, 26, 46, 0.6);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--gold);
  font-family: 'Cinzel Decorative', serif;
}

.feedback-content {
  color: var(--gold-light);
  line-height: 1.7;
  font-size: 1.1rem;
}

.feedback-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold-light);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(212,175,55,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================================================
   Status Messages
====================================================== */
.status-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 600;
}

.status-success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.status-warning {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.status-error {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

.status-info {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold-light);
}

/* ======================================================
   Floating Controls
====================================================== */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--gold-light);
  text-decoration: none;
  z-index: 1000;
  font-family: 'Cormorant Garamond', serif;
}

.save-btn-fixed {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 35, 60, 0.9);
  border: 1px solid rgba(212,175,55,0.6);
  border-radius: var(--radius);
  color: var(--gold-light);
  cursor: pointer;
  z-index: 1000;
}

/* ======================================================
   Unsaved State
====================================================== */
.unsaved {
  border: 2px solid rgba(251, 191, 36, 0.8) !important;
  background: rgba(251, 191, 36, 0.1) !important;
}

/* ======================================================
   Layout Utilities
====================================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

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

.text-left {
  text-align: left;
}

.card-body.text-left,
.card-body.text-left p,
.card-body.text-left ul,
.card-body.text-left li {
  text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ======================================================
   Responsive
====================================================== */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column;
  }

  .card {
    padding: 1rem;
  }

  .score-value {
    font-size: 3rem;
  }
}
