/* =========================================================
   DKS Excel Course - Paleta de colores basada en logo DKS
   Azul profundo → Teal → Verde lima
   ========================================================= */

:root {
  --dks-blue-deep: #1e40af;
  --dks-blue: #2563eb;
  --dks-teal: #0891b2;
  --dks-cyan: #06b6d4;
  --dks-green: #22c55e;
  --dks-lime: #84cc16;
  --dks-lime-bright: #a3e635;
  --dks-dark: #0f172a;
  --dks-black: #000000;
  --dks-white: #ffffff;
  --dks-gray-50: #f8fafc;
  --dks-gray-100: #f1f5f9;
  --dks-gray-200: #e2e8f0;
  --dks-gray-300: #cbd5e1;
  --dks-gray-600: #475569;
  --dks-gray-800: #1e293b;
  --dks-shadow: 0 10px 40px rgba(30, 64, 175, 0.15);
  --dks-shadow-hover: 0 20px 60px rgba(30, 64, 175, 0.25);
  --dks-gradient: linear-gradient(135deg, #1e40af 0%, #0891b2 40%, #22c55e 80%, #a3e635 100%);
  --dks-gradient-soft: linear-gradient(135deg, #dbeafe 0%, #cffafe 50%, #dcfce7 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dks-gray-800);
  background: var(--dks-gray-50);
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--dks-gradient);
  padding: 1rem 2rem;
  box-shadow: var(--dks-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-badge {
  background: var(--dks-black);
  color: var(--dks-white);
  font-weight: 900;
  font-size: 1.5rem;
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  letter-spacing: 2px;
  border: 3px solid var(--dks-white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  font-family: 'Impact', 'Arial Black', sans-serif;
  transform: skew(-5deg);
}

.navbar-title {
  color: var(--dks-white);
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.navbar-nav {
  display: flex;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

.navbar-nav a {
  color: var(--dks-white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
}

/* ===== HERO ===== */
.hero {
  background: var(--dks-gradient);
  color: var(--dks-white);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 40%);
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  line-height: 1.1;
}

.hero-tagline {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-stat {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 900;
  display: block;
}

.hero-stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  text-align: center;
  margin: 3rem 0 2rem;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 900;
  background: var(--dks-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--dks-gray-600);
  font-size: 1.1rem;
}

/* ===== MODULE GRID ===== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.module-card {
  background: var(--dks-white);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--dks-shadow);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--dks-gradient);
}

.module-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--dks-shadow-hover);
  border-color: var(--dks-cyan);
}

.module-card .module-number {
  display: inline-block;
  background: var(--dks-gradient);
  color: var(--dks-white);
  font-weight: 900;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.module-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dks-gray-800);
  margin-bottom: 0.5rem;
}

.module-card p {
  color: var(--dks-gray-600);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.module-card .module-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--dks-teal);
  font-weight: 600;
}

/* ===== EXERCISE ===== */
.exercise {
  background: var(--dks-white);
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: var(--dks-shadow);
  border-left: 6px solid var(--dks-cyan);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.exercise-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dks-gray-800);
  flex: 1;
  min-width: 250px;
}

.exercise-badge {
  background: var(--dks-gradient);
  color: var(--dks-white);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.difficulty {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty.basic { background: #dcfce7; color: #166534; }
.difficulty.intermediate { background: #dbeafe; color: #1e40af; }
.difficulty.advanced { background: #fef3c7; color: #92400e; }

.exercise-context {
  background: var(--dks-gray-50);
  border-left: 4px solid var(--dks-lime);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
}

.exercise-context strong {
  color: var(--dks-blue-deep);
}

.exercise-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dks-gray-800);
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  border-radius: 8px;
  border: 2px dashed var(--dks-cyan);
}

.exercise-question::before {
  content: "❓ ";
}

/* ===== DATA TABLE ===== */
.data-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--dks-white);
  font-size: 0.9rem;
  min-width: 500px;
}

.data-table thead {
  background: var(--dks-gradient);
  color: var(--dks-white);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.2);
}

.data-table td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--dks-gray-200);
}

.data-table tbody tr:nth-child(even) {
  background: var(--dks-gray-50);
}

.data-table tbody tr:hover {
  background: #ecfeff;
}

.data-table .cell-ref {
  color: var(--dks-gray-600);
  font-family: 'Consolas', monospace;
  font-size: 0.75rem;
  font-weight: normal;
}

/* ===== DOWNLOAD BUTTONS ===== */
.exercise-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #ecfeff 50%, #f0fdf4 100%);
  border-radius: 10px;
  border: 1px dashed var(--dks-cyan);
}

.exercise-downloads::before {
  content: "📎";
  font-size: 1.2rem;
  align-self: center;
  margin-right: 0.25rem;
}

.btn-download {
  background: var(--dks-white);
  color: var(--dks-blue-deep);
  border: 2px solid var(--dks-blue);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
}

.btn-download:hover {
  background: var(--dks-blue);
  color: var(--dks-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-download-solution {
  border-color: var(--dks-green);
  color: #166534;
}

.btn-download-solution:hover {
  background: var(--dks-green);
  color: var(--dks-white);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-download-disabled {
  border-color: var(--dks-gray-300);
  color: var(--dks-gray-600);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-download-disabled:hover {
  background: var(--dks-white);
  color: var(--dks-gray-600);
  transform: none;
  box-shadow: none;
}

/* ===== SOLUTION TOGGLE ===== */
.solution-toggle {
  background: var(--dks-gradient);
  color: var(--dks-white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  margin: 1rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.solution-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.solution-toggle::before {
  content: "🔍";
}

.solution-toggle.active::before {
  content: "🔒";
}

.solution {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.solution.active {
  max-height: 8000px;
  transition: max-height 1s ease-in;
}

.solution-inner {
  background: var(--dks-gray-50);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1rem;
  border: 2px solid var(--dks-gray-200);
}

.solution h4 {
  color: var(--dks-blue-deep);
  margin: 1.25rem 0 0.5rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.solution h4:first-child {
  margin-top: 0;
}

.solution h4.how::before { content: "⚙️"; }
.solution h4.why::before { content: "💡"; }
.solution h4.formula::before { content: "🧮"; }
.solution h4.steps::before { content: "📝"; }

.formula-box {
  background: var(--dks-dark);
  color: #a3e635;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.95rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  border-left: 4px solid var(--dks-lime-bright);
  white-space: pre-wrap;
  word-break: break-word;
}

.formula-box .comment {
  color: #94a3b8;
}

.formula-en-wrapper {
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
}

.formula-en-label {
  font-size: 0.75rem;
  color: var(--dks-gray-600);
  margin: 0.5rem 0 0.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
}

.formula-box-en {
  background: #0c1b33 !important;
  border-left-color: #60a5fa !important;
  color: #93c5fd !important;
  font-size: 0.9rem !important;
  margin-top: 0 !important;
  opacity: 0.95;
}

.function-box-bilingual {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: flex !important;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 60% !important;
  padding: 0.3rem 0.55rem !important;
}

.function-box-bilingual .fn-es {
  color: var(--dks-lime-bright);
  font-size: 0.8rem;
  line-height: 1.3;
}

.function-box-bilingual .fn-en {
  color: #93c5fd;
  font-size: 0.72rem;
  line-height: 1.3;
  opacity: 0.85;
  border-top: 1px dashed rgba(147, 197, 253, 0.25);
  padding-top: 0.2rem;
}

.function-box-bilingual .fn-en::before {
  content: "EN: ";
  opacity: 0.7;
}

.steps-list {
  list-style: none;
  counter-reset: step-counter;
  margin: 1rem 0;
}

.steps-list li {
  counter-increment: step-counter;
  padding: 0.75rem 1rem 0.75rem 3rem;
  margin: 0.5rem 0;
  background: var(--dks-white);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dks-gradient);
  color: var(--dks-white);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.why-box {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border-left: 4px solid #ca8a04;
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 0.75rem 0;
  color: #713f12;
}

.tip-box {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-left: 4px solid var(--dks-green);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 0.75rem 0;
}

.tip-box strong {
  color: #166534;
}

.tip-box::before {
  content: "💡 TIP: ";
  font-weight: 800;
  color: #166534;
}

/* ===== SHORTCUTS ===== */
.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.shortcut {
  background: var(--dks-white);
  border: 2px solid var(--dks-cyan);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--dks-gray-800);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.shortcut kbd {
  background: var(--dks-gray-800);
  color: var(--dks-white);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Consolas', monospace;
  margin: 0 0.1rem;
  box-shadow: 0 2px 0 #000;
}

/* ===== MODULE TABS ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--dks-gray-200);
  padding-bottom: 0;
}

.tab {
  background: var(--dks-gray-100);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 700;
  color: var(--dks-gray-600);
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  background: var(--dks-gray-200);
  color: var(--dks-gray-800);
}

.tab.active {
  background: var(--dks-gradient);
  color: var(--dks-white);
  box-shadow: 0 -4px 12px rgba(30, 64, 175, 0.2);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s;
}

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

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

/* ===== CHEAT SHEET ===== */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.cheat-card {
  background: var(--dks-white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--dks-shadow);
  border-top: 5px solid var(--dks-cyan);
}

.cheat-card h3 {
  color: var(--dks-blue-deep);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--dks-gray-100);
}

.cheat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--dks-gray-200);
  gap: 1rem;
  font-size: 0.88rem;
}

.cheat-item:last-child {
  border-bottom: none;
}

.cheat-item .desc {
  color: var(--dks-gray-800);
  flex: 1;
}

.cheat-item .keys {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cheat-item code {
  background: var(--dks-dark);
  color: var(--dks-lime-bright);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--dks-gray-200);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--dks-gradient);
  transition: width 0.4s;
  border-radius: 4px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dks-dark);
  color: var(--dks-white);
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

.footer a {
  color: var(--dks-lime-bright);
  text-decoration: none;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--dks-gradient);
  color: var(--dks-white);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--dks-white);
  border: 2px solid var(--dks-white);
}

.btn-outline:hover {
  background: var(--dks-white);
  color: var(--dks-blue-deep);
}

/* ===== UTIL ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }
  .navbar-nav {
    width: 100%;
    justify-content: center;
  }
  .hero {
    padding: 2.5rem 1rem;
  }
  .container {
    padding: 1rem;
  }
  .exercise {
    padding: 1.25rem;
  }
  .cheat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
