/* ============================================
   LUMINA BOT DASHBOARD - GLOBAL STYLES
   Archivo CSS global para todas las páginas
   ============================================ */

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

:root {
    /* Colores principales */
    --primary-blue: #4a90e2;
    --primary-light: #63b3ed;
    --primary-dark: #2563eb;
    
    /* Colores de fondo */
    --bg-dark: #0a0e17;
    --bg-darker: #05070d;
    --bg-card: rgba(26, 58, 92, 0.5);
    --bg-card-hover: rgba(26, 58, 92, 0.7);
    
    /* Colores de borde */
    --border-primary: rgba(74, 144, 226, 0.3);
    --border-hover: rgba(74, 144, 226, 0.8);
    
    /* Colores de texto */
    --text-primary: #ffffff;
    --text-secondary: #b8d4f1;
    --text-muted: #7ba3d1;
    
    /* Estados */
    --success: #22c55e;
    --warning: #fbbf24;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Sombras */
    --shadow-sm: 0 4px 20px rgba(74, 144, 226, 0.2);
    --shadow-md: 0 10px 40px rgba(74, 144, 226, 0.3);
    --shadow-lg: 0 20px 60px rgba(74, 144, 226, 0.5);
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* === FONDO CÓSMICO === */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0e17 0%, #1a1f35 50%, #0a0e17 100%);
    z-index: 0;
}

.cosmic-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: float 25s infinite ease-in-out;
    z-index: 0;
    pointer-events: none;
}

.glow-1 { top: -300px; left: -300px; }
.glow-2 { bottom: -300px; right: -300px; animation-delay: -12s; }
.glow-3 { top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -6s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -80px) scale(1.1); }
    66% { transform: translate(-80px, 100px) scale(0.9); }
}

/* Estrellas */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === UTILIDADES DE LAYOUT === */
.content-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-fluid {
    width: 100%;
    padding: 0 2rem;
}

/* === HEADER / NAVBAR === */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    background: rgba(10, 14, 23, 0.9);
    border-bottom: 2px solid var(--border-primary);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.6));
    transition: all var(--transition-normal);
}

.logo:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(74, 144, 226, 0.9));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #4a90e2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navegación */
nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all var(--transition-normal);
    position: relative;
}

nav a:hover {
    color: var(--text-primary);
    background: rgba(74, 144, 226, 0.15);
}

nav a.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3), rgba(99, 179, 237, 0.2));
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* === BOTONES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.6);
}

.btn-secondary {
    background: rgba(26, 58, 92, 0.6);
    color: var(--text-secondary);
    border: 2px solid var(--border-primary);
}

.btn-secondary:hover {
    background: rgba(26, 58, 92, 0.8);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #0a0e17;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Card con gradiente */
.card-gradient {
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.6), rgba(15, 35, 60, 0.6));
}

/* === GRID SYSTEM === */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(74, 144, 226, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(74, 144, 226, 0.4);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* === STATS CARDS === */
.stat-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(15, 35, 60, 0.5));
    backdrop-filter: blur(15px);
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-normal);
}

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

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-info p {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.4);
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 35, 60, 0.5);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Switch/Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(107, 114, 128, 0.5);
    transition: var(--transition-normal);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* === ALERTS === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.2);
    border: 2px solid rgba(251, 191, 36, 0.4);
    color: var(--warning);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: var(--error);
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid rgba(59, 130, 246, 0.4);
    color: var(--info);
}

/* === TABLAS === */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
}

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

thead {
    background: rgba(15, 35, 60, 0.7);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background: rgba(74, 144, 226, 0.1);
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.95), rgba(15, 35, 60, 0.95));
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* === LOADING === */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.3);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* === FOOTER === */
footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--border-primary);
}

footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--primary-light);
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-light));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-blue));
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .container,
    .container-fluid {
        padding: 0 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .modal {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 1rem;
    }

    .stat-info p {
        font-size: 2rem;
    }
}