/* 
 * ECOEMS 2026 - Conversa Universitario
 * Custom Styles - Institutional Identity
 * CSS Variables & Global Styles
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
  /* Primary Colors - Conversa Brand */
  --conversa-red: #E31837;
  --conversa-red-dark: #B71430;
  --conversa-red-light: #FF4D66;
  --conversa-navy: #1E3A5F;
  --conversa-navy-dark: #0D1F35;
  --conversa-navy-light: #2C5282;

  /* Neutral Palette */
  --neutral-50: #FAFBFC;
  --neutral-100: #F4F5F7;
  --neutral-200: #E8EAED;
  --neutral-300: #D1D5DB;
  --neutral-400: #9CA3AF;
  --neutral-500: #6B7280;
  --neutral-600: #4B5563;
  --neutral-700: #374151;
  --neutral-800: #1F2937;
  --neutral-900: #111827;

  /* Accent Colors for Subjects */
  --accent-math: #8B5CF6;
  --accent-spanish: #EC4899;
  --accent-history: #F59E0B;
  --accent-geography: #10B981;
  --accent-biology: #06B6D4;
  --accent-physics: #3B82F6;
  --accent-chemistry: #EF4444;
  --accent-civics: #8B5CF6;

  /* Status Colors */
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --error: #DC2626;
  --error-light: #FEE2E2;
  --info: #0284C7;
  --info-light: #E0F2FE;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow-red: 0 0 40px rgba(227, 24, 55, 0.2);
  --shadow-glow-navy: 0 0 40px rgba(30, 58, 95, 0.2);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   FONT IMPORTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ========================================
   BASE STYLES
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--neutral-800);
  background: var(--neutral-50);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--conversa-navy);
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--conversa-red), var(--conversa-navy));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

/* Main App Container */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--conversa-navy) 0%, var(--conversa-navy-dark) 100%);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  max-width: 180px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  padding: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
}

.sidebar-nav .nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-2);
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: var(--radius-lg);
  margin: var(--space-1) var(--space-3);
  transition: all var(--transition-fast);
  font-weight: 500;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-nav .nav-link.active {
  background: var(--conversa-red);
  color: white;
  box-shadow: var(--shadow-md);
}

.sidebar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  background: var(--neutral-100);
}

/* Top Header */
.top-header {
  background: white;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--neutral-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-search {
  position: relative;
  width: 300px;
}

.header-search input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: 2.5rem;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.header-search input:focus {
  border-color: var(--conversa-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.1);
}

.header-search i {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--neutral-100);
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  background: var(--neutral-200);
  color: var(--conversa-navy);
}

.header-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--conversa-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-menu:hover {
  background: var(--neutral-100);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--conversa-red), var(--conversa-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.user-info {
  text-align: left;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--neutral-800);
}

.user-role {
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* Page Content */
.page-content {
  padding: var(--space-6);
}

.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.page-title h1 {
  margin: 0;
}

.page-subtitle {
  color: var(--neutral-500);
  font-size: 1rem;
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */
.card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--conversa-navy);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

/* Stats Card */
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--conversa-red));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--conversa-navy);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--neutral-500);
  font-weight: 500;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
}

.stat-change.positive {
  background: var(--success-light);
  color: var(--success);
}

.stat-change.negative {
  background: var(--error-light);
  color: var(--error);
}

/* Subject Cards */
.subject-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.subject-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--subject-color, var(--neutral-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.subject-card:hover::after {
  transform: scaleX(1);
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.subject-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  background: var(--subject-bg, var(--neutral-100));
  color: var(--subject-color, var(--neutral-600));
}

.subject-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--conversa-navy);
  margin-bottom: var(--space-2);
}

.subject-progress {
  margin-bottom: var(--space-3);
}

.subject-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--conversa-red);
  color: white;
  box-shadow: 0 2px 8px rgba(227, 24, 55, 0.3);
}

.btn-primary:hover {
  background: var(--conversa-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227, 24, 55, 0.4);
}

.btn-secondary {
  background: var(--conversa-navy);
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.btn-secondary:hover {
  background: var(--conversa-navy-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--neutral-300);
  color: var(--neutral-700);
}

.btn-outline:hover {
  border-color: var(--conversa-red);
  color: var(--conversa-red);
  background: rgba(227, 24, 55, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--neutral-600);
}

.btn-ghost:hover {
  background: var(--neutral-100);
  color: var(--conversa-navy);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
}

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: white;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--conversa-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.1);
}

