/* ------------------------------
   ESTILOS BASE (COMPARTIDOS)
--------------------------------*/

.search-state,
.no-results-state {
    text-align: center;
    width: 300px;
    margin: 5px auto;
    font-family: "Inter", sans-serif;
}

/* Contenedor animación */
.search-animation,
.no-results-icon {
    position: relative;
    width: 160px;
    height: 130px;
    margin: 0 auto 25px;
}

/* Lupa base */
.magnifier {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100px;
    height: 100px;
}

.glass {
    width: 75px;
    height: 75px;
    border: 4px solid;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.handle {
    width: 50px;
    height: 6px;
    border-radius: 4px;
    transform: rotate(45deg);
    position: absolute;
    bottom: -14px;
    right: -10px;
}

/* Líneas tipo texto */
.scan-lines,
.lines {
    position: absolute;
    top: 45px;
    left: 95px;
}

    .scan-lines span,
    .lines span {
        display: block;
        height: 6px;
        border-radius: 4px;
        margin: 6px 0;
    }

/* Textos generales */
.search-title,
.no-results-title {
    font-size: 22px;
    margin-bottom: 6px;
}

.search-text,
.no-results-text {
    font-size: 14px;
    line-height: 1.4;
}

/* Animación flotante (para "Sin resultados") */
.no-results-state {
    animation: float 3.2s ease-in-out infinite;
}

/* Loader interno */
.loader {
    width: 30px;
    height: 30px;
    border: 4px solid;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Badge para error */
.badge-error {
    position: absolute;
    top: 10px;
    left: 85px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animaciones */
@keyframes moveSearch {
    0% {
        transform: translateX(0px) rotate(-4deg);
    }

    25% {
        transform: translateX(25px) rotate(4deg);
    }

    50% {
        transform: translateX(0px) rotate(-3deg);
    }

    75% {
        transform: translateX(-25px) rotate(3deg);
    }

    100% {
        transform: translateX(0px) rotate(-4deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes linesMove {
    0% {
        opacity: .2;
        transform: translateX(-4px);
    }

    50% {
        opacity: 1;
        transform: translateX(4px);
    }

    100% {
        opacity: .2;
        transform: translateX(-4px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* La animación de búsqueda solo aplica al loader */
.search-animation {
    animation: moveSearch 2.8s ease-in-out infinite;
}

.scan-lines span,
.lines span {
    animation: linesMove 1.2s infinite ease-in-out;
}

    .scan-lines span:nth-child(2),
    .lines span:nth-child(2) {
        animation-delay: .2s;
        width: 35px;
    }

    .scan-lines span:nth-child(3),
    .lines span:nth-child(3) {
        animation-delay: .4s;
        width: 25px;
    }

    .scan-lines span:nth-child(1),
    .lines span:nth-child(1) {
        width: 45px;
    }

/* ------------------------------
   THEME LIGHT
--------------------------------*/
html[data-bs-theme="light"] {
    background: #f5f8fc;
    color: #222;
}

    /* Lupa */
    html[data-bs-theme="light"] .glass {
        border-color: #50618a;
        background: #fff;
    }

    html[data-bs-theme="light"] .handle {
        background: #50618a;
    }

    /* Loader */
    html[data-bs-theme="light"] .loader {
        border-color: #cdd3e0;
        border-top-color: #50618a;
    }

    /* Líneas */
    html[data-bs-theme="light"] .scan-lines span,
    html[data-bs-theme="light"] .lines span {
        background: #d1d5e0;
    }

    /* Badge error */
    html[data-bs-theme="light"] .badge-error {
        background: #e65252;
        color: #fff;
    }

    /* Textos */
    html[data-bs-theme="light"] .search-title,
    html[data-bs-theme="light"] .no-results-title {
        color: #333;
    }

    html[data-bs-theme="light"] .search-text,
    html[data-bs-theme="light"] .no-results-text {
        color: #666;
    }

/* ------------------------------
   THEME DARK
--------------------------------*/
html[data-bs-theme="dark"] {
    background: #0f131a;
    color: #e6e6e6;
}

    /* Lupa */
    html[data-bs-theme="dark"] .glass {
        border-color: #7f8ca8;
        background: #1a1f27;
    }

    html[data-bs-theme="dark"] .handle {
        background: #7f8ca8;
    }

    /* Loader neon */
    html[data-bs-theme="dark"] .loader {
        border-color: #2c3749;
        border-top-color: #4da8ff;
    }

    /* Líneas */
    html[data-bs-theme="dark"] .scan-lines span,
    html[data-bs-theme="dark"] .lines span {
        background: #3b4454;
    }

    /* Badge */
    html[data-bs-theme="dark"] .badge-error {
        background: #ff5b5b;
        color: #fff;
    }

    /* Textos */
    html[data-bs-theme="dark"] .search-title,
    html[data-bs-theme="dark"] .no-results-title {
        color: #e8eaf0;
    }

    html[data-bs-theme="dark"] .search-text,
    html[data-bs-theme="dark"] .no-results-text {
        color: #9aa3b8;
    }
