/* ============================================
   RINOTRACK - SISTEMA DE TEMAS MODERNOS
   Plantilla base minimalista y tecnológica
   ============================================ */

:root {
  /* === COLORES PRINCIPALES === */
  --primary-color: #f6f7f9;
  --primary-light: #3b82f6;
  --primary-dark: #f6f8fd;
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  
  /* === COLORES SECUNDARIOS === */
  --secondary-color: #60a5fa;
  --secondary-light: #93c5fd;
  --secondary-dark: #2563eb;
  
  /* === COLORES DE FONDO === */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-accent: #e5e7eb;
  --bg-dark: #0f172a;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-dark: rgba(15, 23, 42, 0.9);
  
  /* === COLORES DE TEXTO === */
  --text-primary: #1e3a8a;
  --text-secondary: #1e3a8a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --text-white: #ffffff;
  
  /* === COLORES DE ESTADO === */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* === SOMBRAS Y EFECTOS === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  /* === BORDES Y RADIOS === */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* === ESPACIADO === */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* === TIPOGRAFÍA === */
  --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* === TRANSICIONES === */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* === EFECTOS GLASSMORFISMO === */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-backdrop: blur(10px);
}

/* Normalización de enlaces para que no cambien por estado visitado */
a, a:link, a:visited { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* === TEMA OSCURO === */
[data-theme="dark"] {
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-accent: #e5e7eb;
  --bg-glass: rgba(255, 255, 255, 0.9);
  
  --text-primary: #1e3a8a;
  --text-secondary: #1e3a8a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  
  --glass-bg: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(229, 231, 235, 0.3);
  
  /* === COLORES TRANSLÚCIDOS PROYECTA === */
  --translucent-blue: rgba(59, 130, 246, 0.3);
  --translucent-dark-blue: rgba(30, 58, 138, 0.4);
  --accent-blue: #dbeafe;
  --accent-light-blue: #eff6ff;
}

/* === COLORES TRANSLÚCIDOS PROYECTA (TEMA PRINCIPAL) === */
:root {
  --translucent-blue: rgba(59, 130, 246, 0.3);
  --translucent-dark-blue: rgba(30, 58, 138, 0.4);
  --accent-blue: #dbeafe;
  --accent-light-blue: #eff6ff;
}

/* === TEMA TECH BLUE === */
[data-theme="tech-blue"] {
  --primary-color: #0ea5e9;
  --primary-light: #38bdf8;
  --primary-dark: #0284c7;
  --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
  
  --secondary-color: #06b6d4;
  --bg-secondary: #f0f9ff;
  --bg-tertiary: #e0f2fe;
}

/* === TEMA FOREST GREEN === */
[data-theme="forest"] {
  --primary-color: #059669;
  --primary-light: #10b981;
  --primary-dark: #047857;
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  
  --secondary-color: #0d9488;
  --bg-secondary: #f0fdf4;
  --bg-tertiary: #dcfce7;
}

/* === TEMA SUNSET === */
[data-theme="sunset"] {
  --primary-color: #f59e0b;
  --primary-light: #fbbf24;
  --primary-dark: #d97706;
  --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  
  --secondary-color: #f97316;
  --bg-secondary: #fffbeb;
  --bg-tertiary: #fef3c7;
}

/* === RESET Y BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: var(--font-weight-normal);
  transition: all var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === UTILIDADES GLOBALES === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
}

/* === FONDOS AZULES GLOBALES === */
html, body {
  background: var(--bg-primary) !important;
}

.main-content, .content-section, .stats-section {
  background: var(--bg-primary);
}

.modern-dashboard {
  background: var(--bg-primary);
}

.gradient-bg {
  background: var(--primary-gradient);
}

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--bg-accent);
  transition: all var(--transition-normal);
}

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

