*{box-sizing:border-box;margin:0;padding:0}

body{
    font-family:'Segoe UI',sans-serif;
 /* background:linear-gradient(135deg,#0f172a,#1e3c72); */
 
background:#0b1220;
 
    color:#fff;
}

/* HEADER */
.header{
    padding:15px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#020617;
}

.logo{
    font-weight:bold;
    font-size:18px;
}

.user{
    font-size:14px;
    opacity:.8;
}

/* MAIN */
.container{
    max-width:1100px;
    margin:auto;
    padding:20px;
}

.card{
    background: rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);

    border: 1px solid rgba(37,99,235,0.6);
    box-shadow:
        0 0 0 2px rgba(37,99,235,0.15),
        0 0 20px rgba(37,99,235,0.25);
}
/* GRID */
.grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
}

@media(max-width:700px){
    .grid{grid-template-columns:1fr}
}

/* BUTTON */
.btn{
    padding:12px;
    border:none;
    border-radius:8px;
    font-weight:bold;
    cursor:pointer;
}

.primary{background:#22c55e;color:white;}
.secondary{background:#3b82f6;color:white;}
.warn{background:#f59e0b;color:black;}

/* SUBJECT */
.subject{
    padding:12px;
    border-radius:8px;
    background:#1e293b;
    cursor:pointer;
    transition:.2s;
}
.subject:hover{background:#334155}

/* CHAT */
.chat{
    height:350px;
    overflow-y:auto;
    margin-top:10px;
}

.msg{
    padding:10px;
    border-radius:10px;
    margin-bottom:8px;
    max-width:80%;
}

.bot{background:#1e293b}
.userMsg{background:#2563eb;margin-left:auto}

/* INPUT */
.input-area{
    display:flex;
    margin-top:10px;
}

input{
    flex:1;
    padding:10px;
    border:none;
    border-radius:8px;
}

.send{
    margin-left:8px;
    background:#22c55e;
    color:white;
}

/* PROGRESS */
.progress{
    height:10px;
    background:#1e293b;
    border-radius:10px;
    overflow:hidden;
}

.progress-bar{
    height:100%;
    width:0%;
    background:#22c55e;
}



/* =========================
   MOBILE UI UPGRADE (QUIZGECKO STYLE)
========================= */
@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    /* HEADER */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px;
    }

    .logo {
        font-size: 16px;
    }

    .user {
        font-size: 12px;
    }

    /* CONTAINER */
    .container {
        padding: 12px;
    }

    /* CARD */
    .card {
        padding: 14px;
        border-radius: 12px;
    }

    /* GRID â†’ STACK LIKE QUIZGECKO */
    .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
}

    /* SUBJECT BUTTONS */
    .subject {
        padding: 14px;
        font-size: 14px;
        text-align: left;
        border-radius: 10px;
    }

    /* CHAT AREA */
    .chat {
        height: 45vh;
        padding: 10px;
    }

    

    /* INPUT AREA FIX */
    .input-area {
        flex-direction: row;
        gap: 8px;
    }

    input {
        font-size: 14px;
        padding: 12px;
    }

    .send {
        padding: 12px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* PROGRESS BAR */
    .progress {
        height: 8px;
    }

    /* BUTTONS */
    .btn {
        width: 100%;
        padding: 14px;
    }

    /* SUBJECT SECTION TITLE */
    h2, h3 {
        font-size: 16px;
    }
}


.header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
}

/* LOGO LEFT */
.logo {
    font-size: 16px;
    font-weight: 700;
}

/* USER RIGHT BADGE */
.user {
    margin-left: auto;
    font-size: 12px;
    background: rgba(255,255,255,0.08);
    padding: 6px 10px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
}


* {
    transition: all 0.2s ease-in-out;
}

.btn {
    transform: scale(1);
}

.btn:active {
    transform: scale(0.96);
}



.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}



/* =========================
   MODAL BACKDROP
========================= */
.ai-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  z-index: 999999;
  justify-content: center;
  align-items: center;
}

/* =========================
   CHAT CONTAINER
========================= */
.ai-container {
  background: #0f172a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================
   HEADER
========================= */
.ai-header {
  padding: 12px;
  background: #1e293b;
  color: white;
  font-weight: bold;
  text-align: center;
}

/* =========================
   ONBOARDING
========================= */
.ai-onboarding {
  padding: 10px;
  color: white;
}

/* =========================
   CHAT AREA
========================= */
.ai-chat {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #020617;
}

/* =========================
   INPUT AREA
========================= */
.ai-input-area {
  display: flex;
  gap: 6px;
  padding: 10px;
  background: #1e293b;
}

.ai-input-area input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  outline: none;
}

.ai-input-area button {
  padding: 10px 14px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* =========================
   CLOSE BUTTON
========================= */
.ai-close {
  background: red;
  color: white;
  padding: 10px;
  border: none;
  cursor: pointer;
}

/* =========================
   MOBILE (FULL SCREEN)
========================= */
@media (max-width: 768px) {

  .ai-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

}

/* =========================
   DESKTOP (WHATSAPP STYLE)
========================= */
@media (min-width: 769px) {

  .ai-container {
    width: 90%;
    max-width: 900px;  
    height: 90vh;
  }

}




.ai-input-area button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* send button */
#sendBtn {
  background: #3b82f6;
  color: white;
}

/* mic button */
#micBtn {
  background: #10b981;
  color: white;
}



