/* styles.css (RESTORED SCI-FI THEME) */

:root {
  /* BASE THEME (DARK NAVY) */
  --ev-bg: #050b1a;
  --ev-bg-alt: #0b152a;
  --ev-card: #0f1c35;

  --ev-text: #f4f7ff;
  --ev-muted: #a9b4d8;

  /* MAIN ACCENT (USER REQUESTED CYAN) */
  --ev-accent: #18eddb;
  --ev-accent-alt: #2dd4ff;

  /* MODULE COLORS (SCI-FI PALETTE) */
  --color-dojo: #d946ef;   /* Neon Purple */
  --color-gym: #e8a7ab;    /* Soft Pink (User Requested) */
  --color-lab: #3b82f6;    /* Neon Blue (Was Vault) */
  --color-training: #10b981; /* Neon Green (Was Drills) */
  --color-roster: #fbbf24;   /* Yellow Gold (Duty Roster) */
  --color-chat: #18eddb;     /* Cyan (Secure Line) */

  --ev-border-soft: rgba(255, 255, 255, 0.06);
  --ev-radius-lg: 18px;
  --ev-radius-md: 12px;
  --ev-radius-pill: 999px;
  --ev-shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);

  --ev-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* SCI-FI SHAPES */
  --clip-tech-btn: polygon(
    12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px
  );
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

