/* ─────────────────────────────────────────────
   HORARIO PUCP — Student-friendly Calendar UI
   Aesthetic: Warm gradient light theme, soft
   rounded cards, vibrant accent palette
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ── Design Tokens ── */
:root {
  --bg-primary: #f8f6f3;
  --bg-secondary: #ffffff;
  --bg-elevated: #fffefa;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-input: #f2eeea;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #8e8ea0;
  --text-inverse: #ffffff;

  --accent-coral: #ff6b6b;
  --accent-orange: #ffa94d;
  --accent-yellow: #ffd43b;
  --accent-teal: #20c997;
  --accent-blue: #4dabf7;
  --accent-violet: #9775fa;
  --accent-pink: #f06595;
  --accent-lime: #a9e34b;

  --gradient-hero: linear-gradient(135deg, #fff1eb 0%, #ede4ff 50%, #dff5f0 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #faf7f4 100%);
  --gradient-coral: linear-gradient(135deg, #ff6b6b, #ee5a24);
  --gradient-teal: linear-gradient(135deg, #20c997, #0ca678);
  --gradient-blue: linear-gradient(135deg, #4dabf7, #3b82f6);
  --gradient-violet: linear-gradient(135deg, #9775fa, #7c5ce7);
  --gradient-orange: linear-gradient(135deg, #ffa94d, #f76707);
  --gradient-pink: linear-gradient(135deg, #f06595, #e03172);

  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 20px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 8px 40px rgba(26, 26, 46, 0.10);
  --shadow-xl: 0 16px 60px rgba(26, 26, 46, 0.12);
  --shadow-glow: 0 0 30px rgba(32, 201, 151, 0.15);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 100px;

  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);

  /* Activity type colors */
  --color-cla: #4dabf7;
  --color-pra: #ffa94d;
  --color-exa: #ff6b6b;
  --color-lab: #20c997;
  --color-dir: #9775fa;
  --color-tal: #f06595;

  --color-cla-bg: rgba(77, 171, 247, 0.12);
  --color-pra-bg: rgba(255, 169, 77, 0.12);
  --color-exa-bg: rgba(255, 107, 107, 0.12);
  --color-lab-bg: rgba(32, 201, 151, 0.12);
  --color-dir-bg: rgba(151, 117, 250, 0.12);
  --color-tal-bg: rgba(240, 101, 149, 0.12);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background ── */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: var(--gradient-hero);
  overflow: hidden;
}

.bg-pattern::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80vw;
  height: 80vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 169, 77, 0.08) 0%, transparent 70%);
  animation: float-blob 20s ease-in-out infinite;
}

.bg-pattern::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 171, 247, 0.07) 0%, transparent 70%);
  animation: float-blob 25s ease-in-out infinite reverse;
}

@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── Layout ── */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.app-header {
  padding: 32px 0 20px;
  text-align: center;
  position: relative;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-teal);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(32, 201, 151, 0.3);
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.app-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-violet) 60%, var(--accent-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto;
}

.cycle-badge {
  display: inline-block;
  background: var(--gradient-coral);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

/* ── Main Sections ── */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 60px;
}

/* ── Cards ── */
.card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--transition-med);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.card-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card-header-icon.courses { background: var(--color-cla-bg); }
.card-header-icon.calendar { background: var(--color-lab-bg); }
.card-header-icon.timeline { background: var(--color-pra-bg); }

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px 24px 24px;
}

/* ── Courses Section Collapsible ── */
.courses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
}

.courses-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.courses-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.courses-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.courses-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.courses-section-collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.courses-body {
  transition: all 0.3s ease;
  overflow: hidden;
}

.courses-section-collapsed .courses-body {
  max-height: 0;
  padding: 0;
  opacity: 0;
}

.courses-summary {
  padding: 16px 20px;
  background: var(--bg-input);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.summary-code {
  font-weight: 700;
  color: var(--text-primary);
}

.summary-hor {
  color: var(--text-secondary);
  font-size: 12px;
}

.summary-count {
  background: var(--gradient-teal);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Course Input ── */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-input);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all var(--transition-med);
  animation: slide-in 0.35s var(--transition-slow) both;
  position: relative;
}

