/* ======================================= */
/* 1. ESTILOS BASE Y TIPOGRAFÍA */
/* ======================================= */

body {
    background-color: #f8f9fa; 
    color: #333;
    font-family: Arial, sans-serif;
}

main {
    padding-top: 20px;
    padding-bottom: 40px;
    min-height: calc(100vh - 100px);
}

a {
    transition: color 0.15s ease-in-out;
}


/* ======================================= */
/* 2. ESTILOS DE NAVEGACIÓN Y HEADER */
/* ======================================= */

.navbar-nav .nav-link.text-primary {
    color: var(--bs-primary) !important;
    font-weight: 500;
}
.navbar-nav .nav-link.text-success {
    color: var(--bs-success) !important;
    font-weight: 500;
}


/* ======================================= */
/* 3. ESTILOS DE LOGIN Y BRANDING (CRUCIALES) */
/* ======================================= */

/* Define el fondo sólido para el encabezado del logo en los logins y el index */
.bg-login-header {
    background-color: #DBDCD7 !important; 
    padding: 20px 0; 
    border-top-left-radius: 0.5rem; 
    border-top-right-radius: 0.5rem;
}

/* Asegurar que el logo cuadrado esté centrado en los logins/index */
.logo-login {
    max-width: 150px; 
    height: auto;
    display: block;
    margin: 0 auto;
}


/* ======================================= */
/* 4. ESTILOS DE UX (TARJETAS DE ACCIÓN EN INDEX.PHP) */
/* ======================================= */

.card-action {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 0.5rem;
    position: relative;
    display: block;
    overflow: hidden; 
    min-height: 250px; 
    border: 1px solid #dee2e6;
    background: none;
}

.card-action:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25) !important;
}

/* Contenedor del logo para el efecto de banner superior */
.card-img-top-container {
    background-color: #DBDCD7; 
    padding: 15px; 
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Estilo para la imagen del logo DENTRO del contenedor (banner) */
.logo-card-action {
    max-width: 100%; 
    height: auto;
    display: block; 
    margin: 0 auto; 
}

.card-action .card-body {
    padding-top: 1rem !important; 
    padding-bottom: 1rem !important; 
}

.card-title-lg {
    font-size: 1.3rem; 
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-action .card-footer {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    color: white; 
    text-align: center;
}

/* Estilos específicos para resetear el fondo */
.card-competencias,
.card-productor,
.card-crear-comp {
    background: none; 
}


/* ======================================= */
/* 5. ESTILOS DE TABLAS Y RESPONSIVIDAD */
/* ======================================= */

/* Corrección del color de fondo del Navbar en Móvil */
@media (max-width: 991.98px) {
    /* El navbar se colapsa a partir de 'lg' (992px), pero por seguridad usamos el colapso estándar */
    .navbar.bg-dark {
        background-color: #DBDCD7 !important;
    }
    
    /* Asegurar que los elementos del menú colapsado sean oscuros sobre el fondo claro */
    .navbar-dark .navbar-nav .nav-link {
        color: #333 !important;
    }

    /* Asegurar que el botón de salir tenga contraste en el fondo claro */
    .navbar-dark .btn-danger {
        color: #fff !important;
        background-color: var(--bs-danger) !important;
    }
    
    .table-responsive table {
        border: 0;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tr {
        margin-bottom: 10px;
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 5px;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }

    .table-responsive td {
        display: block;
        text-align: right !important;
        padding-left: 50% !important;
        position: relative;
        border: none !important;
    }

    .table-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        font-weight: bold;
        text-align: left;
    }
}