/* ============================================================
   کارت افقی موزیک (music-horizontal.css)
   برای بخش "آهنگ‌های جدید" در صفحه اصلی
   ============================================================ */

:root {
    --mh-primary: #e94560;
    --mh-primary-dark: #c23152;
    --mh-playing: #10b981;
    --mh-playing-dark: #059669;
    
    /* پس‌زمینه کارت — شیشه‌ای روشن (دارک مود) */
    --mh-bg-card: rgba(255, 255, 255, 0.06);
    --mh-bg-card-hover: rgba(255, 255, 255, 0.1);
    
    --mh-border: rgba(255, 255, 255, 0.08);
    --mh-border-hover: rgba(233, 69, 96, 0.4);
    --mh-text-primary: #ffffff;
    --mh-text-secondary: #c8c8e0;
    --mh-text-muted: #8a8aa0;
    --mh-radius: 18px;
    --mh-radius-sm: 12px;
    --mh-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --mh-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   گرید اصلی
   ============================================ */

.mh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    position: relative;
    z-index: 1;
    padding-bottom: 30px;
}

/* ============================================
   کارت
   ============================================ */

.mh-card {
    min-width: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: mh-entrance 0.6s var(--mh-ease) forwards;
    position: relative;
    padding-bottom: 28px;
}

.mh-card:nth-child(1)  { animation-delay: 0.05s; }
.mh-card:nth-child(2)  { animation-delay: 0.10s; }
.mh-card:nth-child(3)  { animation-delay: 0.15s; }
.mh-card:nth-child(4)  { animation-delay: 0.20s; }
.mh-card:nth-child(5)  { animation-delay: 0.25s; }
.mh-card:nth-child(6)  { animation-delay: 0.30s; }
.mh-card:nth-child(7)  { animation-delay: 0.35s; }
.mh-card:nth-child(8)  { animation-delay: 0.40s; }
.mh-card:nth-child(9)  { animation-delay: 0.45s; }
.mh-card:nth-child(10) { animation-delay: 0.50s; }
.mh-card:nth-child(11) { animation-delay: 0.55s; }
.mh-card:nth-child(12) { animation-delay: 0.60s; }

@keyframes mh-entrance {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ساختار داخلی کارت
   ============================================ */

.mh-card-inner {
    position: relative;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    grid-template-rows: auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: var(--mh-bg-card);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-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(--mh-ease);
    overflow: visible;
}

.mh-card-inner:hover {
    background: var(--mh-bg-card-hover);
    border-color: var(--mh-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);
}

/* ============================================
   کاور (چپ)
   ============================================ */

.mh-cover-link {
    display: block;
    text-decoration: none;
    color: inherit;
    grid-column: 1;
    grid-row: 1;
}

.mh-cover {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--mh-radius-sm);
    overflow: hidden;
    background: #0f0f1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s var(--mh-ease);
}

.mh-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--mh-ease);
}

.mh-card-inner:hover .mh-cover {
    transform: scale(1.03);
}

.mh-card-inner:hover .mh-cover img {
    transform: scale(1.1);
}

/* ============================================
   اطلاعات (وسط)
   ============================================ */

.mh-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding-right: 4px;
}

.mh-artist {
    display: block;
    color: var(--mh-text-primary);
    font-size: 0.95rem;
    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;
}

