/* ========================================
   MODERN THEME - Sistema de Gestión Escolar
   Sistema de diseño moderno y profesional
======================================== */

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

/* ========================================
   VARIABLES CSS - SISTEMA DE DISEÑO
======================================== */
:root {
    /* === COLORES BASE === */
    --primary: #484A67;
    --secondary: #DADDEC;
    --tertiary: #EEF4FE;
    --white: #FFFFFF;

    /* === COLORES DE ACENTO === */
    --accent-blue: #4F46E5;
    --accent-purple: #7C3AED;
    --accent-green: #10B981;
    --accent-orange: #F59E0B;
    --accent-red: #EF4444;

    /* === GRADIENTES MODERNOS === */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-info: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    --gradient-warm: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%);
    --gradient-cool: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);

    /* === SOMBRAS MODERNAS === */
    --shadow-xs: 0 1px 4px rgba(72, 74, 103, 0.06);
    --shadow-sm: 0 2px 8px rgba(72, 74, 103, 0.08);
    --shadow-md: 0 4px 16px rgba(72, 74, 103, 0.12);
    --shadow-lg: 0 8px 32px rgba(72, 74, 103, 0.16);
    --shadow-xl: 0 12px 48px rgba(72, 74, 103, 0.20);

    /* === GLASSMORPHISM === */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);

    /* === TIPOGRAFÍA === */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* === ESPACIADO === */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* === BORDER RADIUS === */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* === TRANSICIONES === */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ESTILOS BASE
======================================== */
body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    background: var(--tertiary);
    color: var(--primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sticky Footer Layout */
body.page-with-navbar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px;
    /* Espacio para navbar fixed-top */
}

/* ========================================
   TARJETAS (CARDS)
======================================== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    overflow: hidden;
}

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

/* Tarjetas del menú principal */
.card-menu {
    cursor: pointer;
    position: relative;
    transition: all var(--transition-smooth);
}

.card-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-smooth);
}

.card-menu:hover::before {
    transform: scaleX(1);
}

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

/* Tarjetas con gradiente */
.card-gradient {
    background: var(--gradient-primary);
    color: white;
}

.card-gradient h1,
.card-gradient h2,
.card-gradient h3,
.card-gradient h4,
.card-gradient h5,
.card-gradient h6,
.card-gradient p,
.card-gradient span {
    color: white !important;
}

/* Tarjetas glassmorphism */
.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================
   BOTONES
======================================== */
.btn {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    background: var(--gradient-primary);
}

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

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

.btn-info {
    background: var(--gradient-info);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ========================================
   FORMULARIOS
======================================== */
.form-control,
.form-select {
    font-family: var(--font-primary);
    border-radius: var(--radius-md);
    border: 2px solid var(--secondary);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
    font-size: 0.95rem;
    background: var(--white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
    background: var(--white);
}

.form-label {
    font-weight: var(--font-weight-medium);
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

/* Floating labels */
.form-floating label {
    color: var(--primary);
    opacity: 0.7;
}

.form-floating .form-control:focus~label,
.form-floating .form-select:focus~label {
    color: var(--accent-blue);
    opacity: 1;
}

/* ========================================
   TABLAS
======================================== */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-primary);
}

.table thead {
    background: var(--gradient-primary);
    color: white;
}

.table thead th {
    font-weight: var(--font-weight-semibold);
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: all var(--transition-base);
    border-bottom: 1px solid var(--secondary);
}

.table tbody tr:hover {
    background: var(--tertiary);
    transform: scale(1.005);
    box-shadow: var(--shadow-sm);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

/* ========================================
   MODALES
======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: var(--font-weight-semibold);
    color: white !important;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--secondary);
    padding: 1rem 1.5rem;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

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

/* Animación escalonada para tarjetas del menú */
.card-menu:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.card-menu:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.card-menu:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.card-menu:nth-child(4) {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.card-menu:nth-child(5) {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.card-menu:nth-child(6) {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.card-menu:nth-child(7) {
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.card-menu:nth-child(8) {
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

/* ========================================
   LOADING STATES
======================================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--secondary) 25%,
            var(--tertiary) 50%,
            var(--secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner-border {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   UTILIDADES
======================================== */
.hover-lift {
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: all var(--transition-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

/* Badge modernos */
.badge {
    font-weight: var(--font-weight-medium);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
}

/* Alertas modernas */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--accent-green);
    color: #065f46;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-blue);
    color: #1e40af;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--accent-orange);
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--accent-red);
    color: #991b1b;
}

/* ========================================
   NAVBAR MODERNA
======================================== */
.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.navbar-brand {
    font-weight: var(--font-weight-bold);
    color: var(--primary) !important;
}

.nav-link {
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 80%;
}

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

    .card {
        margin-bottom: var(--spacing-md);
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

/* Touch friendly para dispositivos móviles */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        /* Evita zoom automático en iOS */
    }
}