/* =============================================
   DOCUMENTOS LISTADO - OAB
   Diseño basado en el arte del diseñador
   ============================================= */

/* --- Variables de color --- */
:root {
    --docs-teal: #1a5276;
    --docs-teal-light: #2980b9;
    --docs-green: #27ae60;
    --docs-green-dark: #1e8449;
    --docs-gray-bg: #dce4ea;
    --docs-gray-border: #b0bec5;
    --docs-cat-tecnicos: #2471a3;
    --docs-cat-normativos: #27ae60;
    --docs-cat-pedagogicos: #e67e22;
    --docs-cat-investigacion: #8e44ad;
    --docs-cat-indicadores: #16a085;
}

/* --- Intro text --- */
.docs-intro {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 70px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

/* --- Full-width teal band (edge-to-edge) --- */
.docs-search-band {
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: var(--docs-teal);
    padding-top: 40px;
    padding-bottom: 10px;
    margin-top: 0;
}

.docs-search-band__inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* --- Button container --- */
.docs-search-toggle {
    display: flex;
    justify-content: center;
    position: relative;
    margin-top: -65px;
}

/* --- White pill button --- */
.docs-search-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    border-radius: 15px;
    padding: 14px 40px 14px 100px;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.25);
    position: relative;
    z-index: 2;
}

.docs-search-toggle__btn:hover {
    box-shadow: 0 7px 25px rgba(0,0,0,0.32);
    transform: translateY(-2px);
}

/* --- Magnifying glass icon — protrudes above the button --- */
.docs-search-toggle__icon {
    position: absolute;
    left: 12px;
    top: 80%;
    transform: translateY(-75%);
    width: 90px;
    height: 90px;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    background: radial-gradient(circle, rgba(26,82,118,0.15) 0%, transparent 70%);
}

/* --- Text inside button --- */
.docs-search-toggle__text {
    display: inline;
    font-size: 22px;
    letter-spacing: 0.5px;
}

.docs-search-toggle__text strong {
    font-weight: 900;
    color: #000;
}

.docs-avanzada-text {
    color: #333;
    font-weight: 600;
}

/* --- Green arrow indicator (below the teal band) --- */
.docs-arrow-indicator {
    display: flex;
    justify-content: center;
    margin: 15px 0 5px;
    padding-bottom: 0;
    cursor: pointer;
}

.docs-arrow-indicator__shape {
    width: 120px;
    height: 50px;
    background: #94e751;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    border-radius: 15px 15px 0 0;
}

/* --- Search Form Panel --- */
.docs-search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 0;
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

.docs-search-panel.is-open {
    max-height: 800px;
    opacity: 1;
}

/* Full-width blue background for top half of form */
.docs-search-panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 200px;
    background: var(--docs-teal);
    z-index: 0;
}

.docs-search-form {
    background: #f5f8fa;
    border-radius: 25px;
    padding: 28px 35px;
    margin: 0 auto 10px;
    max-width: 850px;
    border: 2px solid #d0d8e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1;
}

.docs-search-form__row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.docs-search-form__field {
    flex: 1;
    min-width: 200px;
}

.docs-search-form__field--full {
    flex: 1 1 100%;
}

.docs-search-form__field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
}

.docs-search-form__field input,
.docs-search-form__field select {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #d0d8e0;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-search-form__field input:focus,
.docs-search-form__field select:focus {
    outline: none;
    border-color: var(--docs-teal);
    box-shadow: 0 0 0 2px rgba(26,82,118,0.15);
}

/* --- Search BUSCAR Button (inside form) --- */
.docs-search-form__submit {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.docs-search-form__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a7a9e;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 2px 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    min-width: 180px;
}

.docs-search-form__btn:hover {
    background: #1e8fb5;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.docs-search-form__btn img {
    width: 22px;
    height: 22px;
}

/* --- Documentos Title --- */
.docs-section-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #2c3e50;
    margin: 0 0 20px;
    padding-top: 30px;
}

/* --- Categories Section with full-width gray background --- */
.docs-categories-section {
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: #e8ecef;
    padding: 0 0 30px;
    margin-bottom: 30px;
    margin-top: 30px;
}

/* =============================================
   CATEGORIES GRID
   ============================================= */
.docs-categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.docs-category {
    flex: 0 0 auto;
    width: 160px;
    cursor: pointer;
    border-radius: 18px;
    overflow: hidden;
    border: 4px solid #fff;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    position: relative;
}

.docs-category:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    transform: translateY(-3px);
}

.docs-category.is-active {
    border-color: #27ae60;
    box-shadow: 0 5px 20px rgba(39,174,96,0.4);
}

/* Image wrapper — vertical crop of horizontal image */
.docs-category__img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.docs-category__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
    transform: scale(1);
}