.ev-body {
  background: radial-gradient(circle at top, #071531 0, #020712 55%);
  color: var(--ev-text);
  font-family: var(--ev-font);
  min-height: 100vh;
  /* overflow-x: hidden; Removed to allow scrolling if needed */
}

.ev-container {
  width: 100%;
  max-width: 1200px; /* INCREASED PROPORTION */
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== HEADER / NAV ========== */
.ev-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(2, 7, 18, 0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ev-nav {
  display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0;
}
.ev-logo { display: flex; align-items: center; gap: 0.8rem; }
.ev-logo-img { height: 40px; width: auto; object-fit: contain; }
.ev-logo-text { font-weight: 700; font-size: 1.1rem; color: var(--ev-accent); letter-spacing: 1px; text-transform: uppercase; }

.ev-nav-links {
  display: flex; align-items: center; gap: 0.75rem;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ev-font); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0.7rem 1.5rem;
  border: none; cursor: pointer; text-decoration: none;
  clip-path: var(--clip-tech-btn); /* SCI-FI SHAPE */
  transition: all 0.2s ease;
  position: relative;
}

.btn-primary {
  background: linear-gradient(120deg, var(--ev-accent), var(--ev-accent-alt));
  color: #021014;
  box-shadow: 0 0 15px rgba(24, 237, 219, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(24, 237, 219, 0.6);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ev-accent);
  color: var(--ev-accent);
}
.btn-secondary:hover {
  background: rgba(24, 237, 219, 0.1);
  box-shadow: 0 0 15px rgba(24, 237, 219, 0.3);
}

.btn-ghost {
  background: transparent; color: var(--ev-muted);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { color: #fff; border-color: #fff; }

.btn-small { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

/* ZOOM & EQUIP SPECIFIC */
.btn-tech-cool {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.btn-tech-cool:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.8);
}

/* ========== LAYOUT GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ========== CARDS ========== */
.card, .dashboard-card {
  background: var(--ev-card);
  border: 1px solid var(--ev-border-soft);
  border-radius: var(--ev-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--ev-shadow-soft);
  position: relative;
  overflow: hidden;
}

.card-header {
  font-size: 1.1rem;
  color: var(--ev-accent);
  border-bottom: 1px solid var(--ev-border-soft);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== MODULES (SCI-FI COLORS) ========== */
/* WRITING GYM */
.card-gym {
  border: 1px solid var(--color-gym);
  background: linear-gradient(135deg, rgba(232, 167, 171, 0.05), rgba(11, 21, 42, 0.9));
}
.card-gym .card-header, .card-gym h3 { color: var(--color-gym); }
.card-gym:hover { box-shadow: 0 0 20px rgba(232, 167, 171, 0.2); }

/* ORAL DOJO */
.card-dojo {
  border: 1px solid var(--color-dojo);
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.05), rgba(11, 21, 42, 0.9));
}
.card-dojo .card-header, .card-dojo h3 { color: var(--color-dojo); }
.card-dojo:hover { box-shadow: 0 0 20px rgba(217, 70, 239, 0.2); }

/* THE LAB (Ex-VAULT) */
.card-lab {
  border: 1px solid var(--color-lab);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(11, 21, 42, 0.9));
}
.card-lab .card-header, .card-lab h3 { color: var(--color-lab); }
.card-lab:hover { box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }

/* SELF TRAINING */
.card-training {
  border: 1px solid var(--color-training);
}
.card-training .card-header { color: var(--color-training); }

/* SECURE LINE (CHAT) */
.card-chat {
  border: 1px solid var(--color-chat);
  background: linear-gradient(135deg, rgba(24, 237, 219, 0.05), rgba(11, 21, 42, 0.9));
}
.card-chat .card-header, .card-chat h3 { color: var(--color-chat); }
.card-chat:hover { box-shadow: 0 0 20px rgba(24, 237, 219, 0.2); }

/* DUTY ROSTER */
.card-roster {
  border: 1px solid var(--color-roster);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(11, 21, 42, 0.9));
}
.card-roster .card-header, .card-roster h3 { color: var(--color-roster); }
.card-roster:hover { box-shadow: 0 0 20px rgba(251, 191, 36, 0.2); }


/* ========== NETFLIX STYLE SCROLL UTILS ========== */
.netflix-scroll-x {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* scrollbar-width: none; Firefox - RESTORED */
}
/* .netflix-scroll-x::-webkit-scrollbar { display: none; } - RESTORED */

.netflix-scroll-y {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 0.8rem;
  /* scrollbar-width: none; Firefox - RESTORED */
  -webkit-overflow-scrolling: touch;
}
/* .netflix-scroll-y::-webkit-scrollbar { display: none; } - RESTORED */


/* ========== GEAR SCROLLER (NETFLIX STYLE) ========== */
.shop-grid {
  /* Inherits netflix-scroll-x via class or duplicated here */
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.8rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  /* scrollbar-width: none; - RESTORED */
}
/* .shop-grid::-webkit-scrollbar { display: none; } - RESTORED */

.shop-item {
  min-width: 130px;
  scroll-snap-align: start;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  transition: transform 0.2s;
  cursor: pointer;
}
.shop-item:hover { transform: translateY(-3px); border-color: var(--ev-accent); }
.shop-item img {
  width: 70px; height: 70px; border-radius: 12px; margin-bottom: 0.5rem;
  object-fit: cover; border: 2px solid transparent;
}
.shop-item.owned img { border-color: #f59e0b; }
.shop-price { font-weight: 800; color: #f59e0b; font-size: 0.9rem; display: block; }
.shop-name { font-size: 0.75rem; color: var(--ev-muted); font-weight: 700; text-transform: uppercase; }

/* ========== NEW BRIEFINGS SECTION (VERTICAL NETFLIX) ========== */
.briefings-full-section {
    background: var(--ev-card);
    border: 1px solid var(--ev-border-soft);
    border-radius: var(--ev-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    /* User requested "Length from personal info to dojo" which roughly means a taller fixed height */
    height: 350px;
    display: flex;
    flex-direction: column;
}

.briefings-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 0.5rem;
    /* scrollbar-width: none; - RESTORED */
}
/* .briefings-list::-webkit-scrollbar { display: none; } - RESTORED */

.briefing-item {
    background: rgba(15, 23, 42, 0.4);
    border-left: 3px solid var(--ev-muted);
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.briefing-item:hover {
    background: rgba(15, 23, 42, 0.8);
    border-left-color: var(--ev-accent);
}
.briefing-item.new-item {
    border-left-color: #ef4444; /* Red for new */
}
.briefing-header {
    display: flex; justify-content: space-between; align-items: center;
}
.briefing-title {
    font-weight: 700; color: var(--ev-text); font-size: 1rem;
}
.briefing-date {
    font-size: 0.75rem; color: var(--ev-muted);
}
.briefing-body {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--ev-muted);
    line-height: 1.5;
    display: none; /* Hidden by default */
}
.briefing-item.expanded .briefing-body {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ========== MISSION OBJECTIVES (HORIZONTAL SCROLL) ========== */
#student-homework-list {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  /* scrollbar-width: none; - RESTORED */
}
/* #student-homework-list::-webkit-scrollbar {
  display: none;
} - RESTORED */

.homework-card {
  min-width: 260px;
  max-width: 300px;
  flex-shrink: 0;
  scroll-snap-align: start;
  border-left: 3px solid var(--ev-accent-alt);
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.homework-card:hover {
  box-shadow: 0 0 15px var(--ev-accent);
  border-color: var(--ev-accent);
}
.homework-card h4 {
  color: var(--ev-accent);
}

/* ========== CHAT (EXPANDABLE + NEON RED) ========== */
.chat-window {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ev-border-soft);
  height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* Expanded State */
.card-chat.expanded {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(5, 11, 26, 0.98);
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.card-chat.expanded .chat-window {
  flex: 1;
  height: auto;
}

/* Notification Neon Box */
.neon-red-box {
  border: 2px solid #ff0000;
  box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 10px #ff0000, inset 0 0 5px #ff0000; }
  50% { box-shadow: 0 0 20px #ff0000, inset 0 0 15px #ff0000; }
  100% { box-shadow: 0 0 10px #ff0000, inset 0 0 5px #ff0000; }
}

.chat-row {
  display: flex;
  width: 100%;
  margin-bottom: 0.5rem;
}
.chat-row-left {
  justify-content: flex-start;
}
.chat-row-right {
  justify-content: flex-end;
}

.chat-bubble-me {
  background: var(--color-training); /* Greenish for WhatsApp feel */
  color: #fff;
  border-radius: 12px 12px 0 12px;
  padding: 0.5rem 1rem;
  max-width: 80%;
  position: relative;
}
.chat-bubble-other {
  background: #1e293b;
  color: #fff;
  border-radius: 12px 12px 12px 0;
  padding: 0.5rem 1rem;
  max-width: 80%;
  position: relative;
}

.chat-bubble-me img, .chat-bubble-other img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* ========== AI HELPER (RESTORED) ========== */
.ai-fab {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 60px; height: 60px;
  background: linear-gradient(135deg, #4f46e5, #818cf8);
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; cursor: pointer;
  z-index: 20002;
  transition: transform 0.2s ease;
  border: 2px solid rgba(255,255,255,0.2);
  overflow: visible;
}
.ai-fab:hover { transform: scale(1.1); }

.ai-window {
  position: fixed;
  bottom: 170px; right: 20px;
  width: 350px; height: 500px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 20003;
}
.ai-window.hidden { display: none !important; }

.ai-window.fullscreen {
  width: 100vw;
  height: 100vh;
  bottom: 0;
  right: 0;
  border-radius: 0;
  z-index: 20004;
}

.ai-label {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ev-accent);
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* ========== UTILS ========== */
.hidden { display: none !important; }
.helper-text { color: var(--ev-muted); font-size: 0.85rem; }

input, textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--ev-border-soft);
  color: #fff;
  padding: 0.8rem;
  border-radius: 8px;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--ev-accent);
  box-shadow: 0 0 10px rgba(24, 237, 219, 0.2);
}

/* MODALS */
.mission-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #020617; z-index: 9999; display: flex; flex-direction: column;
}
.mission-header {
  padding: 1rem; background: #0b152a; border-bottom: 1px solid var(--ev-accent);
  display: flex; justify-content: space-between; align-items: center;
}

/* ... existing styles ... */

/* NEW BUTTON VARIANTS */
.btn-gym {
  background: linear-gradient(135deg, #e8a7ab, #d97706);
  color: #000;
  box-shadow: 0 0 15px rgba(232, 167, 171, 0.4);
}
.btn-gym:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(232, 167, 171, 0.6);
}

.btn-dojo {
  background: linear-gradient(135deg, #d946ef, #a855f7);
  color: #fff;
  box-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
}
.btn-dojo:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(217, 70, 239, 0.6);
}

.btn-lab {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.btn-lab:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
}

.btn-roster {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #000;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}
.btn-roster:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
}

.btn-ghost-gold {
  background: transparent;
  border: 2px solid var(--color-roster);
  color: var(--color-roster);
  box-shadow: none;
}
.btn-ghost-gold:hover {
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.btn-chat {
  background: linear-gradient(135deg, #18eddb, #2dd4ff);
  color: #000;
  box-shadow: 0 0 15px rgba(24, 237, 219, 0.4);
}
.btn-chat:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(24, 237, 219, 0.6);
}

.btn-training {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}
.btn-training:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}

#btn-join-live {
  padding: 1.1rem !important; /* ~30% larger than 0.8rem */
  animation: pulse-gold-glow 6s infinite;
  margin-top: auto; /* Pin to bottom for flex containers */
  border-color: var(--color-roster);
  color: var(--color-roster);
}

#btn-attendance {
  margin-top: 1.5rem !important; /* Move it down a tiny bit */
}

/* Updated Flex Logic for Training & Roster */
#training-buttons-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    padding-top: 1rem;
}

/* Pin the LAST button (Maths) to the bottom */
#training-buttons-container > :last-child {
    margin-top: auto;
}