/* === NAVEGACIÓN MODERNA (global) === */
.modern-dashboard { min-height: 100vh; background: var(--bg-secondary); }
.modern-nav { background: var(--bg-glass); backdrop-filter: var(--glass-backdrop); border-bottom: 1px solid var(--glass-border); padding: var(--spacing-md) 0; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 var(--spacing-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-xl); }
.nav-brand { display: flex; align-items: center; gap: var(--spacing-md); }
.brand-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--text-white); font-size: 1.2rem; background: var(--primary-gradient); }
.brand-text { font-size: 1.5rem; font-weight: var(--font-weight-bold); color: var(--text-primary); background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-menu { display: flex; list-style: none; gap: var(--spacing-sm); }
.nav-item .nav-link { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-md) var(--spacing-lg); border-radius: var(--radius-md); text-decoration: none; color: var(--text-secondary); font-weight: var(--font-weight-medium); transition: all var(--transition-normal); position: relative; overflow: hidden; }
.nav-item .nav-link:hover { color: var(--primary-color); background: var(--bg-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nav-item.active .nav-link { background: var(--primary-gradient); color: var(--text-white); box-shadow: var(--shadow-glow); }
.user-menu { display: flex; align-items: center; gap: var(--spacing-md); }
.modern-avatar { position: relative; width: 45px; height: 45px; background: var(--primary-gradient); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; color: var(--text-white); font-weight: var(--font-weight-semibold); box-shadow: var(--shadow-md); }
.status-dot { position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; background: var(--success); border: 2px solid var(--bg-primary); border-radius: var(--radius-full); }
.main-content { max-width: 1400px; margin: 0 auto; padding: var(--spacing-xl) var(--spacing-lg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--bg-accent);
}

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

/* === ANIMACIONES === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

.animate-slide-in {
  animation: slideIn 0.6s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  :root {
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --radius-lg: 16px;
  }
}

/* ============================================
   DROPDOWN MENU STYLES
   ============================================ */

.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-arrow {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(99, 102, 241, 0.8);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    min-width: 260px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
    white-space: nowrap;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-item.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu li {
    margin: 0;
    position: relative;
}

.dropdown-menu li:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.dropdown-menu li:last-child {
    margin-bottom: 0.25rem;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #374151 !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: var(--radius-md);
    margin: 0 0.5rem;
    line-height: 1.4;
}

.dropdown-link:hover {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    color: white !important;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-link i {
    width: 18px;
    height: 18px;
    text-align: center;
    opacity: 0.8;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.dropdown-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* Dark theme para dropdown */
[data-theme="dark"] .dropdown-menu {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .dropdown-link {
    color: #374151 !important;
}

[data-theme="dark"] .dropdown-link:hover {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    color: white !important;
}

[data-theme="dark"] .dropdown-menu li:not(:last-child)::after {
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
}

/* Responsive para dropdown */
@media (max-width: 1024px) {
    .dropdown-menu {
        left: auto;
        right: 0;
        transform: translateY(-10px);
        min-width: 280px;
    }
    
    .nav-item.dropdown:hover .dropdown-menu {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        min-width: 90vw;
        max-width: 340px;
        margin-top: 15px;
        z-index: 15000;
    }
    
    .nav-item.dropdown:hover .dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }
    
    .dropdown-link {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
        gap: 1.25rem;
    }
    
    .dropdown-link i {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
    
    [data-theme="dark"] .dropdown-menu {
        background: rgba(30, 41, 59, 0.98);
    }
}

@media (max-width: 480px) {
    .dropdown-menu {
        min-width: 95vw;
        margin-top: 10px;
    }
    
    .dropdown-link {
        padding: 1.5rem;
        font-size: 1.1rem;
    }
}

/* ===== MODALES DE CONFIRMACIÓN ===== */
.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirmation-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.8) translateY(-20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.confirmation-modal-overlay.show .confirmation-modal {
    transform: scale(1) translateY(0);
}

.confirmation-modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    padding: 20px 24px;
    text-align: center;
    position: relative;
}

.confirmation-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(255,255,255,0.1)"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>') no-repeat center;
    background-size: 60px;
    opacity: 0.1;
}

.confirmation-modal-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.confirmation-modal-body {
    padding: 24px;
    text-align: center;
}

.confirmation-modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.confirmation-modal-icon.warning {
    color: #ff6b6b;
}

.confirmation-modal-icon.info {
    color: #4ecdc4;
}

.confirmation-modal-icon.success {
    color: #45b7d1;
}

.confirmation-modal-message {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    white-space: pre-line;
}

.confirmation-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.confirmation-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.confirmation-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.confirmation-modal-btn:hover::before {
    left: 100%;
}

.confirmation-modal-btn.cancel {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirmation-modal-btn.cancel:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.confirmation-modal-btn.confirm {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirmation-modal-btn.confirm:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e64a19 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.confirmation-modal-btn:active {
    transform: translateY(0);
}

/* Animaciones adicionales */
@keyframes modalShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.confirmation-modal.shake {
    animation: modalShake 0.5s ease-in-out;
}

/* Responsive */
@media (max-width: 480px) {
    .confirmation-modal {
        width: 95%;
        margin: 20px;
    }
    
    .confirmation-modal-actions {
        flex-direction: column;
    }
    
    .confirmation-modal-btn {
        width: 100%;
    }
}

/* Responsive para modales regulares */
@media (max-width: 768px) {
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .action-btn {
        width: 100%;
        justify-content: center;
    }
}