
/* ─── Color Variables ───────────────────────────────────────── */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --card-bg:   #f5f5f5;
  --link-color:#0066cc;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Dark mode overrides */
body.dark {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --card-bg:   #1e1e1e;
  --link-color:#3399ff;
}

.card {
  background-color: var(--card-bg);
}
a {
  color: var(--link-color);
}
/* ───────────────────────────────────────────────────────────── */
:root {
    --background-dark: #343541;
    --input-dark: #40414f;
    --text-light: #ffffff;
    --border-dark: #5b5b5d;
    --send-button: #4facfe;
    --zuno-message-bg: #40414f;
    --user-message-bg: #50515a;
}

/* Universal Settings */
body {
    background: linear-gradient(to bottom, #343541, #40414f, #343541);
    color: var(--text-light);
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 1s ease-in;
}

body.loaded {
    opacity: 1;
}

/* Avatar */
#avatarWrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 9999;
}
#avatarWrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat Box */
#chatBox {
    width: 100%;
    max-width: 800px;
    height: 75vh;
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 20px;
    margin-top: 80px;
    overflow-y: auto;
    background: var(--background-dark);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 1rem;
    word-break: break-word;
    animation: messageAppear 0.4s ease forwards;
    transform: scale(0.95);
    opacity: 0;
    margin-bottom: 12px;
}

@keyframes messageAppear {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.zuno {
    align-self: flex-start;
    background: var(--zuno-message-bg);
}

.user {
    align-self: flex-end;
    background: var(--user-message-bg);
}

/* Input Section */
#inputWrapper {
    width: 100%;
    max-width: 800px;
    margin: 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

#inputContainer {
    display: flex;
    align-items: center;
    background: var(--input-dark);
    border: 1px solid var(--border-dark);
    border-radius: 25px;
    padding: 8px 12px;
}

#inputContainer input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px;
    font-size: 1rem;
    background: transparent;
    color: var(--text-light);
}

#inputContainer button {
    background: var(--send-button);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: 0.3s;
}

#inputContainer button:hover {
    background-color: #00f2fe;
}

/* Settings Section */
#settings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

#settings button, #settings select {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 220px;
    padding: 8px;
    font-size: 1rem;
    border-radius: 8px;
    background-color: var(--input-dark);
    color: var(--text-light);
    border: 1px solid var(--border-dark);
    white-space: nowrap;
    cursor: pointer;
}

#responseMode {
    padding: 8px 16px;
    background-color: var(--input-dark);
    color: var(--text-light);
    border: 1px solid var(--border-dark);
}

/* Typing Dots Animation */
.typingDots::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background: #ffffff;
    animation: dotsLoading 1.2s infinite steps(3);
    margin-left: 6px;
    vertical-align: middle;
}

@keyframes dotsLoading {
    0% { width: 0; }
    50% { width: 0.5em; }
    100% { width: 1em; }
}

/* Mic Listening Animation */
@keyframes micPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.mic-listening {
    color: red;
    animation: micPulse 1s infinite;
}

/* ─── iOS-style Light Theme Overrides ───────────────────────── */

/* overall page */
body.light-mode {
  background: #f2f2f7;       /* very light grey */
  color: #000;               /* dark text */
}

/* chat container */
body.light-mode #chatBox {
  background: #ffffff;       /* pure white */
  border: 1px solid #d1d1d6; /* subtle iOS-grey border */
}

/* assistant bubble (left) */
body.light-mode .message.zuno {
  background: #e5e5ea;       /* light grey bubble */
  color: #000;               /* black text */
  border-radius: 20px;       /* round corners */
}

/* user bubble (right) */
body.light-mode .message.user {
  background: #007aff;       /* iOS blue bubble */
  color: #fff;               /* white text */
  border-radius: 20px;       /* round corners */
}

/* input bar wrapper */
body.light-mode #inputContainer {
  background: #ffffff;       /* white bar */
  border: 1px solid #d1d1d6; /* grey border */
  border-radius: 22px;       /* pill shape */
}

/* input field text */
body.light-mode #inputContainer input[type="text"] {
  background: transparent;
  color: #000;               /* black typing text */
}

/* send button */
body.light-mode #inputContainer button {
  background: #007aff;       /* blue send button */
  color: #fff;
  border-radius: 50%;
}

/* mic & icons */
body.light-mode .icon-left,
body.light-mode .icon-right {
  color: #007aff;
}

