/* کارت کلی */
.nikoo-audio-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
    max-width: 960px;
    margin: 20px auto;
    box-sizing: border-box;
}

/* ساختار اصلی */
.nikoo-audio-main {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* دکمه پخش */
.nikoo-audio-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #f4b400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(244,180,0,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.nikoo-audio-play-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(244,180,0,0.5);
}

/* آیکن‌ها */
.nikoo-audio-icon {
    position: absolute;
    width: 0;
    height: 0;
}

.nikoo-icon-play {
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
}

.nikoo-icon-pause {
    display: none;
    width: 14px;
    height: 18px;
    border-left: 4px solid #ffffff;
    border-right: 4px solid #ffffff;
}

/* وقتی در حال پخش است */
.nikoo-audio-card.is-playing .nikoo-icon-play {
    display: none;
}
.nikoo-audio-card.is-playing .nikoo-icon-pause {
    display: block;
}

/* بخش میانی */
.nikoo-audio-center {
    flex: 1;
    min-width: 0; /* جلوگیری از افتادن متن روی عکس */
}

/* عنوان */
.nikoo-audio-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
}

/* ویو موج */
.nikoo-audio-wave {
    display: flex;
    align-items: flex-end;
    gap: 2px;                  /* فاصله کم بین خطوط موج */
    height: 26px;
    margin-bottom: 8px;
    width: 100%;               /* کل عرض زیر عنوان */
    justify-content: space-between;
}

.nikoo-audio-wave span {
    width: 3px;                /* ضخامت هر خط موج */
    border-radius: 2px;
    background: rgba(0,0,0,0.12);
    height: 6px;
    transition: height 0.2s ease;
}

/* انیمیشن موج هنگام پخش */
@keyframes nikoo-wave {
    0%   { height: 6px; }
    50%  { height: 22px; }
    100% { height: 8px; }
}

.nikoo-audio-card.is-playing .nikoo-audio-wave span {
    background: #f4b400;
    animation: nikoo-wave 0.9s infinite ease-in-out;
}

/* الگوی تأخیر انیمیشن برای چندین span (هر 3تا یک‌بار تکرار می‌شود) */
.nikoo-audio-card.is-playing .nikoo-audio-wave span:nth-child(3n+1) {
    animation-delay: 0s;
}
.nikoo-audio-card.is-playing .nikoo-audio-wave span:nth-child(3n+2) {
    animation-delay: 0.1s;
}
.nikoo-audio-card.is-playing .nikoo-audio-wave span:nth-child(3n+3) {
    animation-delay: 0.2s;
}

/* نوار پیشرفت */
.nikoo-audio-progress {
    position: relative;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 6px;
    cursor: pointer;   /* برای اینکه کاربر بفهمد قابل کلیک است */
    direction: ltr;    /* محاسبه راحت‌تر برای کلیک */
}

.nikoo-audio-progress-bar {
    position: absolute;
    top: 0;
    left: 0;           /* از چپ شروع شود */
    right: auto;
    height: 100%;
    width: 0%;
    background: #f4b400;
    transition: width 0.15s linear;
}

/* زمان */
.nikoo-audio-time {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #555;
}

/* تصویر کاور */
.nikoo-audio-image img {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* ریسپانسیو: تبلت و موبایل */
@media (max-width: 768px) {
    .nikoo-audio-card {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 16px 18px;
        margin: 16px 12px;
        max-width: 100%;
    }

    .nikoo-audio-main {
        flex-direction: row-reverse;
        align-items: center;
        gap: 12px;
    }

    .nikoo-audio-image img {
        width: 80px;
        height: 80px;
    }

    .nikoo-audio-title {
        font-size: 15px;
        line-height: 1.6;
    }

    .nikoo-audio-wave {
        height: 22px;
        margin-bottom: 6px;
    }

    .nikoo-audio-time {
        font-size: 11px;
    }
}

/* ریسپانسیو: موبایل کوچک */
@media (max-width: 480px) {
    .nikoo-audio-card {
        margin: 12px 8px;
        padding: 12px;
    }

    .nikoo-audio-main {
        gap: 10px;
    }

    .nikoo-audio-play-btn {
        width: 48px;
        height: 48px;
    }

    .nikoo-audio-image img {
        width: 64px;
        height: 64px;
    }

    .nikoo-audio-title {
        font-size: 13px;
        line-height: 1.7;
    }

    .nikoo-audio-time {
        font-size: 10px;
    }
}
