/* ============================================================
   ClassPlanU – cpu.css
   © Dr. Gerardo Ch. Chinguel – ITED
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:  #0568A0;
  --blue-mid:   #0682c4;
  --blue-light: #0BA5E9;
  --surface:    #F7FAFC;
  --white:      #ffffff;
  --text-dark:  #1A202C;
  --text-mid:   #4A5568;
  --nav-h:      64px;
  --radius:     16px;
  --shadow-sm:  0 2px 8px rgba(5,104,160,.12);
  --shadow-md:  0 6px 24px rgba(5,104,160,.18);
  --shadow-lg:  0 12px 40px rgba(5,104,160,.22);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html, body {
  min-height: 100%;
  width: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* Full-page blue gradient background behind everything */
body {
  background: linear-gradient(160deg, #daedf9 0%, #f0f8ff 40%, var(--surface) 100%);
  background-attachment: fixed;
}

/* ══════════════════════════════════════
   TOP NAV BAR
══════════════════════════════════════ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 4px 20px rgba(5,104,160,.35);
  gap: 4px;
  /* Hidden on home page */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}

/* Nav shown when a module is active */
.topnav.nav-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Nav icons */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
  border: none;
  transition: background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.18);
  transform: scale(1.08);
}
.nav-item.active {
  background: rgba(255,255,255,.25);
}
.nav-item .material-symbols-outlined {
  font-size: 26px;
  color: var(--white);
  line-height: 1;
}

/* Tooltip */
.nav-item::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.85);
  transform-origin: top center;
  background: var(--text-dark);
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Separator */
.nav-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.25);
  flex-shrink: 0;
  margin: 0 4px;
}

/* App name right */
.nav-brand {
  margin-left: auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.02em;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.15);
  user-select: none;
}
.nav-brand span {
  color: rgba(255,255,255,.7);
}

/* ══════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════ */
.page-wrap {
  padding-top: 0;         /* no padding on home page */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: padding-top .3s ease;
}

/* When nav is visible (module views), push content down */
body.nav-visible .page-wrap {
  padding-top: calc(var(--nav-h) + 20px);
}

/* ══════════════════════════════════════
   VIEWS (home + module panels)
══════════════════════════════════════ */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: fadeUp .35s ease both;
}
.view.active {
  display: flex;
}

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

/* ══════════════════════════════════════
   HOME VIEW
══════════════════════════════════════ */
.hero {
  width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 24px 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,165,233,.14), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; bottom: -60px; left: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(5,104,160,.08), transparent 70%);
  pointer-events: none;
}
.logo-wrap img {
  width: 350px; max-width: 82vw; height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(5,104,160,.2));
  position: relative; z-index: 1;
  animation: fadeSlideDown .6s ease both;
}
.subtitle {
  margin-top: 12px;
  font-size: 14px; font-weight: 500;
  color: var(--blue-dark);
  text-align: center; max-width: 400px; line-height: 1.55;
  position: relative; z-index: 1;
  animation: fadeSlideDown .7s .08s ease both;
}
.divider {
  width: 90%; max-width: 560px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-light), transparent);
  margin: 26px auto 0; border-radius: 2px;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Home button grid */
.home-grid-wrap {
  width: 100%;
  margin: 0;
  padding: 24px 20px 48px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.btn-card {
  background: #e8f4fd;
  border: 1.5px solid #a0b8cc;
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  animation: cardPop .45s calc(var(--i,0)*.07s + .25s) ease both;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(11,165,233,.06), rgba(5,104,160,.03));
  opacity: 0; transition: opacity var(--transition);
}
.btn-card:hover { transform: translateY(-6px) scale(1.025); box-shadow: var(--shadow-lg); background: #d0e8f7; border-color: var(--blue-light); }
.btn-card:hover::before { opacity: 1; }
.btn-card:active { transform: translateY(-2px) scale(1.01); }

.icon-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(11,165,233,.35);
  transition: box-shadow var(--transition), transform var(--transition);
}
.btn-card:hover .icon-wrap { box-shadow: 0 8px 28px rgba(11,165,233,.5); transform: scale(1.08) rotate(-4deg); }
.icon-wrap .material-symbols-outlined { font-size: 36px; color: var(--white); line-height: 1; }
.btn-label { font-size: 13px; font-weight: 600; color: var(--blue-dark); text-align: center; line-height: 1.4; }

