/* --- Estilos Generales --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    color: #333;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* --- Estilos de las Pestañas (Tabs) --- */
.tab-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab {
    overflow: hidden;
    background-color: #005A9C; /* Azul institucional */
    display: flex;
    flex-wrap: wrap;
}

.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 18px 25px;
    transition: 0.3s;
    font-size: 16px;
    color: white;
    flex: 1 1 auto;
    font-weight: 600;
    min-width: 120px;
}

.tab button:hover {
    background-color: #004475;
}

.tab button.active {
    background-color: #ffffff;
    color: #005A9C;
    border-bottom: 3px solid #005A9C;
}

/* --- Filtros y Búsqueda --- */
.filters-container {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
}

.year-select {
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
    background-color: white;
    cursor: pointer;
}

.btn-search {
    background-color: #005A9C;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-search:hover {
    background-color: #004475;
}

.btn-clear {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-size: 15px;
    transition: background 0.3s;
}

.btn-clear:hover {
    background-color: #5a6268;
}

.results-info {
    color: #666;
    font-size: 14px;
}

/* --- Contenido de las Pestañas --- */
.tabcontent {
    display: none;
    padding: 20px;
    animation: fadeEffect 0.5s;
}

/* --- Estilos de la Tabla --- */
.table-responsive {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 800px;
}

th, td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    color: #444;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}

tr:hover {
    background-color: #f1f1f1;
}

/* --- Etiquetas y Botones --- */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    min-width: 30px;
}

.badge-si {
    background-color: #d4edda;
    color: #155724;
}

.badge-no {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-descarga {
    display: inline-block;
    background-color: #17a2b8;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s;
}

.btn-descarga:hover {
    background-color: #138496;
}

/* --- Paginación --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 20px 0;
}

.page-link {
    padding: 8px 15px;
    background-color: #005A9C;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.page-link:hover {
    background-color: #004475;
}

.page-info {
    color: #666;
    font-weight: 600;
}

/* --- Vista de Detalle --- */
.breadcrumb {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb a {
    color: #005A9C;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.document-detail {
    padding: 30px;
}

.detail-header {
    margin-bottom: 30px;
}

.detail-category {
    display: inline-block;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.detail-header h2 {
    color: #2c3e50;
    margin: 10px 0;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin: 15px 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.detail-info dl {
    margin: 0;
}

.detail-info dt {
    font-weight: 600;
    color: #666;
    margin-top: 15px;
    font-size: 14px;
}

.detail-info dd {
    margin: 5px 0 0 0;
    font-size: 15px;
}

.tag {
    display: inline-block;
    background-color: #e9ecef;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 13px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.download-box,
.versions-box {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.download-box h3,
.versions-box h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
}

.btn-download-large {
    display: block;
    background-color: #28a745;
    color: white;
    padding: 15px 30px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0;
    transition: background 0.3s;
}

.btn-download-large:hover {
    background-color: #218838;
}

.file-size {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.versions-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.versions-list li {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.versions-list li:last-child {
    border-bottom: none;
}

.versions-list .current {
    color: #28a745;
    font-weight: 600;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 0;
    border-radius: 10px;
    width: 85%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    line-height: 1;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-category {
    display: inline-block;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-header h2 {
    color: #2c3e50;
    margin: 10px 0;
    font-size: 24px;
}

.modal-body {
    padding: 30px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.modal-info dl {
    margin: 0;
}

.modal-info dt {
    font-weight: 600;
    color: #666;
    margin-top: 15px;
    font-size: 14px;
}

.modal-info dt:first-child {
    margin-top: 0;
}

.modal-info dd {
    margin: 5px 0 0 0;
    font-size: 15px;
    color: #333;
}

.download-box-modal {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.download-box-modal h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.download-box-modal p {
    color: #666;
    margin: 10px 0;
    font-size: 14px;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    margin-top: 40px;
}

.footer a {
    color: #005A9C;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Animación de entrada */
@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .tab button {
        flex: 1 1 100%;
        padding: 15px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input,
    .year-select {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-close {
        font-size: 28px;
        padding: 5px 15px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px 10px;
    }
}
