/* ===================================================================
   MATEMÀTIQUES 1r ESO C - INS PERE BORRELL
   Design System & Style System
   =================================================================== */

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

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --brand-primary: #1d4ed8;
  --brand-primary-hover: #1e40af;
  --brand-secondary: #0284c7;
  --brand-accent: #0ea5e9;
  --brand-light: #e0f2fe;
  --brand-border: rgba(14, 165, 233, 0.25);
  
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  
  --border-color: #e2e8f0;
  --border-subtle: rgba(226, 232, 240, 0.8);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 25px rgba(29, 78, 216, 0.2);
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(14px);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-surface: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-secondary: #38bdf8;
  --brand-accent: #0ea5e9;
  --brand-light: rgba(14, 165, 233, 0.15);
  --brand-border: rgba(56, 189, 248, 0.3);
  
  --border-color: #1e293b;
  --border-subtle: rgba(51, 65, 85, 0.7);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.25);
  
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* ===================================================================
   Reset & Base Setup
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image: 
    radial-gradient(at 0% 0%, rgba(29, 78, 216, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

/* ===================================================================
   Layout Containers
   =================================================================== */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* ===================================================================
   Navbar
   =================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-logo-badge {
  width: 2.6rem;
  height: 2.6rem;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.3);
}

.nav-brand span {
  color: var(--brand-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--brand-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  transition: width var(--transition-fast);
  border-radius: var(--radius-full);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.theme-toggle-btn {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px solid var(--border-color);
}

.theme-toggle-btn:hover {
  background: var(--bg-card);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-secondary);
  transform: translateY(-2px);
}

.btn-presentation {
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: white;
  padding: 0.65rem 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-presentation:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

/* ===================================================================
   Hero Section
   =================================================================== */
.hero {
  padding: 4.5rem 0 3.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 3.4rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #1d4ed8, #0284c7, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.18rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.stat-item h4 {
  font-size: 1.8rem;
  color: var(--brand-primary);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

/* Hero Teacher Card */
.teacher-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow-xl);
}

.teacher-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), #38bdf8);
}

.teacher-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.teacher-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.teacher-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  display: block;
}

.teacher-meta .teacher-role {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-secondary);
  letter-spacing: 0.05em;
}

.teacher-meta h3 {
  font-size: 1.45rem;
  margin: 0.2rem 0 0.35rem;
}

.teacher-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.teacher-email:hover {
  color: var(--brand-primary);
}

.teacher-details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.teacher-details-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.teacher-details-list li .detail-icon {
  font-size: 1.2rem;
}

/* ===================================================================
   Horaris Section
   =================================================================== */
.timetable-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.timetable-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.timetable-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-secondary);
}

.timetable-card.today-active {
  border: 2px solid var(--brand-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-glow);
}

.card-top-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.day-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-primary);
  font-family: var(--font-heading);
}

.active-pill {
  background: #10b981;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  width: fit-content;
}

.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--brand-light);
  color: var(--brand-primary);
  margin-bottom: 1rem;
  width: fit-content;
}

.session-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: auto;
}

.session-desc strong {
  color: var(--text-primary);
}

.timetable-summary-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.summary-icon {
  font-size: 2rem;
  color: var(--brand-primary);
}

.summary-text h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.summary-text p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ===================================================================
   Desdoblament Section
   =================================================================== */
.desdoblament-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.desdoblament-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.flow-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  transition: all var(--transition-normal);
}

.flow-card.math-focus {
  border-left: 5px solid var(--brand-primary);
}

.flow-card.tech-focus {
  border-left: 5px solid #8b5cf6;
}

.flow-time-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-primary);
  margin-bottom: 0.75rem;
}

.flow-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.flow-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
}

.group-pill strong {
  color: var(--brand-primary);
}

