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

/* ====== CSS VARIABLES ====== */
:root {
  --sidebar-width: 280px;
  --sidebar-bg: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  --sidebar-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  --primary-color: #6366f1;
  --primary-hover: #5b5bd6;
  --accent-color: #06b6d4;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --hover-bg: rgba(99, 102, 241, 0.15);
  --border-color: rgba(255, 255, 255, 0.1);
  --success-color: #10b981;
  --danger-color: #ef4444;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --z-sidebar: 1000;
  --z-overlay: 999;
  --z-hamburger: 1001;
}

/* ====== RESET & BASE ====== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ====== SIDEBAR CONTAINER ====== */
.sidebar-nuevo {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--sidebar-shadow);
  border-right: 1px solid var(--border-color);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: var(--transition);
  overflow: hidden;
}

/* ====== SIDEBAR HEADER ====== */
.sidebar-header {
  position: relative;
  padding: 25px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.05));
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

/* Efecto de fondo animado */
.sidebar-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  animation: headerGlow 4s ease-in-out infinite alternate;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Logo ARC innovador con CSS puro */
.sidebar-logo::before {
  content: '';
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  border-radius: 10px;
  position: relative;
  display: inline-block;
  box-shadow: 
    0 4px 15px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: logoFloat 3s ease-in-out infinite alternate;
  background-image: 
    radial-gradient(circle at 8px 8px, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 32px 8px, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 8px 32px, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 32px 32px, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.6) 4px, transparent 4px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

/* ====== CLOSE BUTTON ====== */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 35px;
  height: 35px;
  display: none; /* Solo visible en móvil */
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.close-btn:hover {
  background: var(--danger-color);
  color: white;
  transform: scale(1.1);
}

/* ====== NAVIGATION ====== */
.sidebar-nav {
  flex: 1;
  padding: 20px 15px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* ====== NAVIGATION SECTIONS ====== */
.nav-section {
  margin-bottom: 30px;
}

.nav-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 20px 15px;
  opacity: 0.8;
}

/* ====== SIDEBAR LINKS ====== */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin: 6px 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: var(--transition);
  border-radius: 12px;
  z-index: 0;
}

.sidebar-link:hover::before {
  width: 100%;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
  transform: translateX(5px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.sidebar-link i {
  font-size: 18px;
  margin-right: 15px;
  width: 20px;
  text-align: center;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.sidebar-link span {
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

/* ====== ACTIVE STATE ====== */
.sidebar-link.active {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  color: white;
}

.sidebar-link.active::before {
  width: 100%;
}

/* ====== USER SECTION ====== */
.user-section {
  padding: 20px 15px 30px;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
}

.user-info {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 16px;
  color: white;
  font-weight: 600;
}

.user-details h4 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px 0;
}

.user-details p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

/* ====== LOGOUT BUTTON ====== */
.logout-btn {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  margin: 8px 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  position: relative;
  z-index: 2;
}

.logout-btn:hover {
  color: white;
  background: var(--danger-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.logout-btn i {
  font-size: 16px;
  margin-right: 12px;
}

/* ====== HAMBURGER BUTTON ====== */
.hamburger-nuevo {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: var(--z-hamburger);
  display: none; /* Solo visible en móvil por defecto */
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.hamburger-nuevo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

/* ====== OVERLAY ====== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
  display: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ====== MAIN CONTENT ADJUSTMENT ====== */
.main-content {
  transition: margin-left 0.3s ease;
}

/* ====== DESKTOP STYLES ====== */
@media screen and (min-width: 769px) {
  .sidebar-nuevo {
    transform: translateX(0) !important;
    position: fixed;
  }
  
  .main-content {
    margin-left: var(--sidebar-width);
  }
  
  .hamburger-nuevo {
    display: none;
  }
  
  .close-btn {
    display: none;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
}

/* ====== MOBILE STYLES ====== */
@media screen and (max-width: 768px) {
  .sidebar-nuevo {
    transform: translateX(-100%);
    width: 90%;
    max-width: 300px;
  }
  
  .sidebar-nuevo.open {
    transform: translateX(0);
  }
  
  .hamburger-nuevo {
    display: flex;
  }
  
  .close-btn {
    display: flex;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
}

/* ====== ANIMATIONS ====== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-link {
  animation: slideIn 0.3s ease forwards;
}

.sidebar-link:nth-child(1) { animation-delay: 0.1s; }
.sidebar-link:nth-child(2) { animation-delay: 0.2s; }
.sidebar-link:nth-child(3) { animation-delay: 0.3s; }
.sidebar-link:nth-child(4) { animation-delay: 0.4s; }
.sidebar-link:nth-child(5) { animation-delay: 0.5s; }

/* ====== LOGO ANIMATIONS ====== */
@keyframes logoFloat {
  0% {
    transform: translateY(0px) scale(1);
    box-shadow: 
      0 4px 15px rgba(99, 102, 241, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  100% {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
      0 8px 25px rgba(6, 182, 212, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

@keyframes headerGlow {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.7;
  }
}

/* ====== LOGO TEXT STYLING ====== */
.logo-text {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.logo-version {
  font-size: 11px;
  color: var(--accent-color);
  font-weight: 600;
  opacity: 0.9;
  margin-left: 4px;
  vertical-align: super;
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== UTILITIES ====== */
.hidden {
  display: none !important;
}

.show {
  display: block !important;
}

/* ====== HIGH CONTRAST MODE ====== */
@media (prefers-contrast: high) {
  :root {
    --sidebar-bg: #000000;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #333333;
  }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
