/* =========================
   STUDYAGORA AI – QUIZ UI
   Desktop • Mobile • Tablet
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #eaeaea;

    background:
        radial-gradient(circle at center, rgba(140,60,255,0.25), transparent 55%),
        linear-gradient(180deg, #050008 0%, #0b0014 40%, #000000 100%);
}

/* =========================
   HEADER
========================= */

.ai-header {
    text-align: center;
    padding: 32px 12px 20px;
}

.ai-logo {
    width: 72px;
    margin-bottom: 10px;
}

.brand {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg,#7B3FE4,#D63384,#FF6A00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 14px;
    margin-top: 4px;
    color: #bfc7ff;
    opacity: 0.9;
}

/* =========================
   MAIN CARD
========================= */

.card {
    max-width: 560px;
    margin: 0 auto 30px;
    padding: 24px;

    background: rgba(15, 8, 25, 0.9);
    backdrop-filter: blur(14px);

    border-radius: 22px;
    border: 1px solid rgba(140, 80, 255, 0.25);

    box-shadow:
        0 0 40px rgba(123, 63, 228, 0.25),
        inset 0 0 20px rgba(214, 51, 132, 0.08);
}

/* =========================
   SECTION LABELS
========================= */

.section-title {
    margin-top: 18px;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #a9b1ff;
}

/* =========================
   FORM ELEMENTS
========================= */

select,
input {
    width: 100%;
    padding: 14px;
    background: #0c0714;
    border: 1px solid rgba(140,80,255,0.3);
    border-radius: 14px;
    color: #ffffff;
    font-size: 16px; /* iOS zoom fix */
    outline: none;
}

select:focus,
input:focus {
    border-color: #D63384;
    box-shadow: 0 0 0 2px rgba(214,51,132,0.35);
}

/* =========================
   BUTTONS
========================= */

button {
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 18px;

    color: #ffffff;
    background: linear-gradient(135deg,#7B3FE4,#D63384,#FF6A00);

    box-shadow:
        0 0 25px rgba(214,51,132,0.55),
        0 0 45px rgba(255,106,0,0.25);

    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   LOADING
========================= */

#loading {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #cfc9ff;
}

/* =========================
   OUTPUT / QUIZ AREA
========================= */

.output-box {
    margin-top: 22px;
    padding: 20px;
    background: rgba(8,4,14,0.95);
    border-radius: 18px;
    border: 1px solid rgba(140,80,255,0.25);

    font-size: 16px;
    line-height: 1.7;
}

/* =========================
   MCQ BLOCK
========================= */

.mcq {
    background: rgba(255,255,255,0.04);
    padding: 18px;
    border-radius: 16px;
}

.question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* =========================
   OPTION CARDS
========================= */

.option-card {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 14px;

    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(140,80,255,0.25);

    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.option-card:hover {
    border-color: #D63384;
}

.option-card.selected {
    background: linear-gradient(135deg,#7B3FE4,#D63384);
    box-shadow: 0 0 16px rgba(214,51,132,0.6);
}

.option-card.correct {
    background: rgba(44,255,143,0.2);
    border-color: #2cff8f;
    box-shadow: 0 0 14px rgba(44,255,143,0.6);
}

.option-card.wrong {
    background: rgba(255,77,109,0.2);
    border-color: #ff4d6d;
    box-shadow: 0 0 14px rgba(255,77,109,0.6);
}

.option-card.locked {
    cursor: not-allowed;
}

/* =========================
   EXPLANATION
========================= */

.explanation {
    margin-top: 14px;
    font-size: 15px;
    color: #cfd0ff;
    line-height: 1.6;
}

/* =========================
   PALETTE
========================= */

.palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.palette-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(140,80,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.palette-btn.current {
    background: linear-gradient(135deg,#7B3FE4,#D63384);
}

.palette-btn.correct {
    background: rgba(44,255,143,0.3);
    border-color: #2cff8f;
}

.palette-btn.wrong {
    background: rgba(255,77,109,0.3);
    border-color: #ff4d6d;
}

/* =========================
   NAVIGATION
========================= */

.nav-bar {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.nav-bar button {
    flex: 1;
}

/* =========================
   RESULT BOX (UPSC STYLE)
========================= */

.result-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: 18px;
    text-align: center;

    background: rgba(20,12,32,0.9);
    border: 1px solid rgba(140,80,255,0.4);
}

.result-score {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(135deg,#7B3FE4,#D63384,#FF6A00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-text {
    margin-top: 6px;
    font-size: 15px;
    color: #cfd0ff;
}

/* =========================
   FOOTER
========================= */

.ai-footer {
    margin-top: 40px;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #8a8fb3;
}

/* =========================
   MOBILE & TABLET
========================= */

@media (max-width: 768px) {

    .card {
        max-width: 94vw;
        padding: 20px;
    }

    .question {
        font-size: 19px;
    }

    .option-card {
        font-size: 16px;
        padding: 18px;
    }

    button {
        font-size: 16px;
        padding: 18px;
    }
}
/* =========================
   STUDY PLANNER OUTPUT STYLING
   (Markdown → UI Match)
========================= */

.output-box h1,
.output-box h2 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 22px;
    margin-bottom: 10px;
    color: #ff7adf;
}

.output-box h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    color: #ffd1f2;
}

.output-box p {
    margin-bottom: 12px;
    color: #eaeaea;
}

.output-box ul {
    padding-left: 22px;
    margin-bottom: 14px;
}

.output-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #eaeaea;
}

/* Timetable / key labels */
.output-box strong {
    color: #ffffff;
    font-weight: 600;
}

/* Divider feel between sections */
.output-box hr {
    border: none;
    height: 1px;
    margin: 20px 0;
    background: linear-gradient(
        to right,
        transparent,
        rgba(214,51,132,0.6),
        transparent
    );
}

/* Disclaimer / note styling */
.output-box blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid #D63384;
    background: rgba(214,51,132,0.08);
    color: #f0e6ff;
    font-size: 15px;
}
/* ======================================
   MOBILE FIX – ANSWER WRITING EVALUATOR
   ====================================== */

@media (max-width: 480px) {

  body {
    padding: 0;
    margin: 0;
  }

  /* Header tightening */
  .ai-header {
    padding: 18px 12px 10px;
    text-align: center;
  }

  .ai-header .brand {
    font-size: 20px;
    margin-top: 6px;
  }

  .ai-header .brand-sub {
    font-size: 13px;
    opacity: 0.85;
  }

  /* Main card */
  .card {
    width: 94%;
    max-width: 94%;
    margin: 12px auto 20px;
    padding: 18px 14px;
    border-radius: 18px;
  }

  /* Inputs & selects */
  select,
  input,
  textarea {
    font-size: 15px;
    padding: 12px;
    border-radius: 12px;
  }

  textarea {
    min-height: 150px;
  }

  /* Button */
  #evalBtn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 14px;
    margin-top: 14px;
  }

  /* Loading text */
  #loading {
    margin-top: 12px;
    font-size: 14px;
    opacity: 0.8;
  }

  /* Output box */
  .output-box {
    margin-top: 18px;
    font-size: 14.5px;
    line-height: 1.55;
  }

  .output-box ul {
    padding-left: 18px;
  }

  .output-box h3 {
    font-size: 17px;
    margin-bottom: 10px;
  }

  /* Footer */
  .ai-footer {
    margin-top: 20px;
    padding-bottom: 16px;
    font-size: 12px;
    opacity: 0.6;
  }
}