.form-control::placeholder {
  color: var(--neutral-400);
}

.form-text {
  font-size: 0.8125rem;
  color: var(--neutral-500);
  margin-top: var(--space-1);
}

/* ========================================
   PROGRESS COMPONENTS
   ======================================== */
.progress-bar {
  height: 8px;
  background: var(--neutral-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--conversa-red), var(--conversa-red-light));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  transition: stroke-dashoffset var(--transition-slow);
}

/* ========================================
   STREAK & GAMIFICATION
   ======================================== */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, #FF6B35, #F7931E);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(247, 147, 30, 0.3);
}

.streak-badge i {
  font-size: 1rem;
}

.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--info-light);
  color: var(--info);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}

.level-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-100);
  border-radius: var(--radius-lg);
}

.level-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--conversa-red), var(--conversa-navy));
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

/* ========================================
   EXAM & QUIZ INTERFACE
   ======================================== */
.exam-container {
  max-width: 900px;
  margin: 0 auto;
}

.exam-header {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
  z-index: 50;
}

.exam-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.exam-timer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--neutral-100);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--conversa-navy);
}

.exam-timer.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.exam-timer.danger {
  background: var(--error-light);
  color: var(--error);
  animation: pulse 1s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.question-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all var(--transition-base);
}

.question-card.answered {
  border-color: var(--success);
}

.question-card.flagged {
  border-color: var(--warning);
}

.question-number {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--conversa-navy);
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.question-text {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--neutral-800);
  margin-bottom: var(--space-5);
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--neutral-50);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-label:hover {
  border-color: var(--conversa-red);
  background: rgba(227, 24, 55, 0.03);
}

.option-label input[type="radio"] {
  display: none;
}

.option-label input[type="radio"]:checked+.option-letter {
  background: var(--conversa-red);
  color: white;
  border-color: var(--conversa-red);
}

.option-label input[type="radio"]:checked~.option-text {
  color: var(--conversa-navy);
  font-weight: 500;
}

.option-label:has(input[type="radio"]:checked) {
  border-color: var(--conversa-red);
  background: rgba(227, 24, 55, 0.03);
}

.option-letter {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: white;
  border: 2px solid var(--neutral-300);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--neutral-600);
  transition: all var(--transition-fast);
}

.option-text {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--neutral-700);
  line-height: 1.5;
  padding-top: 4px;
}

/* Answer Feedback */
.option-label.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.option-label.correct .option-letter {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.option-label.incorrect {
  border-color: var(--error);
  background: var(--error-light);
}

.option-label.incorrect .option-letter {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.question-explanation {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--info-light);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--info);
}

.question-explanation h5 {
  font-size: 0.875rem;
  color: var(--info);
  margin-bottom: var(--space-2);
}

/* Question Navigator */
.question-nav {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--neutral-50);
  border-radius: var(--radius-lg);
}

.question-nav-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.question-nav-item:hover {
  border-color: var(--conversa-red);
}

.question-nav-item.current {
  background: var(--conversa-navy);
  border-color: var(--conversa-navy);
  color: white;
}

.question-nav-item.answered {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.question-nav-item.flagged {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

/* ========================================
   STUDY PLAN / CALENDAR
   ======================================== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.calendar-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.calendar-day:hover {
  border-color: var(--conversa-red);
}

.calendar-day.today {
  background: var(--conversa-red);
  border-color: var(--conversa-red);
  color: white;
}

.calendar-day.has-task::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: var(--conversa-red);
  border-radius: var(--radius-full);
}

.calendar-day.today.has-task::after {
  background: white;
}

.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
}

.task-item-color {
  width: 4px;
  height: 32px;
  border-radius: var(--radius-full);
}

.task-item-content {
  flex: 1;
}

.task-item-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--neutral-800);
}

.task-item-time {
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* ========================================
   MASCOT COMPONENT
   ======================================== */
.mascot-bubble {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: linear-gradient(135deg, #FFF5F5, #FFF);
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
}

.mascot-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.mascot-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mascot-message {
  flex: 1;
}

.mascot-message p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--neutral-700);
  line-height: 1.6;
}

.mascot-message strong {
  color: var(--conversa-navy);
}

/* ========================================
   TABLES
   ======================================== */
.table-modern {
  width: 100%;
  border-collapse: collapse;
}

.table-modern thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  background: var(--neutral-50);
  border-bottom: 2px solid var(--neutral-200);
}

