/* ================================
   VARIABLES CSS
   ================================ */
:root {
  --primary-color: #0066CC;
  --primary-dark: #0052a3;
  --secondary-color: #00A86B;
  --accent-color: #FFD700;
  --text-color: #333333;
  --text-light: #666666;
  --bg-light: #F8F9FA;
  --bg-white: #FFFFFF;
  --border-color: #dee2e6;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --transition: all 0.3s ease;
}

/* ================================
   ESTILOS GLOBALES
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  line-height: 1.8;
  font-size: 16px;
  background-color: var(--bg-white);
}

/* ================================
   TIPOGRAFÍA
   ================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text-color);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-color);
}

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

a:hover {
  text-decoration: none;
}

/* ================================
   NAVBAR PERSONALIZADO
   ================================ */
.navbar {
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color) !important;
}

.navbar-brand:hover {
  color: var(--primary-dark) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  transition: var(--transition);
}

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

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ================================
   BOTONES
   ================================ */
.btn {
  font-weight: 500;
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
}

/* ================================
   CARDS
   ================================ */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ================================
   TABS Y ACCORDIONS
   ================================ */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
  color: var(--text-color);
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 1.5rem;
  transition: var(--transition);
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
  background-color: transparent;
}

.tab-content {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: 0 0 0.75rem 0.75rem;
}

/* Accordion */
.accordion {
  border-radius: 0.75rem;
  overflow: hidden;
}

.accordion-item {
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.accordion-button {
  font-weight: 600;
  color: var(--text-color);
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-white);
  transition: var(--transition);
}

.accordion-button:not(.collapsed) {
  background-color: var(--bg-light);
  color: var(--primary-color);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: var(--primary-color);
}

.accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230066CC'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-body {
  padding: 1.5rem;
}

/* ================================
   POPUP PROMOCIONAL
   ================================ */
.popup-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideInUp 0.5s ease;
  max-width: 350px;
}

.popup-content {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  border: 2px solid var(--primary-color);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.popup-close:hover {
  color: var(--primary-color);
  transform: rotate(90deg);
}

.popup-icon {
  animation: pulse 2s infinite;
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ================================
   BREADCRUMBS
   ================================ */
.breadcrumb {
  background-color: transparent;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--text-light);
}

/* ================================
   LISTAS
   ================================ */
.list-unstyled li {
  padding: 0.25rem 0;
}

ul li i,
ol li i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

/* ================================
   REFERENCIAS
   ================================ */
.references-list {
  padding-left: 1.5rem;
}

.references-list li {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.references-list a {
  color: var(--primary-color);
  text-decoration: none;
}

.references-list a:hover {
  text-decoration: underline;
}

/* ================================
   ALERTAS Y NOTIFICACIONES
   ================================ */
.alert {
  border-radius: 0.5rem;
  border: none;
}

.alert-secondary {
  background-color: var(--bg-light);
  color: var(--text-color);
}

/* ================================
   FOOTER
   ================================ */
footer {
  margin-top: 5rem;
}

footer a {
  transition: var(--transition);
}

footer a:hover {
  color: var(--accent-color) !important;
}

footer .btn-outline-light:hover {
  background-color: white;
  color: var(--primary-color);
}

/* ================================
   UTILIDADES
   ================================ */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-light {
  background-color: var(--bg-light) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .popup-container {
    bottom: 10px;
    right: 10px;
    max-width: 280px;
  }

  .popup-content {
    padding: 1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .tab-content {
    padding: 1.5rem;
  }

  footer {
    margin-top: 3rem;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .popup-container {
    max-width: 260px;
  }

  .card-body {
    padding: 1rem;
  }

  .tab-content {
    padding: 1rem;
  }
}

/* ================================
   ANIMACIONES AOS
   ================================ */
[data-aos] {
  pointer-events: auto;
}

/* ================================
   IMPRESIÓN
   ================================ */
@media print {
  .navbar,
  .popup-container,
  footer,
  .btn,
  .dropdown {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a {
    text-decoration: underline;
  }
}