/* placeholder color */
body.light-mode #userInput::placeholder {
  color: #8e8e93;            /* iOS placeholder grey */
}

/* ensure other buttons/selects look right */
body.light-mode button,
body.light-mode select {
  background-color: #ffffff;
  color: #000;
  border: 1px solid #d1d1d6;
}

/* ─────────────────────────────────────────────────────────────── */
/* ─── iOS-style Light Theme: Dashboard & Controls ───────────────── */

/* Dashboard card background & text */
body.light-mode #studentDashboard {
  background: #ffffff;              /* white card */
  border: 1px solid #d1d1d6;       /* subtle iOS grey border */
  color: #000000;                  /* dark text */
  box-shadow: none;                /* remove dark-mode shadow */
}

/* Dashboard headings */
body.light-mode #studentDashboard h2 {
  color: #000000;
}

/* Dashboard labels (Current Subject, Progress) */
body.light-mode #studentDashboard p {
  color: #1c1c1e;                  /* very dark grey for contrast */
}

/* Dashboard selects */
body.light-mode #studentDashboard select {
  background: #ffffff;             /* match card */
  color: #000000;                  /* black text */
  border: 1px solid #d1d1d6;  
  appearance: none;                /* remove default arrow styling */
  padding: 8px 12px;
  border-radius: 8px;
}

/* Dashboard buttons */
body.light-mode #studentDashboard button {
  background: #007aff;             /* iOS-blue */
  color: #ffffff;                  /* white text */
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 8px;
  font-weight: 500;
  box-shadow: none;
}

/* Dashboard “Take Test” button special color */
body.light-mode #analyzerButton {
  background: #34c759;             /* iOS green accent */
}

/* On‐hover tweak */
body.light-mode #studentDashboard button:hover {
  opacity: 0.9;
}

/* Ensure other global buttons in light‐mode stay white/blue */
body.light-mode button:not(#analyzerButton):not(#themeToggle),
body.light-mode select {
  background: #ffffff;
  color: #007aff;
  border: 1px solid #d1d1d6;
}

/* Badge */
#learningBadge {
    display: inline-block;
    padding: 8px 20px;
    margin: 10px auto;
    font-size: 1rem;
    font-weight: bold;
    background: linear-gradient(to right, #4CAF50, #81C784);
    color: white;
    border-radius: 50px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: glowBadge 2s infinite alternate;
}

@keyframes glowBadge {
    0% { box-shadow: 0 0 5px #4CAF50; }
    100% { box-shadow: 0 0 20px #81C784; }
}
.typing-dots {
    display: inline-flex;
    margin-left: 10px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: white;
    border-radius: 50%;
    animation: typingAnimation 1.2s infinite;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0% { transform: scale(0.8); opacity: 0.3; }
    20% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.3; }
}
.typing-dots .dot {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: radial-gradient(circle, white 40%, #00f0ff 90%);
    border-radius: 50%;
    animation: typingGlow 1.2s infinite;
    box-shadow: 0 0 5px #00f0ff, 0 0 10px #00f0ff;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingGlow {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
        box-shadow: 0 0 3px #00f0ff;
    }
    20% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
        box-shadow: 0 0 3px #00f0ff;
    }
}
.card {
  animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card {
  background: #1e1e2f;
  color: #fff;
  padding: 20px;
  margin: 20px auto;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}
/* Uniform Buttons & Selects */
button, select {
  padding: 10px 16px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  margin: 6px 6px 0 0;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}
button:hover, select:hover {
  background-color: #444;
}
.message {
  padding: 14px 20px;
  line-height: 1.6;
  font-size: 1rem;
}
/* 🌐 Step 4: Mobile UI Tweak + Card Hover Polish */
@media (max-width: 600px) {
  #settings {
    flex-direction: column;
    align-items: stretch;
  }

  #settings button,
  #settings select,
  #subjectSelect {
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
  }

  .card {
    padding: 16px;
    margin: 10px;
  }

  #chatBox {
    height: 65vh;
    padding: 15px;
  }

  .message {
    font-size: 0.95rem;
  }
}

/* ✨ Card Hover Animation */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 255, 255, 0.25);
}
/* Controls bar styling */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  max-width: 800px;
}

#controls select,
#controls button,
#controls #progressStatus {
  padding: 8px 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-dark);
  background: var(--input-dark);
  color: var(--text-light);
  min-width: 120px;
  text-align: center;
}

#controls #progressStatus {
  background: transparent;
  border: none;
}