.docs-category:hover .docs-category__img,
.docs-category.is-active .docs-category__img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* Label overlaid on image bottom — green badge */
.docs-category__label {
    position: absolute;
    width: 75%;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(39,174,96,0.9);
    line-height: 1.3;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* =============================================
   CATEGORY ARROW
   ============================================= */
.docs-category-arrow {
    display: flex;
    justify-content: center;
    margin: 15px 0 25px;
}

.docs-category-arrow__shape {
    width: 120px;
    height: 50px;
    background: #94e751;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    border-radius: 15px 15px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.docs-category-arrow__shape.is-visible {
    opacity: 1;
}

/* =============================================
   CATEGORY INFO PANEL
   ============================================= */
.docs-category-info {
    text-align: center;
    margin-bottom: 15px;
    min-height: 70px;
}

.docs-category-info__title {
    width: 70%;
    display: inline-block;
    background: var(--docs-teal);
    color: #fff;
    padding: 4px 45px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.docs-category-info__desc {
    max-width: 750px;
    margin: 0 auto;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* =============================================
   NORMATIVOS STATIC LINKS
   ============================================= */
.docs-normativos-links {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.docs-normativos-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8ecef;
}

.docs-normativos-header img {
    max-width: 300px;
    height: auto;
    margin-bottom: 15px;
}

.docs-normativos-header p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.docs-normativos-header a {
    color: #1a7a9e;
    text-decoration: none;
    font-weight: 600;
}

.docs-normativos-header a:hover {
    color: #27ae60;
    text-decoration: underline;
}

.docs-normativos-table {
    width: 100%;
    margin: 0;
}

.docs-normativos-table tbody tr {
    border-bottom: 1px solid #e8ecef;
    transition: background-color 0.2s;
}

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

.docs-normativos-table tbody tr:last-child {
    border-bottom: none;
}

.docs-normativos-table td {
    padding: 14px 16px;
}

.docs-normativos-table a {
    color: #1a7a9e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: block;
    transition: all 0.2s;
}

.docs-normativos-table a:hover {
    color: #27ae60;
    padding-left: 8px;
}

/* =============================================
   RESULTS AREA
   ============================================= */
.docs-results {
    margin-top: 15px;
}

.docs-results__count {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    font-style: italic;
}

.docs-results__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 5px;
}

.docs-results__empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 15px;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.docs-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.docs-loading.is-visible {
    display: block;
}

.docs-loading__spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--docs-teal);
    border-radius: 50%;
    animation: docs-spin 0.8s linear infinite;
}

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

/* =============================================
   DOCUMENT CARD — matches designer mockup
   ============================================= */
.doc-card {
    background: #f5f5f5;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}

.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

/* Top green bar with category name - rounded top corners */
.doc-card__topbar {
    background: #27ae60;
    border-radius: 16px 16px 0 0;
    padding: 12px 18px;
    text-align: center;
}

/* Category label inside top bar */
.doc-card__header {
    display: none;
}

.doc-card__category {
    font-size: 25px;
    font-weight: 700;
    color: #fff;
    text-transform: capitalize;
}

/* Card body */
.doc-card__body {
    padding: 16px 16px 12px;
    flex: 1;
}

.doc-card__subtitle {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px;
    text-align: center;
}

.doc-card__desc {
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.5;
    margin: 0 0 12px;
    min-height: 45px;
    font-weight: 400;
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
}

/* Meta: Author, Fecha */
.doc-card__meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-card__meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.doc-card__meta-item strong {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.doc-card__meta-item span {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

/* Card footer with button */
.doc-card__footer {
    padding: 12px 16px 18px;
    text-align: center;
}

.doc-card__link {
    display: inline-block;
    background: #1a7a9e;
    color: #fff !important;
    padding: 8px 24px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.doc-card__link:hover {
    background: #1e8fb5;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* =============================================
   ERROR MESSAGE
   ============================================= */
.docs-error {
    display: none;
    text-align: center;
    background: #ffebee;
    color: #c62828;
    padding: 10px 20px;
    border-radius: 8px;
    margin: 10px auto;
    max-width: 500px;
}

.docs-error.is-visible {
    display: block;
}

/* =============================================
   SEARCH MODE INDICATOR
   ============================================= */
.docs-search-mode {
    display: none;
    text-align: center;
    margin-bottom: 15px;
}

.docs-search-mode.is-visible {
    display: block;
}

.docs-search-mode__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: var(--docs-green-dark);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.docs-search-mode__clear {
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
    .docs-results__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .docs-categories {
        gap: 8px;
    }
    .docs-category {
        width: 130px;
    }
    .docs-category__img-wrapper {
        height: 130px;
    }
    .docs-search-form__row {
        flex-direction: column;
    }
    .docs-search-form__field {
        min-width: 100%;
    }
    .docs-results__grid {
        grid-template-columns: 1fr;
    }
    .docs-search-toggle__btn {
        font-size: 16px;
        padding: 10px 24px 10px 50px;
    }
    .docs-search-toggle__icon {
        width: 48px;
        height: 48px;
    }
    .docs-search-toggle__text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .docs-category {
        width: 100px;
    }
    .docs-category__img-wrapper {
        height: 100px;
    }
    .docs-category__label {
        font-size: 10px;
        padding: 5px 3px;
    }
    .docs-search-toggle__btn {
        font-size: 13px;
        padding: 8px 18px 8px 44px;
    }
    .docs-search-toggle__icon {
        width: 40px;
        height: 40px;
    }
    .docs-search-toggle__text {
        font-size: 13px;
    }
}
