@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --purple: #86237D;
  --blue: #22235A;
  --orange: #EA7724;
  --yellow: #F39C12;

  /* Minimalist neutral palette */
  --bg-color: #FAFAFA;
  --surface-color: #FFFFFF;
  --text-main: #111827;
  --text-muted: #6B7280;
  --border-color: #E5E7EB;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button,
.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

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

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

/* Layouts */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

/* Header Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 24px 0;
  z-index: 1000;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--text-main);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--surface-color);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  z-index: 1001;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  top: 100%;
  left: -20px;
  padding: 8px 0;
}

.dropdown-content a {
  color: var(--text-muted);
  padding: 10px 20px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.dropdown-content a:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Buttons */
.btn-primary {
  background: var(--text-main);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--purple);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 500;
}

.btn-secondary:hover {
  border-color: var(--text-main);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 500;
  background: transparent;
}

.btn-outline:hover {
  background: var(--bg-color);
}

/* Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: var(--surface-color);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-text h1 {
  font-size: 64px;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

.hero-text h1 span.highlight {
  color: var(--purple);
}

.hero-text p {
  font-size: 18px;
  margin-bottom: 40px;
  max-width: 500px;
  line-height: 1.7;
}

/* Aval Banner */
.aval-banner {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 80px;
}

.aval-banner h2 {
  color: var(--text-main);
  font-size: 24px;
  margin-bottom: 16px;
}

.mineduc-tag {
  display: inline-block;
  background: var(--bg-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 24px;
  border: 1px solid var(--border-color);
}

/* Course Grid */
.course-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.course-controls h3 {
  font-size: 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

/* Course Card */
.card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.card-img-wrapper {
  position: relative;
  height: 200px;
  background: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--surface-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  border: 1px solid var(--border-color);
}

.price-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  border: 1px solid var(--border-color);
}

.card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text-main);
  line-height: 1.4;
}

.card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-aval {
  background: var(--bg-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  margin-top: auto;
  border: 1px solid var(--border-color);
}

.card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Details Page */
.details-hero {
  padding: 140px 0 80px;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
}

.details-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.details-title {
  font-size: 40px;
  color: var(--text-main);
  margin-bottom: 24px;
  max-width: 800px;
  letter-spacing: -0.03em;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
  color: var(--text-muted);
}

.details-form-card {
  background: var(--surface-color);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 100px;
}

.price-display {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-display span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-main);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(134, 35, 125, 0.1);
  outline: none;
}

/* Dashboard */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background-color: #E2E8F0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(234, 119, 36, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(134, 35, 125, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(34, 35, 90, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(243, 156, 18, 0.25) 0%, transparent 30%);
  background-attachment: fixed;
}

.sidebar {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.3), 4px 0 24px rgba(0, 0, 0, 0.02);
  padding: 32px 24px;
  z-index: 10;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 60px;
  display: flex;
  color: var(--text-main);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.3) transparent;
}

/* Chrome / Edge / Safari scrollbar */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

.sidebar-link {
  padding: 14px 18px;
  border-radius: 16px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.sidebar-link:not(.active):hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--blue);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue);
  box-shadow: 0 8px 24px rgba(34, 35, 90, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 1);
}

.sidebar-link.active svg {
  color: var(--orange);
}

.dashboard-content {
  padding: 48px 56px;
  background: transparent;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
}

/* Glass table container */
.table-container {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  box-shadow: 0 10px 40px -10px rgba(31, 38, 135, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 20px 24px;
  text-align: left;
}

th {
  background: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

td {
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  color: #334155;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.6);
}

.action-btn {
  background: rgba(255, 255, 255, 0.5);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #64748B;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
  border-color: #FFFFFF;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.action-btn.delete:hover {
  color: #DC2626;
  background: rgba(254, 242, 242, 0.8);
  border-color: #FECACA;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 35, 90, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 25px 50px -12px rgba(31, 38, 135, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.mt-8 {
  margin-top: 32px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-activo {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.status-inactivo {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
}

/* Responsive */
@media (max-width: 991px) {
  /* Redes Sociales Stack */
  section .container > div[style*="flex-wrap: wrap"] {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .social-accordion {
    width: 100%;
    margin-top: 20px;
    height: 300px !important;
  }
  
  /* Hero Ajustes Generales */
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  /* Slider Responsive */
  .main-slider .container {
    padding: 0 30px !important;
    text-align: center;
  }
  .main-slider h2 {
    font-size: 28px !important;
  }
  .main-slider p {
    font-size: 15px !important;
  }
  .main-slider button[onclick="prevSlide()"],
  .main-slider button[onclick="nextSlide()"] {
    width: 40px !important;
    height: 40px !important;
  }
  .main-slider button[onclick="prevSlide()"] { left: 10px !important; }
  .main-slider button[onclick="nextSlide()"] { right: 10px !important; }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    padding: 20px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    gap: 20px;
    align-items: flex-start;
  }

  .nav-links.active {
    display: flex;
  }

  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }
  
  .dropdown.active .dropdown-content,
  .dropdown:active .dropdown-content {
    display: block;
  }

  .hero {
    padding-top: 100px;
    text-align: center;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-text h1 {
    font-size: 40px;
  }
  
  .hero-text p {
    margin: 0 auto 30px auto;
    padding-right: 0 !important;
  }
  
  .hero-text > div {
    justify-content: center;
  }

  .details-content {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  /* Seccion Aliados y Cursos (margen interno tarjeta) */
  .card-footer {
    grid-template-columns: 1fr;
  }
}