/**
 * FunCertific - Estilos Principales
 * Sistema de Gestión de Certificados
 * Diseño 3D, moderno y responsive
 */

/* ========================================
   VARIABLES CSS
======================================== */
:root {
    /* Colores Primarios */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    /* Colores Secundarios */
    --secondary: #06b6d4;
    --secondary-dark: #0891b2;
    --secondary-light: #22d3ee;
    
    /* Colores de Acento */
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    
    /* Neutros */
    --white: #ffffff;
    --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;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    
    /* Sombras 3D */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-3d: 0 20px 60px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.12);
    
    /* Bordes */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   PÁGINA DE LOGIN
======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Fondo Animado */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    z-index: -1;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

.shape-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    bottom: 20%;
    left: 10%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(50px, -50px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(0, 50px) rotate(180deg) scale(0.95);
    }
    75% {
        transform: translate(-50px, -25px) rotate(270deg) scale(1.05);
    }
}

/* Contenedor Login */
.login-container {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tarjeta de Login - Efecto 3D */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-3d);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(10deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.login-card:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Header del Login */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
    transform-style: preserve-3d;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) rotateY(0deg);
    }
    50% {
        transform: translateY(-10px) rotateY(10deg);
    }
}

.logo-icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.logo-text .fun {
    color: var(--primary);
}

.logo-text .certific {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.form-group label svg {
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: var(--transition);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Botón Login */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition-slow);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

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

.btn-login:active {
    transform: translateY(-1px);
}

/* Alertas */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: alertShake 0.5s ease;
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Footer Login */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.login-footer p {
    color: var(--gray-400);
    font-size: var(--font-size-xs);
}

/* Tarjetas Flotantes Decorativas */
.floating-cards {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.float-card {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: cardFloat 6s ease-in-out infinite;
}

.float-card svg {
    color: var(--primary);
}

.card-1 {
    top: 10%;
    left: -80px;
    animation-delay: 0s;
}

.card-2 {
    top: 60%;
    right: -80px;
    animation-delay: -2s;
}

.card-3 {
    bottom: 10%;
    left: -60px;
    animation-delay: -4s;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ========================================
   LAYOUT PRINCIPAL (DASHBOARD)
======================================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: var(--font-size-xl);
}

.header-logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: var(--font-size-sm);
}

.user-role {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-warm);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 500;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger-light);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Page Title */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: var(--font-size-base);
}

/* ========================================
   TARJETAS DE ESTADÍSTICAS
======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

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

.stat-card.primary::before {
    background: var(--gradient-primary);
}

.stat-card.secondary::before {
    background: var(--gradient-secondary);
}

.stat-card.success::before {
    background: var(--gradient-success);
}

.stat-card.warning::before {
    background: var(--gradient-warm);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: var(--gradient-primary);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.stat-icon.secondary {
    background: var(--gradient-secondary);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
}

.stat-icon.success {
    background: var(--gradient-success);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.stat-icon.warning {
    background: var(--gradient-warm);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.stat-info h3 {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
}

/* ========================================
   GRID DE CERTIFICADOS/CURSOS
======================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Tarjeta de Curso/Certificado */
.course-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-100);
}

.course-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.course-image {
    width: 100%;
    height: 180px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.course-card:hover .course-image img {
    transform: scale(1.1);
}

.course-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
}

.course-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-presencial {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.badge-virtual {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

.badge-hibrida {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.course-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-xs);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.course-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-instructor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.meta-item svg {
    width: 16px;
    height: 16px;
}

.course-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.course-price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--success);
}

.course-price span {
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    font-weight: 400;
}

/* ========================================
   BOTONES
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ========================================
   FORMULARIOS
======================================== */
.form-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title svg {
    color: var(--primary);
}

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

.form-row:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--gray-400);
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 18px;
    padding-right: 2.5rem;
}

/* Upload de Imágenes */
.image-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--gray-50);
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.image-upload-text {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin-bottom: 0.5rem;
}

.image-upload-hint {
    color: var(--gray-400);
    font-size: var(--font-size-xs);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

/* Checkbox y Switch */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: var(--radius-full);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

/* ========================================
   TABLAS
======================================== */
.table-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-800);
}

.table-search {
    position: relative;
}

.table-search input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    width: 250px;
    transition: var(--transition);
}

.table-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.table-search svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    width: 18px;
    height: 18px;
}

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

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table td {
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   MODAL
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-3d);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

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

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

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ========================================
   DETALLE DE CERTIFICADO
======================================== */
.certificate-detail {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.certificate-hero {
    height: 250px;
    background: var(--gradient-primary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
}

.certificate-body {
    padding: 2rem;
}

.certificate-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.certificate-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: var(--font-size-base);
    color: var(--gray-800);
    font-weight: 500;
}

/* Video YouTube */
.video-container {
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   SESIONES
======================================== */
.sessions-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.session-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.session-item:last-child {
    margin-bottom: 0;
}

.session-number {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.session-info {
    flex: 1;
}

.session-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.session-date {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.session-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   PARTICIPANTES
======================================== */
.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.participant-item:hover {
    background: var(--gray-100);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: var(--font-size-sm);
}

.participant-ci {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

/* ========================================
   EMPTY STATE
======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.empty-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ========================================
   LOADING
======================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   NAV TABS
======================================== */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.nav-tab {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
}

.nav-tab:hover {
    color: var(--gray-800);
}

.nav-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-title {
        font-size: var(--font-size-2xl);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .floating-cards {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        margin: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .user-details {
        display: none;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-card::before {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
    }
}

/* ========================================
   ANIMACIONES EXTRA
======================================== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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

.pulse {
    animation: pulse 2s infinite;
}

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