.group-pill .location-tag {
  font-size: 0.8rem;
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.flow-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.flow-divider span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Interactive group roster table */
.roster-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.roster-header h3 {
  font-size: 1.2rem;
}

.roster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.roster-col {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.roster-col-title {
  padding: 0.85rem 1.25rem;
  background: #9cc3e5;
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roster-col-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 200px;
}

.roster-item {
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===================================================================
   Temari & Trimestres Section
   =================================================================== */
.tabs-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.tab-btn {
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.tab-btn:hover {
  border-color: var(--brand-secondary);
  color: var(--brand-primary);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
}

.tab-content {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.unit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-secondary);
}

.unit-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.unit-number {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand-primary);
  background: var(--brand-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.unit-duration {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.unit-title {
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

.unit-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.competencies-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.competency-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.competency-tag.highlight {
  background: var(--purple-light);
  color: var(--purple);
  border-color: rgba(139, 92, 246, 0.3);
}

/* ===================================================================
   Simuladors Matemàtics (1r ESO)
   =================================================================== */
.simulators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
}

.simulator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.simulator-header {
  margin-bottom: 1.5rem;
}

.simulator-header .sim-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.sim-tag.blue { background: var(--brand-light); color: var(--brand-primary); }
.sim-tag.purple { background: var(--purple-light); color: var(--purple); }
.sim-tag.green { background: var(--success-light); color: var(--success); }

.simulator-header h3 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.simulator-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sim-canvas-wrap {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  min-height: 180px;
  border: 1px solid var(--border-color);
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
}

.slider {
  width: 100%;
  accent-color: var(--brand-primary);
  height: 6px;
  border-radius: var(--radius-full);
}

.sim-output-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-primary);
}

/* ===================================================================
   Material & Carpesà Section
   =================================================================== */
.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.checklist-card, .binder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
}

.checklist-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checklist-item:hover {
  border-color: var(--brand-secondary);
}

.checklist-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--brand-primary);
  margin-top: 0.15rem;
  cursor: pointer;
}

.checklist-item.checked {
  opacity: 0.65;
  text-decoration: line-through;
}

.binder-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.binder-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.step-content h4 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===================================================================
   Avaluació Section
   =================================================================== */
.eval-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.eval-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  text-align: center;
}

.eval-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-secondary);
}

.eval-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.eval-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.eval-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.eval-notice-box {
  background: var(--bg-card);
  border-left: 5px solid #10b981;
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.notice-icon {
  font-size: 2rem;
  color: #10b981;
}

/* ===================================================================
   Classroom Card
   =================================================================== */
.classroom-section {
  padding-bottom: 6rem;
}

.classroom-card {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: white;
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  box-shadow: var(--shadow-xl);
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.classroom-card::after {
  content: 'π';
  position: absolute;
  right: -30px;
  bottom: -50px;
  font-size: 18rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.05);
  line-height: 1;
  pointer-events: none;
  font-family: serif;
}

.classroom-card h2 {
  color: white;
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.classroom-card p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 550px;
}

.classroom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-white {
  background: white;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-white:hover {
  background: #f8fafc;
  color: #1e40af;
  transform: translateY(-2px);
}

.btn-white-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-white-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.classroom-contact-side {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.classroom-contact-side h3 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.contact-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* ===================================================================
   Footer
   =================================================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ===================================================================
   Fullscreen Presentation Mode (Slide Deck Overlay)
   =================================================================== */
.presentation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #0b1329;
  color: #ffffff;
  display: none;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.presentation-modal.active {
  display: flex;
}

/* Slide Deck Header Bar */
.slide-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.slide-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

.slide-progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.slide-progress-bar {
  height: 100%;
  width: 9%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  transition: width 0.3s ease;
}

.slide-bar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slide-ctrl-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.slide-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0 0.5rem;
  color: #94a3b8;
}

/* Slide Deck Content Area */
.slide-viewport {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.slide {
  width: 100%;
  max-width: 1180px;
  display: none;
  animation: slideFade 0.35s ease forwards;
}

.slide.active {
  display: block;
}

@keyframes slideFade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.slide-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  padding: 3.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slide-tag {
  color: #38bdf8;
  text-transform: uppercase;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.slide-title {
  font-size: 2.75rem;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.slide-body {
  font-size: 1.25rem;
  line-height: 1.65;
  color: #cbd5e1;
}

/* Presentation Nav Arrows */
.slide-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 20;
}

.slide-nav-arrow:hover {
  background: var(--brand-primary);
  transform: translateY(-50%) scale(1.08);
}

.slide-nav-prev { left: 1.5rem; }
.slide-nav-next { right: 1.5rem; }

/* Slide Specific Layouts */
.slide-teacher-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.slide-teacher-avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 5px solid #38bdf8;
  margin: 0 auto;
  display: block;
}

.slide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 1.1rem;
}

.slide-table th, .slide-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.slide-table th {
  background: #1d4ed8;
  color: white;
  font-weight: 700;
}

.slide-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.05);
}

/* ===================================================================
   Responsive Breakpoints
   =================================================================== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .timetable-grid { grid-template-columns: repeat(2, 1fr); }
  .desdoblament-flow { grid-template-columns: 1fr; }
  .flow-divider { flex-direction: row; }
  .material-grid { grid-template-columns: 1fr; }
  .classroom-card { grid-template-columns: 1fr; }
  .eval-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.5rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .timetable-grid { grid-template-columns: 1fr; }
  .roster-grid { grid-template-columns: 1fr; }
  .slide-card { padding: 2rem; }
  .slide-title { font-size: 2rem; }
  .slide-teacher-layout { grid-template-columns: 1fr; text-align: center; }
  .slide-nav-arrow { display: none; }
}
