/* ============================================================
   صفحه نتایج جستجو — کارت‌های مربعی
   ============================================================ */

:root {
    --sr-primary: #e94560;
    --sr-primary-dark: #c23152;
    --sr-primary-light: #ff6b6b;
    --sr-playing: #10b981;
    --sr-playing-dark: #059669;
    --sr-bg-card: rgba(255, 255, 255, 0.06);
    --sr-bg-card-hover: rgba(255, 255, 255, 0.1);
    --sr-border: rgba(255, 255, 255, 0.08);
    --sr-border-hover: rgba(233, 69, 96, 0.4);
    --sr-text-primary: #ffffff;
    --sr-text-secondary: #c8c8e0;
    --sr-text-muted: #8a8aa0;
    --sr-radius: 18px;
    --sr-radius-sm: 12px;
    --sr-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --sr-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   هدر جستجو
   ============================================ */

.search-header {
    margin: 20px 0 30px;
}

.search-header-inner {
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--sr-border);
    border-radius: 20px;
    padding: 8px;
    transition: border-color 0.3s ease;
}

.search-header-inner:focus-within {
    border-color: rgba(233, 69, 96, 0.4);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form-icon {
    color: var(--sr-text-muted);
    font-size: 1.1rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.search-form-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sr-text-primary);
    font-size: 1rem;
    font-family: "bakhn", sans-serif;
    padding: 12px 4px;
    outline: none;
    min-width: 0;
}

.search-form-input::placeholder {
    color: var(--sr-text-muted);
}

.search-form-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sr-primary), var(--sr-primary-dark));
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s var(--sr-ease);
    flex-shrink: 0;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

.search-form-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.5);
}

/* تعداد نتایج */
.search-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    color: var(--sr-text-secondary);
    font-size: 0.85rem;
    font-family: "bakhn", sans-serif;
}

.search-meta i {
    color: var(--sr-primary);
    font-size: 0.9rem;
}

.search-meta strong {
    color: var(--sr-text-primary);
    font-family: "bakhb", sans-serif;
    font-weight: 700;
}

.search-meta-term {
    color: var(--sr-primary) !important;
}

/* ============================================
   گرید نتایج
   ============================================ */

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ============================================
   کارت
   ============================================ */

.search-card {
    min-width: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: sr-entrance 0.6s var(--sr-ease) forwards;
}

.search-card:nth-child(1)  { animation-delay: 0.05s; }
.search-card:nth-child(2)  { animation-delay: 0.10s; }
.search-card:nth-child(3)  { animation-delay: 0.15s; }
.search-card:nth-child(4)  { animation-delay: 0.20s; }
.search-card:nth-child(5)  { animation-delay: 0.25s; }
.search-card:nth-child(6)  { animation-delay: 0.30s; }
.search-card:nth-child(7)  { animation-delay: 0.35s; }
.search-card:nth-child(8)  { animation-delay: 0.40s; }
.search-card:nth-child(9)  { animation-delay: 0.45s; }
.search-card:nth-child(10) { animation-delay: 0.50s; }
.search-card:nth-child(11) { animation-delay: 0.55s; }
.search-card:nth-child(12) { animation-delay: 0.60s; }

@keyframes sr-entrance {
    to { opacity: 1; transform: translateY(0); }
}

.search-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--sr-bg-card);
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.5s var(--sr-ease);
    height: 100%;
}

.search-card-inner:hover {
    background: var(--sr-bg-card-hover);
    border-color: var(--sr-border-hover);
    box-shadow: 
        0 16px 48px rgba(233, 69, 96, 0.2),
        0 0 0 1px rgba(233, 69, 96, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-6px);
}

/* ============================================
   کاور
   ============================================ */

.search-card-cover-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.search-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #0f0f1a;
}

.search-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s var(--sr-ease), filter 0.5s ease;
}

.search-card-inner:hover .search-card-cover img {
    transform: scale(1.08);
    filter: brightness(0.85);
}

/* گرادیان پایین کاور */
.search-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 60%,
        rgba(15, 15, 26, 0.4) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   دکمه پلی
   ============================================ */

.search-card-play {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 24px rgba(233, 69, 96, 0.4),
        0 0 0 0 rgba(233, 69, 96, 0.6);
    transition: all 0.4s var(--sr-ease-bounce);
    z-index: 5;
    animation: sr-play-pulse 2s ease-in-out infinite;
}

@keyframes sr-play-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4), 0 0 0 0 rgba(233, 69, 96, 0.6); }
    50%      { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4), 0 0 0 10px rgba(233, 69, 96, 0); }
}

.search-card-play:hover {
    transform: scale(1.15);
    background: #f0f0f5;
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.6);
}

.search-card-play i {
    color: var(--sr-primary);
    font-size: 1.2rem;
    margin-right: 3px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(233, 69, 96, 0.3));
    transition: transform 0.3s ease;
}

/* حالت در حال پخش */
.search-card-inner.is-playing {
    border-color: rgba(233, 69, 96, 0.5);
    box-shadow: 
        0 20px 60px rgba(233, 69, 96, 0.2),
        0 0 0 1px rgba(233, 69, 96, 0.3);
}

.search-card-inner.is-playing .search-card-play {
    background: linear-gradient(135deg, var(--sr-primary), var(--sr-primary-dark));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 24px rgba(233, 69, 96, 0.7),
        0 0 0 8px rgba(233, 69, 96, 0.15);
    animation: sr-playing-pulse 1.5s ease-in-out infinite;
}

.search-card-inner.is-playing .search-card-play i {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes sr-playing-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.7), 0 0 0 0 rgba(233, 69, 96, 0.4); }
    50%      { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.7), 0 0 0 12px rgba(233, 69, 96, 0); }
}

