* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #800609;
    --color-primary-dark: #5a0406;
    --color-primary-light: #a3080b;
    --color-accent: #ff1a1a;
    --color-gold: #ffd700;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg-light: #f8f8f8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: var(--color-text);
    overflow-x: hidden;
}

/* Animación de fondo para Login */
body.login-page {
    background: linear-gradient(135deg, #1a0000 0%, var(--color-primary-dark) 50%, #1a0000 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
}

body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(128, 6, 9, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 26, 26, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(128, 6, 9, 0.2) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

/* Estilos para Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(128, 6, 9, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-gold), var(--color-accent), var(--color-primary));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

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

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

.login-box h2 {
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(128, 6, 9, 0.2);
    letter-spacing: -0.5px;
}

.login-box h3 {
    color: var(--color-text-light);
    text-align: center;
    margin-bottom: 35px;
    font-size: 18px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(128, 6, 9, 0.1), 0 4px 10px rgba(128, 6, 9, 0.2);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #bbb;
}

.error-message {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid #fcc;
    box-shadow: 0 4px 10px rgba(204, 51, 51, 0.2);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary) 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 8px 20px rgba(128, 6, 9, 0.4),
        0 0 0 0 rgba(128, 6, 9, 0.7);
    position: relative;
    overflow: hidden;
}

.btn-login::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-login:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 30px rgba(128, 6, 9, 0.5),
        0 0 0 4px rgba(128, 6, 9, 0.2);
    background-position: 100% 0;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(128, 6, 9, 0.4);
}

/* Estilos para Index */
body.index-page {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 25px 40px;
    box-shadow: 0 4px 20px rgba(128, 6, 9, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShine 3s infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header h1 {
    color: white;
    font-size: 36px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.user-info span {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-logout {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.container {
    max-width: 1400px;
    margin: 50px auto;
    padding: 0 20px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.module-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(128, 6, 9, 0.05);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(128, 6, 9, 0.1), transparent);
    transition: left 0.5s;
}

.module-card:hover::before {
    left: 100%;
}

.module-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(128, 6, 9, 0.25),
        0 0 0 1px rgba(128, 6, 9, 0.1);
    border-color: var(--color-primary);
}

.card-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.module-card h3 {
    color: var(--color-primary);
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 700;
    transition: color 0.3s;
}

.module-card:hover h3 {
    color: var(--color-primary-light);
}

.module-path {
    color: var(--color-text-light);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    background: var(--color-bg-light);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
}

.card-icon {
    font-size: 28px;
    color: var(--color-primary);
    font-weight: bold;
    margin-left: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.module-card:hover .card-icon {
    transform: translateX(8px) scale(1.2);
    color: var(--color-accent);
}

/* Efectos adicionales */
.module-card:nth-child(even) {
    animation-delay: 0.1s;
}

.module-card:nth-child(3n) {
    animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 20px;
    }

    .header h1 {
        font-size: 28px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .login-box {
        padding: 40px 25px;
    }

    .login-box h2 {
        font-size: 28px;
    }

    .container {
        margin: 30px auto;
        padding: 0 15px;
    }
}

/* Animación de entrada para las tarjetas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.module-card:nth-child(1) { animation-delay: 0.1s; }
.module-card:nth-child(2) { animation-delay: 0.2s; }
.module-card:nth-child(3) { animation-delay: 0.3s; }
.module-card:nth-child(4) { animation-delay: 0.4s; }
.module-card:nth-child(5) { animation-delay: 0.5s; }
.module-card:nth-child(6) { animation-delay: 0.6s; }
.module-card:nth-child(n+7) { animation-delay: 0.7s; }