.table-modern tbody td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  font-size: 0.875rem;
  color: var(--neutral-700);
}

.table-modern tbody tr:hover {
  background: var(--neutral-50);
}

/* ========================================
   BADGES & PILLS
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-primary {
  background: var(--conversa-red);
  color: white;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-error {
  background: var(--error-light);
  color: var(--error);
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

/* Subject Badges with Colors */
.badge-math {
  background: #EDE9FE;
  color: #7C3AED;
}

.badge-spanish {
  background: #FCE7F3;
  color: #DB2777;
}

.badge-history {
  background: #FEF3C7;
  color: #D97706;
}

.badge-geography {
  background: #D1FAE5;
  color: #059669;
}

.badge-biology {
  background: #CFFAFE;
  color: #0891B2;
}

.badge-physics {
  background: #DBEAFE;
  color: #2563EB;
}

.badge-chemistry {
  background: #FEE2E2;
  color: #DC2626;
}

.badge-civics {
  background: #EDE9FE;
  color: #7C3AED;
}

/* ========================================
   RESPONSIVE / MOBILE
   ======================================== */

/* Mobile Toggle Button (Hamburger) */
.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-toggle:hover,
.mobile-toggle:active {
  background: var(--neutral-100);
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--conversa-navy);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation when open */
.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Sidebar Overlay - FIXED for iOS/Android */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Close Button inside Sidebar */
.sidebar-close {
  display: none;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-items: center;
  justify-content: center;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close:hover,
.sidebar-close:active {
  background: rgba(255, 255, 255, 0.25);
}

/* Sidebar Mobile Styles - FIXED for iOS Safari & Android Chrome */
@media (max-width: 1024px) {

  /* Estado base - oculto fuera de pantalla */
  .sidebar,
  aside.sidebar,
  #sidebar,
  [id="sidebar"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100% !important;
    height: 100dvh !important;
    /* Dynamic viewport height for mobile */
    /* Usar translate3d para activar GPU acceleration en iOS */
    transform: translate3d(-100%, 0, 0) !important;
    -webkit-transform: translate3d(-100%, 0, 0) !important;
    -moz-transform: translate3d(-100%, 0, 0) !important;
    -ms-transform: translate3d(-100%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s !important;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s !important;
    z-index: 1100 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    will-change: transform;
    visibility: hidden !important;
  }

  /* Estado abierto - visible con alta especificidad */
  .sidebar.open,
  aside.sidebar.open,
  #sidebar.open,
  [id="sidebar"].open,
  .sidebar[class*="open"],
  #sidebar[class*="open"] {
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    -moz-transform: translate3d(0, 0, 0) !important;
    -ms-transform: translate3d(0, 0, 0) !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3) !important;
    visibility: visible !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }

  .sidebar-close {
    display: flex !important;
  }

  .sidebar-header {
    padding-right: 60px;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .mobile-toggle {
    display: flex !important;
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
  }

  .header-search {
    display: none;
  }

  .page-content {
    padding: var(--space-4);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .question-nav {
    grid-template-columns: repeat(8, 1fr);
  }

  .user-info {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .subjects-grid {
    grid-template-columns: 1fr !important;
  }

  .question-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .exam-header {
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotateZ(0);
    opacity: 1;
  }

  100% {
    transform: translateY(-100px) rotateZ(720deg);
    opacity: 0;
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) ease-out;
}

.animate-scale-in {
  animation: scaleIn var(--transition-base) ease-out;
}

/* Staggered animations */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-red {
  color: var(--conversa-red);
}

.text-navy {
  color: var(--conversa-navy);
}

.text-muted {
  color: var(--neutral-500);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

.bg-red {
  background-color: var(--conversa-red);
}

.bg-navy {
  background-color: var(--conversa-navy);
}

.bg-light {
  background-color: var(--neutral-100);
}

.fw-medium {
  font-weight: 500;
}

.fw-semibold {
  font-weight: 600;
}

.fw-bold {
  font-weight: 700;
}

.fw-extrabold {
  font-weight: 800;
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

.shadow-glow-red {
  box-shadow: var(--shadow-glow-red);
}

.shadow-glow-navy {
  box-shadow: var(--shadow-glow-navy);
}

/* Grid Utilities */
.grid {
  display: grid;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

/* Print Styles */
@media print {

  .sidebar,
  .top-header,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 0;
  }
}