/* ===== VARIABLES CSS ===== */
:root {
  /* Colores principales */
  --ecl-primary: #0b71b1;
  --ecl-secondary: #3b82f6;
  --ecl-accent: #06b6d4;
  --ecl-dark: #1f2937;
  --ecl-light: #f8fafc;
  --ecl-success: #10b981;
  --ecl-warning: #f59e0b;
  --ecl-danger: #ef4444;
  
  /* Tonos de grises */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transiciones */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  /* Espaciado */
  --navbar-height: 70px;
  --sidebar-width: 280px;
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== NAVBAR PRINCIPAL ===== */
.navbar {
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  z-index: 1030;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
}

/* ===== BRAND/LOGO ===== */
.navbar-brand-container {
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0;
  margin-right: 2rem;
  transition: transform var(--transition-fast);
}

.navbar-brand:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.brand-logo {
  position: relative;
  margin-right: 0.75rem;
}

.brand-image {
  width: 120px;
  height: 50px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow);
  transition: all var(--transition-fast);
}

.navbar-brand:hover .brand-image {
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ecl-primary);
  letter-spacing: -0.025em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== NAVEGACIÓN ===== */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--ecl-primary);
  background-color: var(--gray-100);
  text-decoration: none;
}

.nav-link.active {
  color: var(--ecl-primary);
  background-color: rgba(11, 113, 177, 0.1);
}

.nav-link i {
  width: 20px;
  text-align: center;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.nav-text {
  white-space: nowrap;
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  margin-top: 0.5rem;
  min-width: 220px;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 0.125rem;
}

.dropdown-item:hover {
  color: var(--ecl-primary);
  background-color: var(--gray-100);
  text-decoration: none;
  transform: translateX(2px);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 0.5rem;
  font-size: 0.75rem;
}

.dropdown-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-color: var(--gray-200);
}

/* ===== DROPDOWN USUARIO ===== */
.user-dropdown .nav-link {
  padding: 0.375rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
}

.user-dropdown .nav-link:hover {
  background: var(--gray-200);
}

.user-avatar {
  position: relative;
  margin-right: 0.5rem;
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--ecl-danger);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.25rem;
  border-radius: 50px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu {
  min-width: 280px;
  padding: 0;
}

.user-info {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: -0.5rem -0.5rem 0.5rem;
}

.user-details {
  display: flex;
  align-items: center;
}

.user-info-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.75rem;
  border: 3px solid white;
  box-shadow: var(--shadow);
}

.user-info-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.125rem;
}

.user-info-email {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.user-badge {
  background: var(--ecl-primary);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
  border-radius: 50px;
  font-weight: 600;
}

.notification-count {
  background: var(--ecl-danger);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 50px;
  margin-left: auto;
  font-weight: 600;
}

.logout-item {
  color: var(--ecl-danger);
}

.logout-item:hover {
  color: var(--ecl-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

/* ===== NAVBAR TOGGLER ===== */
.navbar-toggler {
  border: none;
  padding: 0.375rem;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2875, 85, 99, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 24px;
  height: 24px;
}

/* ===== OFFCANVAS MÓVIL ===== */
.offcanvas {
  background: white;
  border-left: 1px solid var(--gray-200);
}

.offcanvas-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.offcanvas-brand {
  display: flex;
  align-items: center;
}

.offcanvas-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  margin-right: 0.75rem;
}

.offcanvas-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ecl-primary);
  display: block;
  line-height: 1.2;
}

.offcanvas-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.offcanvas-body {
  padding: 1rem;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.mobile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  border: 3px solid white;
  box-shadow: var(--shadow);
}

.mobile-user-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.mobile-user-email {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ===== BOTÓN AUTH ===== */
.navbar-auth {
  display: flex;
  align-items: center;
}

.btn-outline-primary {
  border-color: var(--ecl-primary);
  color: var(--ecl-primary);
  border-radius: var(--radius-lg);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-primary:hover {
  background-color: var(--ecl-primary);
  border-color: var(--ecl-primary);
  color: white;
}

/* ===== SCROLL TOP BUTTON ===== */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--ecl-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  z-index: 1000;
  text-decoration: none;
}

.scroll-top:hover {
  background: var(--ecl-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: white;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  min-height: calc(100vh - var(--navbar-height));
  padding-top: 1rem;
}

/* ===== ANIMACIONES ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .nav-text {
    display: none;
  }
  
  .navbar-brand .brand-text {
    display: none;
  }
  
  .brand-image {
    width: 36px;
    height: 36px;
  }
  
  .nav-link {
    padding: 0.5rem;
  }
  
  .user-name {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .navbar-nav {
    gap: 0;
  }
  
  .nav-link {
    padding: 0.375rem;
  }
  
  .nav-link i {
    margin-right: 0;
  }
}

/* ===== UTILIDADES ADICIONALES ===== */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clases de estado para futuras extensiones */
.nav-link.loading {
  opacity: 0.6;
  pointer-events: none;
}

.dropdown-item.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Footer styles remain the same */
.footer-custom {
  background: linear-gradient(135deg, var(--ecl-primary) 0%, var(--ecl-secondary) 100%);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.footer-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ecl-primary), var(--ecl-secondary), var(--ecl-accent));
}

.footer-content {
  position: relative;
  z-index: 2;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
}

.footer-links a:hover {
  color: var(--ecl-accent);
  transform: translateX(4px);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: var(--ecl-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  margin-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== BRAND MOBILE IMPROVEMENTS ===== */
.brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-text-mobile {
  display: none;
}

.brand-name-mobile {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ecl-primary);
  text-decoration: none;
  margin-left: 0.5rem;
}

/* ===== RESPONSIVE BRAND ===== */
@media (max-width: 575.98px) {
  .brand-text {
    display: none !important;
  }
  
  .brand-text-mobile {
    display: block !important;
  }
  
  .brand-image {
    display: none !important;
  }
  
  .brand-icon {
    display: block !important;
    width: 28px;
    height: 28px;
  }
  
  .navbar-brand {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
  }
  
  .brand-logo {
    display: flex;
    align-items: center;
  }
}

@media (min-width: 576px) {
  .brand-icon {
    display: none !important;
  }
  
  .brand-image {
    display: block !important;
  }
}