/* ============================================
   موج صوتی — فقط در حال پخش
   ============================================ */

.search-wave {
    position: absolute;
    bottom: 18px;
    right: 14px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.search-card-inner.is-playing .search-wave {
    opacity: 1;
    visibility: visible;
}

.search-wave span {
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--sr-primary-light), var(--sr-primary));
    border-radius: 2px;
    transform-origin: bottom;
    box-shadow: 0 0 6px rgba(233, 69, 96, 0.6);
    animation: sr-wave-bounce 1s ease-in-out infinite;
}

.search-wave span:nth-child(1) { animation-delay: 0.0s; height: 40%; }
.search-wave span:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.search-wave span:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.search-wave span:nth-child(4) { animation-delay: 0.3s; height: 60%; }
.search-wave span:nth-child(5) { animation-delay: 0.4s; height: 90%; }
.search-wave span:nth-child(6) { animation-delay: 0.5s; height: 50%; }
.search-wave span:nth-child(6) { animation-delay: 0.5s; height: 50%; }
.search-wave span:nth-child(7) { animation-delay: 0.6s; height: 80%; }
.search-wave span:nth-child(8) { animation-delay: 0.7s; height: 45%; }
.search-wave span:nth-child(9) { animation-delay: 0.8s; height: 75%; }

@keyframes sr-wave-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1); }
}

/* ============================================
   اطلاعات کارت
   ============================================ */

.search-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
    flex: 1;
}

.search-card-info-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.search-card-title {
    display: block;
    color: var(--sr-text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: "bakhb", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.search-card-inner:hover .search-card-title {
    color: var(--sr-primary-light);
}

.search-card-artist {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--sr-text-secondary);
    font-size: 0.72rem;
    font-family: "bakhn", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-card-artist i {
    color: var(--sr-primary);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ============================================
   آمار
   ============================================ */

.search-card-stats {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.search-card-like,
.search-card-views {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--sr-text-muted);
    font-family: "bakhb", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.search-card-like:hover,
.search-card-views:hover {
    background: rgba(233, 69, 96, 0.1);
    color: var(--sr-primary);
}

.search-card-like i,
.search-card-views i {
    font-size: 0.85rem;
    line-height: 1;
}

.search-card-like.liked i {
    color: #ef4444;
}

.search-card-like.liked i::before {
    content: "\e90b";
    color: #ef4444;
}

/* ============================================
   حالت خالی
   ============================================ */

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
    background: rgba(26, 26, 46, 0.3);
    border: 1px solid var(--sr-border);
    border-radius: 24px;
}

.search-empty > i {
    font-size: 3.5rem;
    color: var(--sr-primary);
    opacity: 0.3;
}

.search-empty h2 {
    color: var(--sr-text-primary);
    font-family: "bakhb", sans-serif;
    font-size: 1.3rem;
    margin: 0;
}

.search-empty p {
    color: var(--sr-text-muted);
    font-family: "bakhn", sans-serif;
    font-size: 0.9rem;
    margin: 0;
    max-width: 400px;
}

.search-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--sr-primary), var(--sr-primary-dark));
    color: #ffffff;
    font-family: "bakhb", sans-serif;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.search-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.5);
}

/* ============================================
   صفحه‌بندی
   ============================================ */

.search-pagination {
    margin-top: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ============================================
   موبایل: دکمه پلی همیشه نمایان
   ============================================ */

@media (hover: none) {
    .search-card-play {
        opacity: 1;
    }
}

/* ============================================
   ریسپانسیو
   ============================================ */

@media (max-width: 1200px) {
    .search-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    
    .search-card-play {
        width: 44px;
        height: 44px;
    }
    
    .search-card-play i {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .search-header {
        margin: 16px 0 24px;
    }
    
    .search-form-input {
        font-size: 0.9rem;
        padding: 10px 4px;
    }
    
    .search-form-btn {
        width: 40px;
        height: 40px;
    }
    
    .search-meta {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .search-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .search-card-info {
        padding: 10px 12px 12px;
    }
    
    .search-card-title {
        font-size: 0.78rem;
    }
    
    .search-card-artist {
        font-size: 0.65rem;
    }
    
    .search-card-play {
        width: 40px;
        height: 40px;
        bottom: 10px;
        left: 10px;
        border-width: 2.5px;
    }
    
    .search-card-play i {
        font-size: 1rem;
    }
    
    .search-wave {
        bottom: 14px;
        right: 10px;
        height: 18px;
    }
    
    .search-empty {
        padding: 60px 16px;
    }
    
    .search-empty > i {
        font-size: 2.5rem;
    }
    
    .search-empty h2 {
        font-size: 1.1rem;
    }
    
    .search-empty p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .search-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .search-card-inner {
        border-radius: 14px;
    }
    
    .search-card-info {
        padding: 8px 10px 10px;
    }
    
    .search-card-title {
        font-size: 0.72rem;
    }
    
    .search-card-artist {
        font-size: 0.6rem;
    }
    
    .search-card-stats {
        gap: 6px;
        padding-top: 6px;
    }
    
    .search-card-like,
    .search-card-views {
        font-size: 0.6rem;
        padding: 3px 4px;
    }
    
    .search-card-play {
        width: 36px;
        height: 36px;
        bottom: 8px;
        left: 8px;
        border-width: 2px;
    }
    
    .search-card-play i {
        font-size: 0.9rem;
    }
    
    .search-wave {
        bottom: 12px;
        right: 8px;
        height: 14px;
        gap: 2px;
    }
    
    .search-wave span {
        width: 2px;
    }
}