.course-entry.validated {
  border-color: var(--accent-teal);
  background: rgba(32, 201, 151, 0.04);
}

.course-entry.error {
  border-color: var(--accent-coral);
  background: rgba(255, 107, 107, 0.04);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.course-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-violet);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 3px 8px rgba(151, 117, 250, 0.3);
}

.course-fields {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field-group.clave {
  flex: 1;
  min-width: 140px;
}

.field-group.hor {
  width: 130px;
}

.field-group.lab {
  width: 150px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field-input,
.field-select {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(0, 0, 0, 0.06);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

.field-input:focus,
.field-select:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 4px rgba(32, 201, 151, 0.1);
}

.field-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238e8ea0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.field-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.course-info {
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-info .name {
  font-weight: 600;
  color: var(--text-primary);
}

.course-info .credits {
  background: var(--color-pra-bg);
  color: var(--accent-orange);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.remove-course-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1;
}

.remove-course-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: var(--accent-coral);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-med);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-teal);
  color: white;
  box-shadow: 0 4px 14px rgba(32, 201, 151, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(32, 201, 151, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #e8e4df;
  color: var(--text-primary);
}

.btn-add {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 14px rgba(77, 171, 247, 0.3);
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 171, 247, 0.4);
}

.btn-danger {
  background: var(--gradient-coral);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
}

.export-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.btn-google {
  background: white;
  color: #5f6368;
  border: 2px solid #dadce0;
  font-size: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #5f6368;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outlook {
  background: #0078d4;
  color: white;
  font-size: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.3);
}

.btn-outlook:hover {
  background: #106ebe;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.4);
}

