/* styles.css */
:root {
    --color1: #58a058;
    --color2: color-mix(in srgb, var(--color1) 80%, white 10%);
}


.containermc {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== header ========== */
.headermc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(180deg, var(--color1) 0%, var(--color2) 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.headermc-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.headermc-left i {
    font-size: 2.5em;
}

.headermc-left h1 {
    font-size: 2em;
    font-weight: 600;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    width: 200px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    width: 350px;
}

.search-button {
    padding: 12px 25px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-button:hover {
    background-color: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ========== FILTROS ========== */
.filters-container {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color1);
    font-weight: 600;
    font-size: 0.95em;
}

.filter-group label i {
    margin-right: 5px;
    color: var(--color2);
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:hover {
    border-color: var(--color2);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color2);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-button {
    padding: 12px 30px;
    background: linear-gradient(180deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.clear-button {
    padding: 12px 30px;
	background: linear-gradient(180deg, #a50404 0%, #7c0404 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.clear-button:hover {
    background-color: #7c0404;
    transform: translateY(-2px);
}

/* ========== RESULTADOS INFO ========== */
.results-info {
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    color: var(--color1);
    font-size: 0.95em;
}

.results-info span {
    font-weight: 600;
    color: var(--color2);
}

/* ========== TABLA DE CIRCULARES ========== */
.table-responsive {
    overflow-x: auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.circulares-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.circulares-table thead {
    background: linear-gradient(180deg, var(--color1) 0%, var(--color2) 100%);
    color: white;
}

.circulares-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
}

.circulares-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.circulares-table tbody tr {
    transition: background-color 0.3s;
}

.circulares-table tbody tr:hover {
    background-color: #f8f9fa;
}

.circulares-table tbody tr:last-child td {
    border-bottom: none;
}

/* IDs de circular */
.circular-id {
    font-family: monospace;
    font-weight: 600;
    color: #e67e22;
    background-color: #fef5e7;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Fechas */
.circular-fecha {
    color: #7f8c8d;
    font-size: 0.95em;
    white-space: nowrap;
}

/* Categorías */
.circular-categoria {
    background-color: #e8f0fe;
    color: var(--color2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
}

/* Títulos y resumen */
.circular-titulo {
    font-weight: 500;
    color: var(--color1);
    max-width: 300px;
}

.resumen-preview {
    color: #7f8c8d;
    font-size: 0.9em;
    line-height: 1.5;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 5px;
}

.resumen-link {
    color: var(--color2);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    padding: 4px 10px;
    background-color: #e8f0fe;
    border-radius: 20px;
    transition: all 0.3s;
    margin-top: 8px;
}

.resumen-link:hover {
    background-color: var(--color2);
    color: white;
}

.resumen-link i {
    font-size: 0.9em;
}

/* Botones de descarga */
.btn-descargar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(180deg, var(--color2) 0%, var(--color1) 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-descargar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-descargar i {
    font-size: 1.1em;
}

.btn-descargar.disabled {
    background: #bdc3c7;
    pointer-events: none;
    opacity: 0.6;
}

/* ========== MODAL PARA RESUMEN ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-contentmc {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.modal-headermc {
    padding: 20px 30px;
    background: linear-gradient(180deg, var(--color1) 0%, var(--color2) 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-headermc h2 {
    margin: 0;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-word;
    padding-right: 30px;
}

.modal-headermc h2 i {
    color: #f1c40f;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
    position: absolute;
    top: 15px;
    right: 20px;
}

.modal-close:hover {
    color: #f1c40f;
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(80vh - 180px);
}

.modal-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--color2);
}

.modal-info p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color1);
}

.modal-info p i {
    width: 20px;
    color: var(--color2);
}

.modal-info p strong {
    min-width: 80px;
    color: var(--color2);
}

.modal-info p span {
    color: var(--color1);
    font-weight: 500;
}

.modal-resumen {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    line-height: 1.8;
    font-size: 1.05em;
    color: var(--color1);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.modal-resumen p {
    margin-bottom: 15px;
}

.modal-resumen ul,
.modal-resumen ol {
    margin: 10px 0 10px 30px;
}

.modal-resumen h1,
.modal-resumen h2,
.modal-resumen h3 {
    margin: 20px 0 10px 0;
    color: var(--color1);
}

.modal-footermc {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 15px 15px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.modal-btn-primary {
    background: linear-gradient(180deg, #28a745 0%, #218838 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
	color: white;
}

.modal-btn-secondary {
    background: linear-gradient(180deg, #a50404 0%, #7c0404 100%);
    color: white;
}

.modal-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 46, 46, 0.4);
	color: white;
}

/* ========== footer ========== */
.footermc {
    background: linear-gradient(180deg, #ECF4FA 0%, #f0f0f0 100%);
    color: #000000;
    padding: 35px;
    border-radius: 15px;
    margin-top: 50px;
}

.footermc h3 {
    margin-bottom: 25px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--color2);
    padding-bottom: 15px;
}

.recientes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reciente-item {
    padding: 5px 20px;
    border-bottom: 1px solid #4a5568;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

.reciente-item:last-child {
    border-bottom: none;
}

.reciente-item:hover {
    background-color: #b6bbc4;
    transform: translateX(5px);
}

.reciente-titulo {
    font-size: 1em;
    color: #292929;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reciente-titulo i {
    color: var(--color2);
}

.reciente-fecha {
    font-size: 0.85em;
    color: #ffffff;
    background-color: var(--color1);
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== LOADING Y MENSAJES ========== */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.1em;
}

.loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

.loading-spinner {
    text-align: center;
    padding: 60px;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--color2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    background-color: #fdf3f2;
    border-radius: 10px;
    font-size: 1.1em;
    border: 2px solid #fadbd8;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    background-color: #f8f9fa;
    border-radius: 10px;
    font-size: 1.1em;
}

/* ========== UTILIDADES ========== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #7f8c8d;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .headermc {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }

    .headermc-left {
        justify-content: center;
    }

    .headermc-left h1 {
        font-size: 1.6em;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    .filters {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-button,
    .clear-button {
        width: 100%;
    }

    .circulares-table th,
    .circulares-table td {
        padding: 12px 15px;
    }

    .circular-titulo {
        max-width: 200px;
    }

    .btn-descargar {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .reciente-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Modal responsive */
    .modal-contentmc {
        width: 95%;
        margin: 30px auto;
        max-height: 85vh;
    }

    .modal-headermc {
        padding: 15px 20px;
    }

    .modal-headermc h2 {
        font-size: 1.2em;
        padding-right: 25px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-info p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .modal-info p strong {
        min-width: auto;
    }

    .modal-footermc {
        flex-direction: column;
        padding: 15px 20px;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .headermc-left i {
        font-size: 2em;
    }

    .headermc-left h1 {
        font-size: 1.3em;
    }

    .circulares-table th,
    .circulares-table td {
        padding: 10px;
        font-size: 0.9em;
    }

    .circular-id {
        font-size: 0.85em;
        padding: 3px 6px;
    }

    .circular-categoria {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    .btn-descargar {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .resumen-link {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    .footermc {
        padding: 20px;
    }

    .footermc h3 {
        font-size: 1.2em;
    }

    .reciente-titulo {
        font-size: 0.9em;
    }

    .reciente-fecha {
        font-size: 0.75em;
    }

    /* Modal responsive para móvil pequeño */
    .modal-headermc h2 {
        font-size: 1.1em;
    }

    .modal-info {
        padding: 15px;
    }

    .modal-resumen {
        padding: 15px;
        font-size: 0.95em;
        max-height: 250px;
    }

    .modal-close {
        font-size: 24px;
        top: 12px;
        right: 15px;
    }
}

/* ========== IMPRESIÓN ========== */
@media print {
    .headermc,
    .filters-container,
    .results-info,
    .resumen-link,
    .btn-descargar,
    .modal,
    .footermc,
    .search-form {
        display: none !important;
    }

    .table-responsive {
        box-shadow: none;
        margin: 0;
    }

    .circulares-table {
        border: 1px solid #ddd;
    }

    .circulares-table thead {
        background: #f0f0f0;
        color: black;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background-color: white;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ========== ANIMACIONES ADICIONALES ========== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ========== SCROLL PERSONALIZADO ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color2);
}

/* ========== TOOLTIPS ========== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: var(--color1);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 10;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* ========== footermc FIJO ========== */
.footermc {
    position: relative;
    z-index: 1;
}

/* ========== MEJORAS DE ACCESIBILIDAD ========== */
button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 3px solid #f1c40f;
    outline-offset: 2px;
}

/* ========== ESTADOS DE CARGA ESPECÍFICOS ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}