@keyframes cardPop {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Ripple */
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(11,165,233,.22);
  transform: scale(0);
  animation: ripple .55s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ══════════════════════════════════════
   MODULE CONTENT VIEW
══════════════════════════════════════ */
.module-view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.module-header {
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
  padding: 22px 20px 20px;
  margin: 0 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
.module-header .mh-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.module-header .mh-icon .material-symbols-outlined {
  font-size: 30px; color: var(--white);
}
.module-header h1 {
  font-size: 22px; font-weight: 700; color: var(--white);
  text-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.module-header p {
  font-size: 13px; color: rgba(255,255,255,.8); margin-top: 2px;
}

.module-body {
  flex: 1;
  padding: 20px 20px 48px;
  width: 100%;
}

.content-card {
  background: #e8f4fd;
  border: 1.5px solid #a0b8cc;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
  animation: fadeUp .3s ease both;
}
.content-card h2 {
  font-size: 16px; font-weight: 700; color: var(--blue-dark);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.content-card h2 .material-symbols-outlined { font-size: 20px; color: var(--blue-light); }
.content-card p {
  font-size: 14px; color: var(--text-mid); line-height: 1.7;
}
.content-card ul {
  margin-top: 10px; padding-left: 20px;
}
.content-card ul li {
  font-size: 14px; color: var(--text-mid); line-height: 1.8; margin-bottom: 4px;
}

/* Coming soon placeholder */
.coming-soon {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px;
  padding: 60px 24px;
  text-align: center;
}
.coming-soon .cs-icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.coming-soon .cs-icon .material-symbols-outlined { font-size: 44px; color: var(--white); }
.coming-soon h2 { font-size: 20px; font-weight: 700; color: var(--blue-dark); }
.coming-soon p { font-size: 14px; color: var(--text-mid); max-width: 360px; line-height: 1.6; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
  color: var(--white); font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 99px;
  letter-spacing: .04em;
}
.badge .material-symbols-outlined { font-size: 15px; }

/* ══════════════════════════════════════
   TAB SYSTEM (Silabo)
══════════════════════════════════════ */
.tab-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.tab-nav {
  display: flex;
  gap: 12px;
  padding: 0 20px;
  margin-top: 20px;
  border-bottom: 2px solid rgba(160, 184, 204, 0.3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
}
.tab-btn .material-symbols-outlined { font-size: 20px; transition: transform var(--transition); }
.tab-btn:hover { color: var(--blue-dark); }
.tab-btn:hover .material-symbols-outlined { transform: scale(1.1); }

.tab-btn.active {
  color: var(--blue-dark);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--blue-dark);
  border-radius: 2px;
  animation: tabMarkerIn .3s ease both;
}

@keyframes tabMarkerIn {
  from { width: 0; left: 50%; opacity: 0; }
  to   { width: 100%; left: 0; opacity: 1; }
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: tabFadeUp .3s ease both;
}

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

/* ══════════════════════════════════════
   SILABO FORM STYLES
══════════════════════════════════════ */
.form-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 8px;
}
.form-subtitle {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.5;
}

.steps-box {
  background: rgba(11, 165, 233, 0.05);
  border-left: 4px solid var(--blue-light);
  padding: 16px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 24px;
}
.steps-box p { font-size: 14px; margin-bottom: 8px; color: var(--text-dark); line-height: 1.5; }
.steps-box p strong { color: var(--blue-dark); }

.bot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.bot-links li a {
  font-size: 13px;
  color: var(--blue-mid);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 10px;
  background: white;
  border: 1px solid var(--blue-light);
  border-radius: 6px;
  transition: all var(--transition);
}
.bot-links-literal {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bot-links-literal li {
  font-size: 13px;
  color: var(--text-dark);
}
.bot-links-literal a {
  color: var(--blue-mid);
  text-decoration: underline;
}
.bot-links-literal a:hover {
  color: var(--blue-light);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-dark);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  padding: 12px;
  border: 1.5px solid #a0b8cc;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(11, 165, 233, 0.1);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-primary:active {
  transform: translateY(0);
}

.result-box {
  margin-top: 32px;
  padding: 24px;
  background: #f1f5f9;
  border-radius: 16px;
  border: 1.5px dashed var(--blue-light);
  animation: fadeUp .4s ease both;
}
.result-box label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-box textarea {
  width: 100%;
  height: 250px;
  background: #333;
  color: #fff;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 16px;
}

.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: white;
  color: var(--blue-dark);
  border: 2px solid var(--blue-dark);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-copy:hover {
  background: var(--blue-dark);
  color: white;
}

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 16px 24px 24px;
  font-size: 12px;
  color: var(--text-mid);
  border-top: 1px solid rgba(11,165,233,.14);
  line-height: 1.5;
  background: var(--white);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 620px) {
  .grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .hero { padding: 28px 16px 22px; }
  .icon-wrap { width: 60px; height: 60px; }
  .icon-wrap .material-symbols-outlined { font-size: 30px; }
  .btn-card { padding: 20px 10px 16px; gap: 10px; }
  .btn-label { font-size: 12px; }
  .module-header { margin: 0 12px; padding: 18px 16px 16px; }
  .module-header h1 { font-size: 18px; }
  .module-body { padding: 16px 12px 40px; }
  .nav-brand { font-size: 15px; }
  .nav-item { width: 40px; height: 40px; }
  .nav-item .material-symbols-outlined { font-size: 21px; }
  .home-grid-wrap { padding: 16px 12px 40px; }
}

/* ══════════════════════════════════════
   ASISTENTE GER (IA)
══════════════════════════════════════ */
.ger-assistant-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform var(--transition), box-shadow var(--transition);
}
.ger-assistant-btn:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: var(--shadow-lg);
}
.ger-assistant-btn .material-symbols-outlined {
  font-size: 32px;
}
.ger-modal {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 340px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(160, 184, 204, 0.4);
  animation: fadeUp 0.3s ease both;
}
.ger-header {
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-mid));
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  justify-content: space-between;
}
.ger-header .btn-icon {
  background: transparent;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.ger-header .btn-icon:hover {
  opacity: 1;
}
.ger-body {
  padding: 18px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}
.ger-body strong {
  color: var(--blue-dark);
  font-size: 15px;
  display: block;
  margin-bottom: 12px;
}
.ger-body ul {
  padding-left: 20px;
  margin-top: 8px;
}
.ger-body li {
  margin-bottom: 8px;
  color: var(--text-dark);
}