.btn-apple {
  background: #000;
  color: white;
  font-size: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-apple:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-export {
  background: var(--gradient-violet);
  color: white;
  box-shadow: 0 4px 14px rgba(151, 117, 250, 0.3);
  font-size: 14px;
  padding: 12px 24px;
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(151, 117, 250, 0.4);
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ── Weekly Calendar Grid ── */
.calendar-grid {
  display: grid;
  grid-template-columns: 60px repeat(6, 1fr);
  gap: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  min-height: 400px;
}

.calendar-header-cell {
  background: var(--bg-input);
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.calendar-header-cell.time-label {
  font-size: 11px;
  color: var(--text-muted);
}

.calendar-time-slot {
  background: var(--bg-secondary);
  padding: 4px 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.calendar-cell {
  background: var(--bg-secondary);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  height: 50px;
  position: relative;
  min-width: 0;
}

.calendar-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  transition: all var(--transition-fast);
  border-left: 3px solid;
}

.calendar-event:hover {
  z-index: 10;
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

.calendar-event .event-title {
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.calendar-event .event-detail {
  font-size: 9px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.calendar-event .event-detail strong {
  font-weight: 700;
  color: inherit;
}

.calendar-event.tipo-cla {
  background: var(--color-cla-bg);
  border-left-color: var(--color-cla);
  color: #2271b1;
}

.calendar-event.tipo-pra {
  background: var(--color-pra-bg);
  border-left-color: var(--color-pra);
  color: #bf6a00;
}

.calendar-event.tipo-exa {
  background: var(--color-exa-bg);
  border-left-color: var(--color-exa);
  color: #c13030;
}

.calendar-event.tipo-lab {
  background: var(--color-lab-bg);
  border-left-color: var(--color-lab);
  color: #0e7e5a;
}

.calendar-event.tipo-dir {
  background: var(--color-dir-bg);
  border-left-color: var(--color-dir);
  color: #6741d9;
}

.calendar-event.tipo-tal {
  background: var(--color-tal-bg);
  border-left-color: var(--color-tal);
  color: #c32b64;
}

/* ── Legend ── */
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* ── Timeline ── */
.timeline-container {
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 100px repeat(22, minmax(52px, 1fr));
  gap: 0;
  min-width: 1200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.timeline-header {
  background: var(--bg-input);
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.timeline-row-label {
  background: var(--bg-secondary);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-cell {
  background: var(--bg-secondary);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding: 3px;
  min-height: 38px;
  position: relative;
}

.timeline-cell.holiday {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(255, 107, 107, 0.05) 4px,
    rgba(255, 107, 107, 0.05) 8px
  );
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin: 1px;
}

.timeline-dot.tipo-cla { background: var(--color-cla); }
.timeline-dot.tipo-pra { background: var(--color-pra); }
.timeline-dot.tipo-exa { background: var(--color-exa); }
.timeline-dot.tipo-lab { background: var(--color-lab); }
.timeline-dot.tipo-dir { background: var(--color-dir); }
.timeline-dot.tipo-tal { background: var(--color-tal); }

/* ── Export Bar ── */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--shadow-md);
}

.export-info {
  text-align: center;
}

.export-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.export-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Export Instructions Panel ── */
.export-instructions {
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: var(--radius-lg);
  border: 2px solid #81c784;
  box-shadow: 0 4px 12px rgba(129, 199, 132, 0.2);
  animation: slide-down 0.3s ease forwards;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.instructions-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #81c784;
}

.instructions-icon {
  font-size: 1.5rem;
}

.instructions-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e7d32;
}

.instructions-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}

.instruction-step:hover {
  transform: translateX(4px);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.step-text strong {
  color: #2e7d32;
  font-weight: 600;
}

.step-text a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 600;
}

.step-text a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .export-instructions {
    padding: 16px;
  }
  
  .instruction-step {
    padding: 12px;
  }
  
  .step-text {
    font-size: 0.9rem;
  }
}

/* ── Wrapped Style Share Card (Spotify Wrapped inspired) ── */
.wrapped-section {
  margin-top: 30px;
}

.wrapped-section .card-header-icon.wrapped {
  background: linear-gradient(135deg, #ff6b6b, #feca57);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.wrapped-card {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto 30px;
  aspect-ratio: 9/16;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
}

.wrapped-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
  animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

.wrapped-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 20px;
  color: white;
  text-align: center;
  overflow-y: auto;
}

.wrapped-header {
  margin-bottom: 15px;
}

.wrapped-year {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.wrapped-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  line-height: 1.1;
}

.wrapped-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.stat-big {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.95;
  line-height: 1.2;
}

.stat-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.stat-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  padding: 12px 10px;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-desc {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
}

.stat-highlight {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.highlight-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 3px;
}

.highlight-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-fun {
  font-size: 0.75rem;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  line-height: 1.3;
}

.stat-fun span {
  font-weight: 700;
  font-size: 1.2rem;
  color: #feca57;
}

.stat-exigencia {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(238, 90, 36, 0.2));
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 107, 0.4);
  text-align: center;
}

.exigencia-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exigencia-content {
  font-size: 0.8rem;
  line-height: 1.3;
}

.exigencia-item {
  display: inline-block;
  margin: 2px 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  font-size: 0.75rem;
}

.exigencia-numero {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ff6b6b;
}

.exigencia-label {
  font-size: 0.7rem;
  opacity: 0.9;
}

.wrapped-branding {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.wrapped-footer {
  margin-top: 8px;
  font-size: 0.65rem;
  opacity: 0.7;
  text-align: center;
}

.brand-line {
  width: 40px;
  height: 2px;
  background: white;
  margin: 0 auto 8px;
  border-radius: 2px;
}

.brand-text {
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.95;
}

.brand-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.brand-contact {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  opacity: 0.9;
}

.wrapped-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-wrapped-share {
  background: linear-gradient(135deg, #e1306c, #f77737);
  color: white;
  font-size: 15px;
  padding: 14px 28px;
  box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.btn-wrapped-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
}

.btn-wrapped-download {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 15px;
  padding: 14px 28px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-wrapped-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.wrapped-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 15px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

@media (max-width: 600px) {
  .wrapped-card {
    max-width: 100%;
    aspect-ratio: 4/5;
  }
  
  .wrapped-content {
    padding: 25px 20px;
  }
  
  .wrapped-title {
    font-size: 1.8rem;
  }
  
  .stat-number {
    font-size: 3rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .wrapped-actions {
    flex-direction: column;
  }
  
  .btn-wrapped-share,
  .btn-wrapped-download {
    width: 100%;
  }
}

/* ── Catoclases Promotional Banner ── */
.catoclases-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.catoclases-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.catoclases-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.banner-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
}

.banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.banner-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.banner-desc strong {
  color: white;
  font-weight: 600;
}

.banner-features {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banner-features li {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.3;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: #667eea;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: #f8f9fa;
}

.banner-brand {
  position: absolute;
  bottom: 8px;
  right: 16px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .catoclases-banner {
    padding: 16px 16px 28px 16px;
  }
  
  .banner-features li {
    font-size: 0.8rem;
  }
  
  .banner-content {
    flex-direction: column;
    text-align: center;
  }
  
  .banner-icon {
    font-size: 2rem;
  }
  
  .banner-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Tooltip ── */
.tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--text-primary);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  max-width: 280px;
  box-shadow: var(--shadow-xl);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 13px;
}

.tooltip-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tooltip-row .label {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Loading ── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(32, 201, 151, 0.2);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Stats Row ── */
.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-chip .stat-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ── Calendar Controls ── */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.view-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.view-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.view-tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-container {
    padding: 0 16px;
  }

  .course-entry {
    flex-direction: column;
    gap: 10px;
  }

  .course-number {
    margin-top: 0;
  }

  .course-fields {
    width: 100%;
  }

  .field-group.hor,
  .field-group.lab {
    flex: 1;
    width: auto;
    min-width: 100px;
  }

  .calendar-grid {
    grid-template-columns: 48px repeat(6, 1fr);
  }

  .actions-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .export-bar {
    flex-direction: column;
  }

  .stats-row {
    justify-content: center;
  }
}

/* ── Agenda View ── */
.agenda-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--gradient-card);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.agenda-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agenda-nav-btn:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--accent-teal);
  transform: translateY(-1px);
}

.agenda-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.agenda-week-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.week-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.week-range {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.agenda-week {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.06);
  min-height: auto;
  align-items: start;
}

.agenda-day {
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: auto;
  height: 100%;
}

.agenda-day.has-events {
  background: var(--bg-secondary);
}

.agenda-day.no-events {
  background: var(--bg-input);
}

.agenda-day.is-holiday {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(255, 107, 107, 0.03));
  border: 2px solid rgba(255, 107, 107, 0.2);
}

