/* Base Styles */
/* VERSIÓN CORREGIDA - TEMA OSCURO TOTAL */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #e5e5e5; /* Texto claro por defecto */
    background-color: #1a1a1a; /* Fondo oscuro consistente */
}

/* Base header styling with wave background */
header {
    position: relative;
    background-color: rgba(26, 26, 26, 0.95); /* Oscuro */
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/images/encabezado.png');
    background-size: cover;
    background-position: center;
    opacity: 0.8; /* Más transparente para tema oscuro */
    z-index: -1;
}

/* Estilo para el encabezado con imagen de fondo azul */
.header-with-background {
    background-image: url('/static/images/encabezado.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Overlay más oscuro para mejor legibilidad */
.header-with-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Más oscuro */
    z-index: 1;
    pointer-events: none;
}

/* Contenido del header por encima del overlay */
.header-with-background > div {
    position: relative;
    z-index: 2;
}

/* Texto del logo con mejor contraste - MANTENER BLANCO para legibilidad */
.logo-text {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Ícono del logo en blanco - MANTENER para visibilidad */
.logo-icon {
    filter: brightness(0) invert(1);
}

/* Navigation Styling - Tema oscuro */
nav a {
    transition: all 0.3s ease;
    color: #e5e5e5; /* Texto claro */
    font-weight: 500;
}

nav a:hover {
    color: #00bcd4; /* Cian del tema */
    text-decoration: none;
    transform: scale(1.05);
}

/* Button Styles - Tema oscuro */
.btn-primary {
    background: linear-gradient(135deg, #00bcd4 0%, #9c27b0 100%);
    border-color: #00bcd4;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0097a7 0%, #7b1fa2 100%);
    border-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.4);
}

/* Form Styles - CORREGIDO: Eliminado background blanco */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #505050;
    border-radius: 8px;
    background: #2d2d2d !important; /* Fondo oscuro en lugar de blanco */
    color: #e5e5e5; /* Texto claro */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #00bcd4; /* Cian del tema */
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #505050;
    border-radius: 8px;
    background: #2d2d2d !important; /* Fondo oscuro en lugar de blanco */
    color: #e5e5e5; /* Texto claro */
    cursor: pointer;
}

/* Data Tables - TEMA OSCURO */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d2d; /* Fondo oscuro */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.data-table th {
    background: #404040; /* Header más oscuro */
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #e5e5e5; /* Texto claro */
    border-bottom: 1px solid #505050;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #505050;
    color: #e5e5e5; /* Texto claro */
}

.data-table tr:hover {
    background: #404040; /* Hover más claro */
}

/* Feature cards - CORREGIDO: Eliminado fondo blanco forzado */
.feature-card {
    position: relative !important;
    overflow: hidden !important;
    background: rgba(45, 45, 45, 0.95) !important; /* Fondo oscuro consistente */
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #404040;
    color: #e5e5e5 !important;
}

/* PERMITIR background-image en feature-cards pero mantener fondo oscuro */
.feature-card[style*="background-image"] {
    background-color: rgba(45, 45, 45, 0.8) !important; /* Semi-transparente para ver imagen */
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    background-blend-mode: overlay !important; /* Mezclar con fondo oscuro */
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 45, 45, 0.3); /* Overlay oscuro */
    z-index: 1;
    border-radius: 16px;
}

.feature-card > * {
    position: relative;
    z-index: 2;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Cards and containers - CORREGIDO */
.card {
    background: rgba(45, 45, 45, 0.95) !important;
    color: #e5e5e5 !important;
    border: 1px solid #404040 !important;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e5e5e5;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00bcd4, #9c27b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    color: #b3b3b3;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Links */
a {
    color: #00bcd4;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #9c27b0;
    text-decoration: none;
}

/* Utilities - TEMA OSCURO */
.bg-light {
    background: #2d2d2d !important;
    color: #e5e5e5 !important;
}

.bg-dark {
    background: #1a1a1a !important;
    color: #e5e5e5 !important;
}

.text-light {
    color: #e5e5e5 !important;
}

.text-dark {
    color: #1a1a1a !important;
}

/* Alerts and notifications */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: #fb923c;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 188, 212, 0.3);
    border-radius: 50%;
    border-top-color: #00bcd4;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .feature-card {
        padding: 16px;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

/* Global input and form overrides - CRÍTICO */
input,
select,
textarea,
.form-control,
.form-input {
    background: #2d2d2d !important;
    color: #e5e5e5 !important;
    border: 1px solid #505050 !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-input:focus {
    background: #2d2d2d !important;
    color: #e5e5e5 !important;
    border-color: #00bcd4 !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1) !important;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #9ca3af !important;
}

/* Eliminar TODOS los fondos blancos problemáticos */
.bg-white,
.bg-gray-50,
.bg-gray-100 {
    background: rgba(45, 45, 45, 0.95) !important;
    color: #e5e5e5 !important;
    border: 1px solid #404040 !important;
}