@keyframes pulse-gold-glow {
  0% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.2), inset 0 0 5px rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.5);
    color: rgba(251, 191, 36, 0.8);
  }
  50% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6), inset 0 0 10px rgba(251, 191, 36, 0.3);
    border-color: rgba(251, 191, 36, 1);
    color: #000;
  }
  100% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.2), inset 0 0 5px rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.5);
    color: rgba(251, 191, 36, 0.8);
  }
}

/* ========== CUSTOM SCROLLBARS (NEON) ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ev-accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ev-accent-alt);
  box-shadow: 0 0 5px var(--ev-accent);
}

/* ========== AGGRESSIVE ALERT ICON ========== */
.alert-icon {
  width: 40px;
  height: 40px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 15px #ef4444;
  animation: pulse-aggressive 1.5s infinite;
  z-index: 10;
}

@keyframes pulse-aggressive {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ========== CHAT IMAGE FIX ========== */
.chat-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.chat-bubble img {
    max-width: 250px; /* USER REQUESTED LIMIT */
    height: auto;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* ========== COMMAND GRID (NESTED) ========== */
.command-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .command-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .command-grid { grid-template-columns: 1fr; }
}

/* ========== NEW: TECH BORDER & UNIFORM CARDS ========== */
.card-tech {
  border: 1px solid var(--ev-accent);
  box-shadow: 0 0 10px rgba(24, 237, 219, 0.1);
  transition: all 0.2s ease;
}
.card-tech:hover {
  box-shadow: 0 0 20px rgba(24, 237, 219, 0.3);
  transform: translateY(-2px);
}

.card-uniform-height {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  /* justify-content: center; REMOVED FOR BOTTOM ALIGNMENT */
  text-align: center;
}
.card-uniform-height button {
    margin-top: auto; /* PINS BUTTON TO BOTTOM */
}

/* GYM LAYOUT BUFFER */
.gym-layout {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    gap: 1rem;
    padding-bottom: 60px; /* Footer Space */
}

.gym-left-panel {
    width: 32%;
    overflow-y: auto;
    padding: 1rem 2rem;
    border-right: 1px solid var(--ev-border-soft);
    background: rgba(0,0,0,0.2);
}

.gym-right-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    .gym-layout { flex-direction: column; }
    .gym-left-panel { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid var(--ev-border-soft); }
    .gym-right-panel { flex: 1; }
}

