/* Estilos móviles para el buscador del PUC */

@media (max-width: 768px) {
    /* Estilos para el hero del buscador */
    .search-hero {
        padding: 2rem 1rem;
    }
    
    .search-hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .search-hero p {
        font-size: 1rem;
    }
    
    /* Contenedor principal de búsqueda */
    .search-container-main {
        padding: 1rem;
    }
    
    /* Formulario de búsqueda */
    .search-form {
        padding: 1rem;
    }
    
    .search-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-type-selector {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .search-type-selector select {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Grupo de entrada */
    .input-group {
        flex-direction: column;
    }
    
    .search-input-container {
        width: 100%;
    }
    
    .input-group input {
        border-radius: 8px 8px 0 0;
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .input-group button {
        border-radius: 0 0 8px 8px;
        width: 100%;
        padding: 0.75rem;
        margin-top: -1px;
    }
    
    /* Contenedor de sugerencias */
    .suggestions-container {
        width: 100%;
        max-height: 250px;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .suggestions-container.active {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .suggestion-item {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .suggestion-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .suggestion-codigo {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    .suggestion-nombre {
        font-size: 0.85rem;
        width: 100%;
        color: #555;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .suggestion-nivel {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        border-radius: 4px;
    }
    
    .suggestion-item.selected {
        background-color: rgba(0, 184, 184, 0.1);
    }
    
    /* Resultados de búsqueda */
    .search-results {
        padding: 1rem;
    }
    
    .initial-message {
        padding: 1.5rem 1rem;
    }
    
    .results-count {
        padding: 0.75rem;
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    /* Tarjetas de coincidencia */
    .match-card {
        margin-bottom: 1rem;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .match-card:active {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    
    .match-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
        background-color: rgba(0, 0, 0, 0.02);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .match-title {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    
    .btn-expand {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-weight: 600;
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }
    
    .btn-expand i {
        transition: transform 0.2s ease;
    }
    
    .btn-expand:active {
        background-color: var(--primary-color);
    }
    
    /* Estilo para cuando la jerarquía está expandida */
    .hierarchy-container:not(.collapsed) + .match-header .btn-expand i {
        transform: rotate(180deg);
    }
    
    /* Jerarquía de resultados */
    .hierarchy-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 6px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .hierarchy-item.target-item {
        transform: translateY(-2px);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    }
    
    .hierarchy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .header-top {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }
    
    .nivel-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
        border-radius: 3px;
        font-weight: 600;
    }
    
    .codigo {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--primary-color);
    }
    
    .nombre {
        font-size: 1rem;
        width: 100%;
        display: block;
        margin-top: 0.25rem;
        line-height: 1.3;
    }
    
    .cuenta-link {
        display: block;
        width: 100%;
        text-decoration: none;
        color: inherit;
    }
    
    .cuenta-link:hover .nombre {
        color: var(--accent-color);
    }
    
    .descripcion {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .dinamica {
        padding: 0.75rem;
        background-color: rgba(0, 0, 0, 0.02);
        border-radius: 6px;
        margin-top: 0.75rem;
    }
    
    .debitos, .creditos {
        margin-bottom: 0.75rem;
    }
    
    .debitos strong, .creditos strong {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
        color: var(--primary-color);
    }
    
    .dinamica ul {
        padding-left: 1.25rem;
        margin: 0.5rem 0;
    }
    
    .dinamica li {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    /* Estilo para tarjetas expandidas */
    .match-card.expanded {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
    
    /* Ejemplos de búsqueda */
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .example-card {
        padding: 1.25rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .example-card:active {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    
    .example-card h3 {
        font-size: 1.1rem;
        color: var(--primary-color);
        margin-bottom: 0.75rem;
    }
    
    .example-card p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        color: #555;
    }
    
    .example-card code {
        background-color: rgba(0, 184, 184, 0.1);
        color: var(--accent-color);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-weight: 600;
    }
    
    .example-card .btn-secondary {
        width: 100%;
        padding: 0.75rem;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 6px;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
    .search-hero h1 {
        font-size: 1.5rem;
    }
    
    .search-hero p {
        font-size: 0.9rem;
    }
    
    .nivel-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .codigo {
        font-size: 1rem;
    }
    
    .nombre {
        font-size: 0.95rem;
    }
    
    .descripcion {
        font-size: 0.85rem;
    }
    
    .dinamica li {
        font-size: 0.85rem;
    }
    
    .example-card {
        padding: 1rem;
    }
    
    .example-card h3 {
        font-size: 1rem;
    }
    
    .example-card p {
        font-size: 0.85rem;
    }
}

/* Indicador de carga */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
    text-align: center;
}

.loading-indicator i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.loading-indicator p {
    font-size: 1rem;
}

/* Mensaje de no resultados para móviles */
.no-results-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.no-results-mobile i {
    color: #ddd;
    margin-bottom: 1rem;
}

.no-results-mobile p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #555;
}

.no-results-mobile strong {
    color: var(--primary-color);
}

.no-results-mobile .suggestion-text {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
}

/* Clase para búsqueda completada */
.search-results.search-completed {
    animation: fadeIn 0.4s ease-out;
}

/* Estado activo para botones de ejemplo */
.example-btn.active {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-card, .match-card {
    animation: fadeIn 0.4s ease-out;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}