@import "../variables.css";

/*
 * ==========================================================================
 *  ENCABEZADO DE PÁGINA
 * ==========================================================================
 */

.cuenta-publica-header {
    background-image: linear-gradient(
            rgba(36, 47, 96, 0.7),
            rgba(36, 47, 96, 0.7)
    ), url('/img/components/cuenta_publica/cuenta-publica.webp');
    background-size: cover;
    background-position: center 78%;
    padding: var(--spacing-xl) 0;
    text-align: center;
    min-height: 35vh;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cuenta-publica-header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
}

.cuenta-publica-header__title {
    font-family: var(--font-primary), sans-serif;
    color: #ffffff;
    font-size: 2.25rem;
    font-weight: 700;
    text-transform: uppercase;
}

/*
 * ==========================================================================
 *  ESTRUCTURA RESPONSIVA
 * ==========================================================================
 */

/* Por defecto (Móvil): Ocultamos la columna de escritorio */
.document-display-col {
    display: none;
}

/* En escritorio: Mostramos la columna y el layout de dos columnas */
@media (min-width: 992px) {
    .cuenta-publica-container {
        display: flex;
        gap: 30px;
    }

    .year-list-col {
        flex: 0 0 300px;
    }

    .document-display-col {
        display: block; /* Se muestra la columna derecha */
        flex-grow: 1;
        position: relative;
        min-height: 200px;
    }

    .mobile-content-wrapper {
        display: none !important; /* Nos aseguramos de que los contenedores móviles NUNCA se vean en escritorio */
    }
}

/*
 * ==========================================================================
 *  TARJETAS DE AÑO (NAVEGACIÓN)
 * ==========================================================================
 */

.year-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.year-card .year-card-title {
    color: #343a40 !important;
}

.year-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-left: 5px solid #FFC107;
    background-color: #f8f9fa;
}

.year-card.active {
    background-color: #004085;
    border-color: #004085;
    transform: translateX(5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-left: 5px solid #FFC107;
}

.year-card.active .year-card-title {
    color: white !important;
}

.year-card-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
}

/*
 * ==========================================================================
 *  ACORDEÓN DE PERIODOS
 * ==========================================================================
 */

.periodo-card {
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    overflow: hidden;
}

.periodo-header {
    padding: 0;
    background-color: transparent;
    border-bottom: none;
}

.periodo-header .btn-link {
    color: #004085;
    font-weight: 600;
    font-size: 1.15rem;
    text-align: left;
    width: 100%;
    padding: 15px 20px;
    text-decoration: none;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.periodo-header .btn-link:hover {
    background-color: #e9ecef;
}

.periodo-header .btn-link::after {
    content: '\f078'; /* Flecha abajo FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.periodo-header .btn-link[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/*
 * ==========================================================================
 *  LISTA DE DOCUMENTOS (CONTENIDO)
 * ==========================================================================
 */

.document-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    /* border-radius se remueve porque ahora está dentro del card-body */
    box-shadow: none; /* box-shadow se remueve porque ahora está dentro del card */
}

.document-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s;
    gap: 15px;
}

.document-list-item:last-child {
    border-bottom: none;
}

.document-list-item:hover {
    background-color: #f1f3f5;
}

.document-list-item__icon {
    font-size: 2rem;
    color: #D32F2F;
    margin-right: 10px;
}

.document-list-item__info {
    flex-grow: 1;
    min-width: 200px;
}

.document-list-item__title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 5px 0;
    color: #343a40;
}

.document-list-item__meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

.document-list-item__action {
    flex-shrink: 0;
    width: 100%;
    margin-top: 15px;
    text-align: right;
}

@media (min-width: 576px) {
    .document-list-item__action {
        width: auto;
        margin-top: 0;
    }
    .document-list-item {
        flex-wrap: nowrap;
    }
}

.document-list-item__action .btn {
    background-color: #eaf2fa;
    color: #004085;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.document-list-item__action .btn .fas {
    margin-right: 6px;
}

.document-list-item__action .btn:hover {
    background-color: #004085;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 64, 133, 0.3);
}

.btn:hover {
    transform: scale(1);
}

/*
 * ==========================================================================
 *  COMPONENTES DE UI (SPINNER, MENSAJES, CONTENEDORES)
 * ==========================================================================
 */

.mobile-content-wrapper, .document-content {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    padding: 0;
    margin-top: -10px;
    margin-bottom: 15px;
    display: none;
}

.mobile-content-wrapper.visible, .document-content.visible {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.spinner-container.visible {
    opacity: 1;
    visibility: visible;
}

.no-documents-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 10px;
    height: 100%;
}

.no-documents-message__icon {
    font-size: 3.5rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.no-documents-message__title {
    font-weight: 700;
    color: #495057;
    margin-bottom: 10px;
}

.no-documents-message__text {
    color: #6c757d;
    max-width: 300px;
}