/* GYM EDITOR TALLER */
.gym-editor {
    min-height: 400px; /* Adjusted for split layout */
    flex: 1;
}

/* POWER WORDS CARDS */
.gym-gadget-belt {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1rem 2rem;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--ev-border-soft);
}

.gym-power-word {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--color-gym);
    color: var(--color-gym);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 5px rgba(232, 167, 171, 0.1);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gym-power-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(232, 167, 171, 0.4);
    background: rgba(232, 167, 171, 0.1);
}

/* POWER WORDS ACTIVATED */
.gym-power-word.activated {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981 !important; /* NEON GREEN */
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    font-weight: bold;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.8); }
    100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
}

/* HOMEWORK WINDOW FULL HEIGHT */
.mission-frame-container {
    width: 100%;
    height: calc(100% - 60px);
    border: none;
}

/* AI CHAT BUBBLES */
.ai-bubble-teacher {
  background: #1e293b;
  color: #fff;
  border-radius: 12px 12px 12px 0;
  padding: 0.5rem 1rem;
  max-width: 80%;
  position: relative;
}

.ai-bubble-user {
  background: var(--color-training);
  color: #fff;
  border-radius: 12px 12px 0 12px;
  padding: 0.5rem 1rem;
  max-width: 80%;
  position: relative;
}

/* =================================================================
   📝 EXAM PAPER THEME (GYM OVERLAY REDESIGN)
   ================================================================= */

/* Overrides for the Gym Overlay to make it look like a physical exam */
#gym-overlay {
  background: #f1f5f9; /* Light Grey background */
  color: #0f172a;      /* Dark Text */
}

#gym-overlay .mission-header {
  background: #fff;
  border-bottom: 2px solid #cbd5e1;
  color: #0f172a;
}

