/* =========================================================
   1. ESTILOS GENERALES
   ========================================================= */

body {
    background: #f4f7fb;
    font-family: Arial, sans-serif;
    color: #172033;
}

.min-w-0 {
    min-width: 0;
}


/* =========================================================
   2. BARRA SUPERIOR
   ========================================================= */

.topbar {
    background:
        url('../img/fondo.png') center center / cover no-repeat !important;

    color: #fff !important;

    min-height: 130px !important;

    border-bottom: 8px solid yellow !important;
}

.brand-logo {
    height: 54px;
}


/* =========================================================
   3. HERO / CABECERA
   ========================================================= */

.hero {
    background: linear-gradient(120deg, #062e60, #0d62ae);
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 32px #073b7820;
}

.search-hero {
    position: relative;
    z-index: 30;
}


/* =========================================================
   4. TARJETAS DE CARPETAS Y DOCUMENTOS
   ========================================================= */

.folder-card,
.doc-card {
    transition: .2s;
    border: 1px solid #e9eef5;
    border-radius: 16px;
    box-shadow: 0 3px 14px #173a5e0d;
    background: #fff;
}

.folder-card:hover,
.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px #173a5e1c;
    border-color: #cfe0f2;
}

.folder-icon {
    font-size: 2.2rem;
    color: #f2b705;
}


/* =========================================================
   5. LOGIN
   ========================================================= */

.login-card {
    max-width: 460px;
    margin: 9vh auto;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 15px 50px #0002;
}


/* =========================================================
   6. VISOR / PREVIEW
   ========================================================= */

.preview-frame {
    width: 100%;
    height: 75vh;
    border: 0;
}


/* =========================================================
   7. BUSCADOR PRINCIPAL
   ========================================================= */

.live-search-wrap {
    position: relative;
    z-index: 50;
}

.hero .live-search-wrap {
    max-width: 900px;
}

.live-search-wrap .input-group {
    background: #fff;
    border-radius: 15px;
}

.live-search-wrap .input-group-text {
    border-radius: 15px 0 0 15px;
}

.live-search {
    min-height: 54px;
    border-radius: 0 15px 15px 0 !important;
    box-shadow: none !important;
}


/* =========================================================
   8. RESULTADOS DEL BUSCADOR
   ========================================================= */

.live-results {
    display: none;
    position: absolute;

    left: 0;
    right: 0;
    top: calc(100% + 8px);

    background: #fff;
    color: #172033;

    border: 1px solid #e1e8f0;
    border-radius: 15px;

    box-shadow: 0 18px 45px #102d4d2e;

    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;

    z-index: 9999;
}

.live-results.show {
    display: block;
}


/* =========================================================
   9. ITEM DE RESULTADO
   ========================================================= */

.search-result-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #edf1f5;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover {
    background: #f7faff;
}


/* =========================================================
   10. CONTENIDO DEL RESULTADO
   ========================================================= */

.search-result-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;

    padding: 13px 15px;

    flex: 1;
    min-width: 0;

    text-decoration: none;
    color: inherit;
}

.search-file-icon {
    width: 40px;
    height: 40px;

    border-radius: 10px;

    background: #edf5ff;
    color: #0d62ae;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: none;
    margin-top: 1px;
}

.search-result-text {
    display: block;
    flex: 1;
    min-width: 0;
}

.search-result-text strong {
    display: block;

    white-space: normal;
    overflow: visible;
    text-overflow: clip;

    line-height: 1.35;
    word-break: break-word;
}

.search-result-text small {
    display: block;

    color: #718096;
    margin-top: 3px;

    white-space: normal;
    overflow: visible;
    text-overflow: clip;

    line-height: 1.3;
    word-break: break-word;
}


/* =========================================================
   11. BOTÓN DESCARGAR DEL BUSCADOR
   ========================================================= */

.search-download {
    width: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: none;
    align-self: stretch;

    color: #61758a;
    text-decoration: none;
}

.search-download:hover {
    background: #edf5ff;
    color: #0d62ae;
}


/* =========================================================
   12. ESTADOS DEL BUSCADOR
   ========================================================= */

.search-loading,
.search-empty {
    padding: 18px;
    text-align: center;
    color: #718096;
}


/* =========================================================
   13. DOCUMENTOS
   ========================================================= */

.file-badge {
    width: 52px;
    height: 52px;

    border-radius: 14px;

    background: #eef5ff;
    color: #0b63b6;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.45rem;

    flex: none;
}

.doc-title {
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}


/* =========================================================
   14. BADGE NUEVO
   ========================================================= */