.ai-upload-box {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.ai-upload-box input {
    flex: 1;
    font-size: 13px;
}

.upload-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}


.ai-input-wrapper {
    padding: 10px;
}

/* MAIN BOX */
.ai-input-box {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #0f172a;   /* same as chat */
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 10px 12px;
}

/* INPUT FIELD */
.ai-input-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 15px;

    /* IMPORTANT FIX */
    resize: none;
    min-height: 24px;
    max-height: 80px;
    overflow-y: auto;
    line-height: 1.4;

    padding-bottom: 28px; /* makes space for icons */
}

/* LEFT ICON GROUP (BOTTOM LEFT INSIDE BOX) */
.left-icons {
    position: absolute;
    bottom: 6px;
    left: 8px;
    display: flex;
    gap: 15px;
}

/* SMALL WHATSAPP STYLE ICONS */
.icon-btn.small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* SEND ICON (BOTTOM RIGHT) */
.send-btn {
    position: absolute;
    bottom: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #3b82f6;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

/* INPUT TEXT STAYS TOP-LEFT ALWAYS */
.ai-input-box input::placeholder {
    color: rgba(255,255,255,0.5);
}


.ai-input-box textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 15px;

    resize: none;

    /* ✅ TEXT BEHAVIOR */
    line-height: 1.5;
    padding-top: 8px;     /* top breathing space */
    padding-bottom: 30px; /* space above icons */

    /* ✅ KEY FIX: LIMIT HEIGHT */
    /* ~2 lines visible */
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}


.ai-input-box {
    position: relative;
    padding-bottom: 60px; /* 🔥 creates safe zone for icons */
}




.exam-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.exam-container {
    width: 95%;
    max-width: 500px;
    height: 90vh;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    color: white;
}

.exam-header {
    padding: 12px;
    background: #111827;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.exam-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.question-box {
    font-size: 18px;
    margin-bottom: 15px;
}

.options-box button {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #1f2937;
    color: white;
    text-align: left;
}

.exam-footer {
    padding: 10px;
    background: #111827;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}



.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top: 4px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

.exam-select {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border-radius: 8px;
    border: none;
    background: #1f2937;
    color: white;
    font-size: 14px;
}


.options-box button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #1f2937;
    color: white;
    text-align: left;
    border: none;
    transition: all 0.2s ease;
}

/* ✅ FORCE SELECTED STYLE */
.options-box button.selected {
    background: #22c55e !important;
    color: white !important;
    border: 2px solid #16a34a !important;
    transform: scale(1.02);
}


.options-box button:hover {
    background: #374151;
}



/* ================= BOTTOM NAV ================= */

.bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    height:70px;
    background:#111827;
    display:flex;
    justify-content:space-around;
    align-items:center;
    border-top:1px solid rgba(255,255,255,0.08);
    z-index:99999;
}

.nav-item{
    background:none;
    border:none;
    color:#9ca3af;
    display:flex;
    flex-direction:column;
    align-items:center;
    font-size:13px;
    cursor:pointer;
    transition:0.3s;
}

.nav-item span{
    font-size:11px;
    margin-top:3px;
}

.nav-item.active,
.nav-item:hover{
    color:#3b82f6;
    transform:translateY(-2px);
}

.container{
    padding-bottom:100px;
}


html, body {
    scroll-behavior: smooth;
}


/*.card{
    background: rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);

    border: 1px solid rgba(37,99,235,0.6);
    box-shadow:
        0 0 0 2px rgba(37,99,235,0.15),
        0 0 20px rgba(37,99,235,0.25);
}*/


.card{
    margin-bottom:16px;
}


.container{
    display:flex;
    flex-direction:column;
    gap:12px;
}




/* =======================
   EXAM RESULT MODAL WRAPPER
======================= */
.exam-result-wrapper {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 99999;
}

/* CARD */
.exam-result-card {
    width: 90%;
    max-width: 520px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    color: white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* HEADER */
.exam-result-title {
    font-size: 22px;
    margin-bottom: 5px;
}

.exam-result-sub {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* SCORE CIRCLE */
.exam-result-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    background: conic-gradient(#27ae60 0% 0%, #2c3e50 0% 100%);
}

/* STATS */
.exam-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.exam-result-box {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
}

/* MESSAGE */
.exam-result-message {
    margin-top: 15px;
    font-size: 14px;
}

/* BUTTONS */
.exam-result-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.exam-result-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.exam-result-home { background: #3498db; color: white; }
.exam-result-retry { background: #27ae60; color: white; }
.exam-result-review { background: #8e44ad; color: white; }



.modern-select{
    width:100%;
    padding:12px;
    border-radius:10px;
    border:none;
    background:#1f2937;
    color:white;
    font-size:14px;
    outline:none;
    margin-top:10px;
}


.card{
    background: rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);

    border: 1px solid rgba(37,99,235,0.6);
    box-shadow:
        0 0 0 2px rgba(37,99,235,0.15),
        0 0 20px rgba(37,99,235,0.25);
}


@media (max-width: 600px){
    .card{
        padding: 15px;
        border-radius: 12px;

        border: 1px solid rgba(37,99,235,0.7);
        box-shadow:
            0 0 0 2px rgba(37,99,235,0.2),
            0 0 15px rgba(37,99,235,0.3);
    }
} 