#gym-overlay .mission-title {
  color: #0f172a !important; /* Force Black */
}

/* LEFT PANEL (Stimulus) */
.gym-left-panel {
  background: #fff;
  border-right: 2px solid #cbd5e1;
  color: #000;
  box-shadow: 5px 0 15px rgba(0,0,0,0.05);
}

.gym-left-panel .gym-image {
  border: 2px solid #000; /* Strict border for images */
  box-shadow: none;
  border-radius: 0;
}

/* RIGHT PANEL (Foolscap Paper) */
.gym-right-panel {
  background: #fff;
  padding: 0; /* Let the editor take full width */
  display: flex;
  flex-direction: column;
}

.gym-tools-bar {
  background: #e2e8f0;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0; /* Prevent shrinking */
}

/* FOOLSCAP EDITOR STYLING */
.gym-editor {
  background-color: #fff;
  background-attachment: local;
  background-image:
    linear-gradient(#94a3b8 1px, transparent 1px), /* Blue Lines */
    linear-gradient(90deg, #94a3b8 1px, transparent 1px); /* Red Margin */
  background-size: 100% 2rem, 100% 100%;
  background-position: 0 2rem, 3rem 0; /* Margin offset */
  background-repeat: repeat-y, no-repeat;

  line-height: 2rem; /* MATCHES GRADIENT SIZE */
  padding: 2rem 2rem 2rem 4rem; /* Left padding clears the margin */

  color: #000;
  font-family: "Courier New", Courier, monospace; /* Typewriter / Clean Exam Look */
  font-size: 1.1rem;
  border: none;
  border-radius: 0;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
  resize: none;
  flex-grow: 1; /* Allow to fill remaining space */
}

.gym-editor:focus {
  outline: none;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

/* Placeholder color fix for light theme */
.gym-editor::placeholder {
  color: #94a3b8;
  font-style: italic;
}

/* POWER WORDS (Light Theme) */
.gym-gadget-belt {
  background: #fff;
  border-bottom: 1px solid #cbd5e1;
}

.gym-power-word {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gym-power-word:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.gym-power-word.activated {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857 !important; /* Dark Green text for readability */
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  animation: pulse-green-light 2s infinite;
}

@keyframes pulse-green-light {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); }
}

/* FOOTER & BUTTONS */
.gym-footer {
  background: #e2e8f0;
  border-top: 1px solid #cbd5e1;
  color: #475569;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#gym-exit-btn {
  color: #64748b;
  border-color: #94a3b8;
}
#gym-exit-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* SCAN BUTTON (Specific Style) */
#gym-ocr-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: bold;
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
#gym-ocr-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* LOCKED STATE */
.sh-locked {
  filter: grayscale(100%);
  opacity: 0.6;
  position: relative;
  cursor: not-allowed;
}

.sh-locked::after {
  content: "🔒 LOCKED";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  border: 1px solid #fff;
  z-index: 10;
}

/* WRITING GYM FEEDBACK BOX (Collapsible & Formatted) */
.gym-feedback-box {
    margin: 1rem;
    border: 1px solid #ef4444;
    border-radius: 8px;
    overflow: hidden;
    background: #fee2e2;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.gym-feedback-header {
    background: #ef4444;
    padding: 0.8rem 1rem;
    color: #fff;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.gym-feedback-header:hover {
    background: #dc2626;
}

.gym-feedback-content {
    padding: 1rem;
    color: #7f1d1d;
    line-height: 1.6;
    background: #fee2e2;
    display: block;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
}

.gym-feedback-content.collapsed {
    display: none;
}

#gym-feedback-text strong {
    color: #991b1b;
    font-weight: 800;
}

#gym-feedback-text em {
    font-style: italic;
    background: rgba(255, 255, 255, 0.4);
    padding: 0 4px;
    border-radius: 4px;
}

/* =================================================================
   MOBILE OPTIMIZATIONS (PROFILE & LAYOUT)
   ================================================================= */

/* Ensure the Avatar image behaves on Desktop (overriding previous inline style) */
.hero-avatar-img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Mobile Profile Card - Side-by-Side Layout */
@media (max-width: 768px) {
    .profile-hero-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1.5rem;
    }

    .hero-avatar-frame {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
        margin-right: 0; /* Gap handles spacing */
        margin-bottom: 0;
    }

    .profile-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .profile-points-container {
        margin-top: 0.5rem !important; /* Tighter spacing for mobile */
    }
}