.mh-song {
    display: block;
    color: var(--mh-text-secondary);
    font-size: 0.8rem;
    font-family: "bakhn", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.mh-card-inner:hover .mh-artist {
    color: #ff8fa3;
}

.mh-card-inner:hover .mh-song {
    color: #b0b0d0;
}

/* ============================================
   آمار (راست) — افقی: لایک و دانلود کنار هم
   ============================================ */

.mh-stats {
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: center;
    justify-content: center;
    grid-column: 3;
    grid-row: 1;
    padding: 0 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.mh-like,
.mh-views {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--mh-text-muted);
    font-family: "bakhn", sans-serif;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mh-like:hover,
.mh-views:hover {
    background: rgba(233, 69, 96, 0.1);
    color: var(--mh-primary);
    transform: scale(1.05);
}

.mh-like i,
.mh-views i {
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.mh-like.liked i {
    color: #ef4444;
}

.mh-like.liked i::before {
    content: "\e90b";
    color: #ef4444;
}

.mh-stat-label {
    font-size: 0.6rem;
    line-height: 1;
    opacity: 0.8;
}

.mh-stat-count {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    font-family: "bakhb", sans-serif;
}

/* ============================================
   دکمه پلی (وسط پایین، نیمه بیرون)
   ============================================ */

.mh-play {
    position: absolute;
    left: 50%;
    bottom: -25px;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    padding: 0;
    background: linear-gradient(135deg, var(--mh-primary), var(--mh-primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 24px rgba(233, 69, 96, 0.5),
        0 0 0 0 rgba(233, 69, 96, 0.7);
    transition: all 0.4s var(--mh-ease-bounce);
    z-index: 10;
    animation: mh-play-pulse 2s ease-in-out infinite;
}

@keyframes mh-play-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.5), 0 0 0 0 rgba(233, 69, 96, 0.7); }
    50%      { box-shadow: 0 8px 24px rgba(233, 69, 96, 0.5), 0 0 0 10px rgba(233, 69, 96, 0); }
}

.mh-play:hover {
    transform: translateX(-50%) scale(1.15);
    background: linear-gradient(135deg, #ff5a75, var(--mh-primary));
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.8);
}

.mh-play i {
    color: #fff;
    font-size: 1.3rem;
    margin-right: 3px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.mh-play:hover i {
    transform: scale(1.1);
}

/* ============================================
   حالت در حال پخش
   ============================================ */

.mh-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);
}

.mh-card-inner.is-playing .mh-play {
    background: linear-gradient(135deg, var(--mh-playing), var(--mh-playing-dark));
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 
        0 8px 24px rgba(16, 185, 129, 0.6),
        0 0 0 8px rgba(16, 185, 129, 0.15);
    animation: mh-playing-pulse 1.5s ease-in-out infinite;
}

@keyframes mh-playing-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6), 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50%      { box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6), 0 0 0 12px rgba(16, 185, 129, 0); }
}

/* ============================================
   موبایل: دکمه پلی همیشه نمایان
   ============================================ */

@media (hover: none) {
    .mh-play {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* ============================================
   ریسپانسیو
   ============================================ */

/* دسکتاپ بزرگ */
@media (min-width: 1400px) {
    .mh-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* دسکتاپ */
@media (max-width: 1200px) {
    .mh-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* لپ‌تاپ */
@media (max-width: 1024px) {
    .mh-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .mh-card-inner {
        grid-template-columns: 80px 1fr auto;
        gap: 12px;
        padding: 12px;
    }

    .mh-cover {
        width: 80px;
        height: 80px;
    }

    .mh-artist {
        font-size: 0.9rem;
    }

    .mh-song {
        font-size: 0.75rem;
    }
}

/* تبلت — ۱ ستون */
@media (max-width: 768px) {
    .mh-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mh-card-inner {
        grid-template-columns: 80px 1fr auto;
        gap: 12px;
        padding: 12px;
    }

    .mh-cover {
        width: 80px;
        height: 80px;
    }

    .mh-artist {
        font-size: 0.9rem;
    }

    .mh-song {
        font-size: 0.75rem;
    }

    .mh-stat-label {
        font-size: 0.55rem;
    }

    .mh-stat-count {
        font-size: 0.6rem;
    }

    .mh-play {
        width: 46px;
        height: 46px;
        bottom: -23px;
    }

    .mh-play i {
        font-size: 1.2rem;
    }

    .mh-card {
        padding-bottom: 26px;
    }
}

/* موبایل — ۱ ستون */
@media (max-width: 480px) {
    .mh-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mh-card-inner {
        grid-template-columns: 70px 1fr auto;
        gap: 10px;
        padding: 10px;
    }

    .mh-cover {
        width: 70px;
        height: 70px;
    }

    .mh-artist {
        font-size: 0.85rem;
    }

    .mh-song {
        font-size: 0.7rem;
    }

    .mh-stat-label {
        font-size: 0.5rem;
    }

    .mh-stat-count {
        font-size: 0.55rem;
    }

    .mh-play {
        width: 42px;
        height: 42px;
        bottom: -21px;
    }

    .mh-play i {
        font-size: 1.1rem;
    }

    .mh-card {
        padding-bottom: 24px;
    }
}