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

:root {
    /* Paleta Institucional - Claro (Blanco, Azul, Verde) */
    --primary: #2563EB;      /* Azul UPEL */
    --primary-hover: #1D4ED8;
    --secondary: #059669;    /* Verde Institucional */
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --glass-border: rgba(255, 255, 255, 0.5);
    
    /* Estados */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Sombras Elevación */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.4);
    
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --primary: #3B82F6;
    --primary-hover: #60A5FA;
    --secondary: #10B981;
    --background: #0F172A; /* Slate muy oscuro casi negro */
    --surface: #1E293B;
    --surface-glass: rgba(30, 41, 59, 0.75);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Transición suave al cambiar de tema en todo el body */
body {
    transition: background-color 0.4s ease, color 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === TIPOGRAFÍA === */
h1, h2, h3 { font-weight: 600; color: var(--text-main); }
p { color: var(--text-muted); line-height: 1.5; }

/* === CONTENEDORES === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    position: relative;
    overflow: hidden;
}

/* Fondo Dinámico Animado */
@keyframes fluidBg {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -50px) scale(1.1); }
    66%  { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0) 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
    animation: fluidBg 15s ease-in-out infinite;
    z-index: 1;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, rgba(5, 150, 105, 0) 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: fluidBg 18s ease-in-out infinite reverse;
    z-index: 1;
}

/* Efecto de fondo abstracto para Login */
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.1) 0%, rgba(255,255,255,0) 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.auth-card {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card h2 {
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.auth-card p.subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--background);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: var(--surface);
}

/* === BOTONES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    width: 100%;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* === ALERTAS === */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none;
}
.alert.show { display: block; animation: fadeIn 0.3s ease-in; }
.alert-error { background-color: #FEF2F2; color: var(--danger); border: 1px solid #FCA5A5; }

/* === COMPONENTES DASHBOARD === */
.navbar {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.user-info {
    text-align: right;
}
.user-info .name { font-weight: 600; font-size: 0.9rem; }
.user-info .role { font-size: 0.8rem; color: var(--text-muted); }

/* Grilla de Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--primary);
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 0.875rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase;}
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--text-main); margin-top: 0.5rem; }

/* Tickets Layout */
.tickets-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

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

.tickets-list {
    display: grid;
    gap: 1rem;
}

.ticket-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

/* Efecto brillo lateral sutil en tickets */
.ticket-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary);
    opacity: 0;
    transition: var(--transition);
}

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

.ticket-card:hover::before {
    opacity: 1;
}

.ticket-main {
    flex: 1;
}

.ticket-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.ticket-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-Abierto { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-En\ Progreso { background: rgba(37, 99, 235, 0.15); color: var(--primary); border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-Resuelto { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-Cerrado { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.3); }

/* Switch de Tema */
.theme-btn {
    background: var(--background);
    color: var(--text-main);
    border: 1px solid var(--border);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: rotate(15deg);
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    transform: scale(0.95);
    transition: var(--transition);
}

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

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

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
