/* ============================================================
   صفحه دسته‌بندی و برچسب — کارت‌های افقی با دکمه پلی
   ============================================================ */

:root {
    --cat-primary: #e94560;
    --cat-primary-dark: #c23152;
    --cat-primary-light: #ff6b6b;
    --cat-playing: #10b981;
    --cat-playing-dark: #059669;
    --cat-bg-card: rgba(255, 255, 255, 0.06);
    --cat-bg-card-hover: rgba(255, 255, 255, 0.1);
    --cat-border: rgba(255, 255, 255, 0.08);
    --cat-border-hover: rgba(233, 69, 96, 0.4);
    --cat-text-primary: #ffffff;
    --cat-text-secondary: #c8c8e0;
    --cat-text-muted: #8a8aa0;
    --cat-radius: 18px;
    --cat-radius-sm: 12px;
    --cat-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --cat-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   هدر صفحه
   ============================================ */

.category-header {
    margin-bottom: 24px;
    padding: 0 4px;
}

.category-title {
    color: var(--cat-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "bakhb", sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.category-title i {
    color: var(--cat-primary);
    font-size: 1.6rem;
    filter: drop-shadow(0 0 12px rgba(233, 69, 96, 0.6));
}

/* ============================================
   گرید
   ============================================ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ============================================
   کارت
   ============================================ */

.cat-card {
    min-width: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: cat-entrance 0.6s var(--cat-ease) forwards;
}

.cat-card:nth-child(1)  { animation-delay: 0.05s; }
.cat-card:nth-child(2)  { animation-delay: 0.10s; }
.cat-card:nth-child(3)  { animation-delay: 0.15s; }
.cat-card:nth-child(4)  { animation-delay: 0.20s; }
.cat-card:nth-child(5)  { animation-delay: 0.25s; }
.cat-card:nth-child(6)  { animation-delay: 0.30s; }
.cat-card:nth-child(7)  { animation-delay: 0.35s; }
.cat-card:nth-child(8)  { animation-delay: 0.40s; }
.cat-card:nth-child(9)  { animation-delay: 0.45s; }
.cat-card:nth-child(10) { animation-delay: 0.50s; }
.cat-card:nth-child(11) { animation-delay: 0.55s; }
.cat-card:nth-child(12) { animation-delay: 0.60s; }

@keyframes cat-entrance {
    to { opacity: 1; transform: translateY(0); }
}

.cat-card-inner {
    position: relative;
    display: grid;
    grid-template-columns: 70px 110px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--cat-bg-card);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    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(--cat-ease);
}

.cat-card-inner:hover {
    background: var(--cat-bg-card-hover);
    border-color: var(--cat-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(-4px);
}

/* ============================================
   دکمه پلی — ستون ۱ (چپ)
   ============================================ */

.cat-play {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    width: 55px;
    height: 55px;
    border: 3px solid rgba(233, 69, 96, 0.3);
    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.3),
        0 0 0 0 rgba(233, 69, 96, 0.5);
    transition: all 0.4s var(--cat-ease-bounce);
    z-index: 10;
    animation: cat-play-pulse 2s ease-in-out infinite;
    justify-self: center;
    align-self: center;
}

@keyframes cat-play-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.3), 0 0 0 0 rgba(233, 69, 96, 0.5); }
    50%      { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.3), 0 0 0 10px rgba(233, 69, 96, 0); }
}

.cat-play:hover {
    transform: scale(1.15);
    background: #f0f0f5;
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.5);
}

.cat-play i {
    color: var(--cat-primary);
    font-size: 1.4rem;
    margin-right: 3px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(233, 69, 96, 0.3));
    transition: transform 0.3s ease;
}

/* حالت در حال پخش */
.cat-card-inner.is-playing {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 
        0 20px 60px rgba(16, 185, 129, 0.2),
        0 0 0 1px rgba(16, 185, 129, 0.3);
}

.cat-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);
}
    box-shadow: 
        0 8px 24px rgba(233, 69, 96, 0.7),
        0 0 0 8px rgba(233, 69, 96, 0.15);
    animation: cat-playing-pulse 1.5s ease-in-out infinite;
}

.cat-card-inner.is-playing .cat-play i {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes cat-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); }
}

/* ============================================
   کاور — ستون ۲ (وسط)
   ============================================ */

.cat-cover-link {
    display: block;
    text-decoration: none;
    color: inherit;
    grid-column: 2;
    grid-row: 1;
}