.badge-new {
    background: #dc3545 !important;
    color: #fff !important;
    font-weight: 700;
}


/* =========================================================
   15. ESTADO VACÍO
   ========================================================= */

.empty-state {
    text-align: center;

    background: #fff;

    border: 1px dashed #cad7e4;
    border-radius: 16px;

    padding: 45px 20px;

    color: #718096;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}


/* =========================================================
   16. RESPONSIVE - TABLET / CELULAR
   ========================================================= */

@media (max-width: 767.98px) {

    /* ============================
       TOPBAR
       ============================ */

    .topbar {
        min-height: 115px !important;
        border-bottom-width: 6px !important;
    }


    /* ============================
       HERO
       ============================ */

    .hero {
        border-radius: 16px;
    }

    .search-hero {
        padding: 26px 20px !important;
    }

    .hero h1 {
        font-size: 1.85rem !important;
        line-height: 1.15;
        margin-bottom: 14px !important;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.45;
        margin-bottom: 20px !important;
    }


    /* ============================
       BUSCADOR + BOTÓN
       ============================ */

    .search-hero > .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;

        width: 100% !important;

        gap: 12px !important;
    }


    /* CONTENEDOR DEL BUSCADOR */

    .search-hero .live-search-wrap {
        width: 100% !important;
        max-width: 100% !important;

        flex: 0 0 auto !important;
    }


    /* INPUT GROUP */

    .search-hero .input-group {
        display: flex !important;

        width: 100% !important;

        flex-wrap: nowrap !important;

        border-radius: 14px !important;

        overflow: hidden;
    }


    /* ICONO DE LUPA */

    .search-hero .input-group-text {
        flex: 0 0 auto !important;

        padding-left: 18px !important;
        padding-right: 12px !important;

        border-radius: 14px 0 0 14px !important;
    }


    /* INPUT */

    .search-hero .live-search {
        flex: 1 1 auto !important;

        width: 1% !important;
        min-width: 0 !important;

        min-height: 56px !important;

        font-size: 16px !important;

        padding-left: 8px !important;
        padding-right: 12px !important;

        border-radius: 0 14px 14px 0 !important;
    }


    /* ============================
       BOTÓN VOLVER A BUSCAR
       ============================ */

    .search-hero #btnNuevaBusqueda {
        display: flex !important;

        align-items: center !important;
        justify-content: center !important;

        width: 100% !important;

        min-height: 52px !important;

        margin: 0 !important;

        padding: 12px 18px !important;

        font-size: 16px !important;
        font-weight: 600;

        border-radius: 14px !important;

        white-space: nowrap;
    }


    /* ============================
       RESULTADOS BUSCADOR
       ============================ */

    .live-results {
        width: 100%;

        max-height: 60vh;

        border-radius: 13px;
    }

    .search-result-main {
        padding: 12px;
        gap: 10px;
    }

    .search-file-icon {
        width: 38px;
        height: 38px;
    }

    .search-download {
        width: 44px;
    }


    /* ============================
       DOCUMENTOS
       ============================ */

    .doc-card .btn {
        flex: 1;
    }
}


/* =========================================================
   17. IPHONE / CELULARES PEQUEÑOS
   ========================================================= */

@media (max-width: 430px) {

    /* ============================
       TOPBAR
       ============================ */

    .topbar {
        min-height: 105px !important;
    }


    /* ============================
       HERO
       ============================ */

    .search-hero {
        padding: 24px 18px !important;
    }

    .hero h1 {
        font-size: 1.75rem !important;
        line-height: 1.15;
    }

    .hero p {
        font-size: .98rem;
        line-height: 1.45;
    }


    /* ============================
       BUSCADOR
       ============================ */

    .search-hero .live-search {
        font-size: 16px !important;
        min-height: 54px !important;
    }

    .search-hero .input-group-text {
        padding-left: 16px !important;
        padding-right: 10px !important;
    }


    /* ============================
       BOTÓN
       ============================ */

    .search-hero #btnNuevaBusqueda {
        font-size: 15px !important;
        min-height: 50px !important;
    }


    /* ============================
       RESULTADOS
       ============================ */

    .search-result-text strong {
        font-size: .94rem;
    }

    .search-result-text small {
        font-size: .8rem;
    }
}


/* =========================================================
   18. CELULARES MUY PEQUEÑOS
   ========================================================= */

@media (max-width: 360px) {

    .search-hero {
        padding: 20px 15px !important;
    }

    .hero h1 {
        font-size: 1.55rem !important;
    }

    .hero p {
        font-size: .92rem;
    }

    .search-hero #btnNuevaBusqueda {
        font-size: 14px !important;
    }
}