.agenda-day.is-holiday .agenda-day-header {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.08));
}

.holiday-badge {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.holiday-message {
  text-align: center;
  padding: 40px 16px;
  color: #c13030;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.holiday-message::before {
  content: '🏖️';
  font-size: 2rem;
}

.agenda-day-header {
  padding: 16px 12px;
  background: var(--bg-input);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.agenda-day-header .day-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agenda-day-header .day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.agenda-day-content {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: visible;
}

.no-events-msg {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.agenda-event {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px;
  border-left: 4px solid;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.agenda-event:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.agenda-event.tipo-cla { border-left-color: var(--color-cla); }
.agenda-event.tipo-pra { border-left-color: var(--color-pra); }
.agenda-event.tipo-exa { border-left-color: var(--color-exa); }
.agenda-event.tipo-lab { border-left-color: var(--color-lab); }
.agenda-event.tipo-dir { border-left-color: var(--color-dir); }
.agenda-event.tipo-tal { border-left-color: var(--color-tal); }

.agenda-event .event-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.agenda-event .event-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agenda-event .event-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agenda-event .event-code {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.agenda-event .event-type {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.agenda-event .event-room {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.4;
}

/* Responsive Agenda */
@media (max-width: 1024px) {
  .agenda-week {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .agenda-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .agenda-nav-btn {
    width: 100%;
    justify-content: center;
  }
  
  .agenda-week {
    grid-template-columns: 1fr;
    gap: 8px;
    background: transparent;
    padding: 12px;
  }
  
  .agenda-day {
    border-radius: var(--radius-md);
    min-height: auto;
    box-shadow: var(--shadow-sm);
  }
  
  .agenda-day-content {
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .agenda-event {
    flex: 1;
    min-width: 200px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ── Faculty Selector ── */
.faculty-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.faculty-selector label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.faculty-selector select {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 28px 6px 12px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(0,0,0,0.06);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238e8ea0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
  transition: all var(--transition-fast);
}

.faculty-selector select:focus {
  border-color: var(--accent-teal);
}

/* ── Notification Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-med);
  max-width: 360px;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--accent-teal);
}

.toast.error {
  background: var(--accent-coral);
}