.cat-cover {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: var(--cat-radius-sm);
    overflow: hidden;
    background: #0f0f1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s var(--cat-ease);
}

.cat-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--cat-ease);
}

.cat-card-inner:hover .cat-cover img {
    transform: scale(1.08);
}

/* ============================================
   اطلاعات — ستون ۳ (راست)
   ============================================ */

.cat-info-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
}

.cat-info-link,
.cat-song-link {
    text-decoration: none;
    color: inherit;
}

/* خواننده */
.cat-artist {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--cat-text-secondary);
    font-size: 0.78rem;
    font-family: "bakhn", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.cat-artist i {
    color: var(--cat-primary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.cat-card-inner:hover .cat-artist {
    color: var(--cat-primary-light);
}

/* نام ترانه */
.cat-song {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--cat-text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    font-family: "bakhb", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.cat-song i {
    color: var(--cat-primary);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.cat-card-inner:hover .cat-song {
    color: var(--cat-primary-light);
}

.cat-card-inner:hover .cat-song i {
    color: var(--cat-primary-light);
}

/* ============================================
   موج صوتی — فقط در حال پخش
   ============================================ */

.cat-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    margin-top: 2px;
}

.cat-card-inner.is-playing .cat-wave {
    opacity: 1;
    visibility: visible;
}

.cat-wave span {
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--cat-primary-light), var(--cat-primary));
    border-radius: 2px;
    transform-origin: bottom;
    box-shadow: 0 0 6px rgba(233, 69, 96, 0.6);
    animation: cat-wave-bounce 1s ease-in-out infinite;
}

.cat-wave span:nth-child(1) { animation-delay: 0.0s; height: 40%; }
.cat-wave span:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.cat-wave span:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.cat-wave span:nth-child(4) { animation-delay: 0.3s; height: 60%; }
.cat-wave span:nth-child(5) { animation-delay: 0.4s; height: 90%; }
.cat-wave span:nth-child(6) { animation-delay: 0.5s; height: 50%; }
.cat-wave span:nth-child(7) { animation-delay: 0.6s; height: 80%; }
.cat-wave span:nth-child(8) { animation-delay: 0.7s; height: 45%; }
.cat-wave span:nth-child(9) { animation-delay: 0.8s; height: 75%; }

@keyframes cat-wave-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1); }
}

/* ============================================
   آمار
   ============================================ */

.cat-stats {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2px;
}

.cat-like,
.cat-views {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--cat-text-muted);
    font-family: "bakhn", sans-serif;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.cat-like:hover,
.cat-views:hover {
    background: rgba(233, 69, 96, 0.1);
    color: var(--cat-primary);
}

.cat-like i,
.cat-views i {
    font-size: 0.9rem;
    line-height: 1;
}

.cat-like.liked i {
    color: #ef4444;
}

.cat-like.liked i::before {
    content: "\e90b";
    color: #ef4444;
}

.cat-stat-count {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    font-family: "bakhb", sans-serif;
}

/* ============================================
   صفحه‌بندی
   ============================================ */

.category-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) {
    .cat-play {
        opacity: 1;
    }
}

/* ============================================
   ریسپانسیو
   ============================================ */

@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .cat-card-inner {
        grid-template-columns: 60px 100px 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .cat-cover {
        width: 100px;
        height: 100px;
    }
    
    .cat-play {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .category-title {
        font-size: 1.2rem;
    }
    
    .category-title i {
        font-size: 1.3rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .cat-card-inner {
        grid-template-columns: 55px 90px 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .cat-cover {
        width: 90px;
        height: 90px;
    }
    
    .cat-play {
        width: 45px;
        height: 45px;
        border-width: 2.5px;
    }
    
    .cat-play i {
        font-size: 1.15rem;
    }
    
    .cat-song {
        font-size: 0.85rem;
    }
    
    .cat-artist {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cat-card-inner {
        grid-template-columns: 50px 80px 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .cat-cover {
        width: 80px;
        height: 80px;
    }
    
    .cat-play {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .cat-play i {
        font-size: 1rem;
    }
    
    .cat-song {
        font-size: 0.8rem;
    }
    
    .cat-artist {
        font-size: 0.65rem;
    }
    
    .cat-stat-count {
        font-size: 0.6rem;
    }
    
    .cat-wave {
        height: 14px;
    }
    
    .cat-wave span {
        width: 2px;
    }
}