/* search.css - Estilos Modernos y Bento para Búsqueda Avanzada */

#view-search-engine {
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

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

/* --- Search Controls (Bento Style) --- */
.music-search-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.music-search-controls:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.music-search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.music-search-icon {
    position: absolute;
    left: 18px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.music-search-input {
    width: 100%;
    padding: 14px 15px 14px 50px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.music-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.music-search-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 51, 102, 0.5);
    outline: none;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.15), inset 0 0 0 1px rgba(255, 51, 102, 0.2);
}

.music-search-input:focus + .music-search-icon,
.music-search-input:focus ~ .music-search-icon {
    color: var(--accent);
}

.music-search-filters {
    position: relative;
}

.music-search-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 14px 40px 14px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 15px center;
    background-size: 16px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-search-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.music-search-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
}

.music-search-select option {
    background-color: #1a1a24;
    color: #fff;
    padding: 10px;
}

.music-search-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--accent), #ff5d86);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.music-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.4);
    background: linear-gradient(135deg, #ff5d86, var(--accent));
}

.music-search-btn:active {
    transform: translateY(1px);
}

/* --- Search Results Grid (Glassmorphism & Bento) --- */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    overflow-y: auto;
    padding: 10px;
    padding-bottom: 40px;
    flex: 1;
}

/* Scrollbar personalizado para el grid */
.search-results-grid::-webkit-scrollbar {
    width: 8px;
}
.search-results-grid::-webkit-scrollbar-track {
    background: transparent;
}
.search-results-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.search-results-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Individual Search Card */
.music-search-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.music-search-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.1), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-search-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 15px rgba(255, 51, 102, 0.1);
    border-color: rgba(255, 51, 102, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.music-search-card:hover::before {
    opacity: 1;
}

.search-card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: rgba(0,0,0,0.3);
    overflow: hidden;
}

.search-card-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.music-search-card:hover .search-card-thumb {
    transform: scale(1.08);
}

.search-card-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.search-card-info {
    padding: 18px 20px 10px 20px;
    flex: 1;
}

.search-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.search-card-author {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.search-card-actions {
    display: flex;
    gap: 12px;
    padding: 15px 20px 20px 20px;
}

/* Action Buttons within Cards */
.search-btn-play, .search-btn-save {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn-play:hover {
    color: #43b581;
    border-color: rgba(67, 181, 129, 0.4);
    background: rgba(67, 181, 129, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 181, 129, 0.2);
}

.search-btn-save:hover {
    color: var(--accent);
    border-color: rgba(255, 51, 102, 0.4);
    background: rgba(255, 51, 102, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.2);
}

.search-btn-play:active, .search-btn-save:active {
    transform: translateY(0);
}

/* Loading & Empty States */
.music-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    font-weight: 500;
}

.music-loading i {
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.music-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.music-empty-state i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.music-empty-state p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ================= MODAL STYLES (Save to Playlist) ================= */
.lyco-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.lyco-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lyco-modal {
    background: rgba(26, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 51, 102, 0.15);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.lyco-modal-overlay.active .lyco-modal {
    transform: translateY(0) scale(1);
}

.lyco-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lyco-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
}

.lyco-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.lyco-modal-close:hover {
    color: #ff3366;
}

.lyco-modal-body {
    padding: 25px;
}

.lyco-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 20px 20px;
}

.lyco-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.lyco-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lyco-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lyco-btn-primary {
    background: var(--accent, #ff3366);
    color: #fff;
}

.lyco-btn-primary:hover {
    background: #ff5d86;
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.search-modal-track-name {
    color: var(--accent, #ff3366);
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
