/* Reset y variables */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #8b0000;
    --accent-hover: #b30000;
    --dark-color: #0a0a0a;
    --light-color: #f8f8f8;
    --white: #ffffff;
    --text-color: #2a2a2a;
    --text-muted: #666666;
    --error-color: #8b0000;
    --success-color: #1a4d2e;
    --warning-color: #8b6914;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.25);
    --shadow-red: 0 0 20px rgba(139, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Efectos paranormales sutiles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 0, 0, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: pulseAura 8s ease-in-out infinite;
}

@keyframes pulseAura {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--accent-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.logo:hover {
    text-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
    transform: scale(1.05);
}

/* Navegación */
nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.3), transparent);
    transition: left 0.5s ease;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    background: rgba(139, 0, 0, 0.2);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.3);
}

nav a.active {
    background: var(--accent-color);
    box-shadow: var(--shadow-red);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--white);
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

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

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #5a0000 100%);
    box-shadow: var(--shadow-red);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #8b0000 0%, #4a0000 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #0f2818 100%);
}

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

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Alertas */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid var(--error-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transition: left 0.8s ease;
}

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

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.card-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

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

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

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

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

/* Main content */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 2px solid var(--accent-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.3);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(139, 0, 0, 0.3);
    opacity: 0.7;
}

/* Tabla */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

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

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: #f8f8f8;
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

/* Paginación */
.pagination {
    margin: 2rem 0;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    justify-content: center;
}

.pagination a {
    padding: 0.6rem 1.2rem;
    background: var(--white);
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination a:hover,
.pagination a.active {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-red);
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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