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

/* ===== ROOT COLORS ===== */
:root {
  --soft-blue: #6ba3d8;
  --sage: #a8c99f;
  --lavender: #b8a5d9;
  --warm-grey: #f5f5f5;
  --text-dark: #2c3e50;
  --text-muted: #5a6c7d;
  --white: #ffffff;
  --radius: 12px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ===== BODY ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #e8f0f7 100%);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.navbar a {
  margin: 0 16px;
  text-decoration: none;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
  font-size: 15px;
}

.navbar a:hover {
  color: var(--soft-blue);
}

.navbar a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--soft-blue);
  border-radius: 2px;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 900px;
  margin: auto;
  padding: 28px 18px;
}

.content {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease;
}

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

/* ===== HEADINGS ===== */
.title {
  text-align: center;
  font-size: 42px;
  color: var(--soft-blue);
  font-weight: 600;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  margin-top: 10px;
  color: var(--text-muted);
}

.page-title {
  text-align: center;
  color: var(--soft-blue);
  margin-bottom: 24px;
  font-size: 32px;
  font-weight: 600;
}

/* ===== TEXT ===== */
.intro-text {
  text-align: center;
  margin: 22px auto;
  max-width: 520px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.main-button {
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  background: var(--soft-blue);
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(107, 163, 216, 0.3);
}

.main-button:hover {
  transform: translateY(-2px);
  background: #5a92c7;
  box-shadow: 0 4px 12px rgba(107, 163, 216, 0.4);
}

.main-button:active {
  transform: translateY(0);
}

.button-group {
  margin-top: 28px;
  text-align: center;
}

.button-group a {
  margin: 0 8px;
}

/* ===== INPUTS ===== */
.answer-input {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #e0e7ed;
  font-size: 16px;
  width: 100%;
  max-width: 400px;
  transition: var(--transition);
}

.answer-input:focus {
  outline: none;
  border-color: var(--soft-blue);
  box-shadow: 0 0 0 3px rgba(107, 163, 216, 0.1);
}

/* ===== STATS & BOXES ===== */
.stat-box {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border-left: 3px solid;
}

.stat-green { 
  background: #f0f9f4; 
  border-left-color: #48bb78;
}

.stat-blue { 
  background: #eff6ff; 
  border-left-color: var(--soft-blue);
}

.stat-yellow { 
  background: #fffbeb; 
  border-left-color: #f6ad55;
}

.badge {
  display: inline-block;
  background: #fce7f3;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  margin: 6px 6px 0 0;
  font-weight: 500;
  color: #831843;
}

/* ===== SOLVE PAGE ===== */
#problem-text {
  font-size: 18px;
  line-height: 1.6;
}

.hint-box {
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  border-left: 3px solid #f6ad55;
}

.correct-box {
  background: #f0f9f4;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 16px;
  border-left: 3px solid #48bb78;
  color: #22543d;
}

.incorrect-box {
  background: #fff5f5;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 16px;
  border-left: 3px solid #e53e3e;
  color: #742a2a;
}

/* ===== AI OVERVIEW ===== */
.suggestion-box {
  background: #f0f7ff;
  padding: 20px;
  border-radius: var(--radius);
  margin-top: 24px;
  border-left: 3px solid var(--soft-blue);
}

#ai-feedback-container {
  animation: fadeUp 0.5s ease;
}

#ai-feedback-container .suggestion-box {
  background: #f8faff;
  border-left: 4px solid var(--soft-blue);
}

#loading-indicator {
  animation: pulse 1.5s ease-in-out infinite;
  padding: 20px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.main-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#error-message {
  background: #fff5f5;
  border-left: 4px solid #e53e3e;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 20px;
  color: #742a2a;
}

#error-message p {
  margin: 0;
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  .title { font-size: 32px; }
  .page-title { font-size: 26px; }
  .content { padding: 24px; }
  .navbar a { margin: 0 10px; font-size: 14px; }
  .main-button { padding: 12px 24px; font-size: 15px; }
  
  /* Grid to single column on mobile */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}
