﻿/* =========================================================
   MAJALES AHVAZ
   PREMIUM AUDIO PLAYER — V2
========================================================= */


/* =========================================================
   PLAYER
========================================================= */

.custom-audio-player {
    position: relative;
    width: 100%;
    padding: 16px;
    direction: rtl;
    background: linear-gradient( 145deg, #ffffff 0%, #f9fcfa 100% );
    border: 1px solid #e4ece8;
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(20, 62, 43, .045);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}


    /* =========================================================
   TOP LIGHT EFFECT
========================================================= */

    .custom-audio-player::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 90px;
        height: 2px;
        background: linear-gradient( 90deg, transparent, #16845a );
        opacity: .35;
        transition: width .3s ease, opacity .3s ease;
    }


    .custom-audio-player:hover::before {
        width: 150px;
        opacity: .65;
    }


    /* =========================================================
   HOVER
========================================================= */

    .custom-audio-player:hover {
        transform: translateY(-2px);
        border-color: #d3e2da;
        box-shadow: 0 14px 34px rgba(20, 62, 43, .075);
    }


    /* =========================================================
   PLAYING
========================================================= */

    .custom-audio-player.is-playing {
        border-color: rgba(22, 132, 90, .24);
        box-shadow: 0 12px 34px rgba(22, 132, 90, .085);
    }


        .custom-audio-player.is-playing::before {
            width: 170px;
            opacity: .8;
        }


    /* =========================================================
   HIDE NATIVE AUDIO
========================================================= */

    .custom-audio-player .audio-player {
        display: none;
    }


/* =========================================================
   TOP
========================================================= */

.player-top {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}


/* =========================================================
   COVER
========================================================= */

.player-cover {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient( 145deg, #edf8f1, #d9ede1 );
    box-shadow: inset 0 0 0 1px rgba(22,132,90,.08);
    transition: transform .25s ease, box-shadow .25s ease;
}


.custom-audio-player:hover .player-cover {
    transform: scale(1.025);
    box-shadow: inset 0 0 0 1px rgba(22,132,90,.12), 0 5px 15px rgba(22,132,90,.08);
}


.player-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


/* =========================================================
   COVER PLACEHOLDER
========================================================= */

.player-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16845a;
    font-size: 22px;
    font-weight: 700;
}


/* =========================================================
   INFO
========================================================= */

.player-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}


/* =========================================================
   LABEL
========================================================= */

.player-label {
    display: flex;
    align-items: center;
    min-height: 13px;
    color: #16845a;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .25px;
}


/* =========================================================
   PLAYING INDICATOR
========================================================= */

.custom-audio-player.is-playing .player-label::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: #16845a;
    box-shadow: 0 0 0 4px rgba(22,132,90,.09);
    animation: playerPulse 1.5s infinite;
}


@keyframes playerPulse {

    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .45;
        transform: scale(.8);
    }
}


/* =========================================================
   TITLE
========================================================= */

.player-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #17261e;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}


/* =========================================================
   PLAY BUTTON
========================================================= */

.player-play-button {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient( 145deg, #239362, #116c49 );
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(18,107,72,.20);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}


    .player-play-button:hover {
        transform: scale(1.07);
        box-shadow: 0 10px 25px rgba(18,107,72,.27);
        background: linear-gradient( 145deg, #299f69, #0f6041 );
    }


    .player-play-button:active {
        transform: scale(.94);
    }


    .player-play-button:focus-visible {
        outline: 3px solid rgba(22,132,90,.18);
        outline-offset: 3px;
    }


/* =========================================================
   PLAY ICON
========================================================= */

.play-icon,
.pause-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}


.play-icon {
    transform: translateX(-1px);
}


.pause-icon {
    display: none;
}


.custom-audio-player.is-playing .play-icon {
    display: none;
}


.custom-audio-player.is-playing .pause-icon {
    display: inline-flex;
}


/* =========================================================
   PROGRESS AREA
========================================================= */

.player-progress-area {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
}


/* =========================================================
   TIME
========================================================= */

.player-time {
    flex: 0 0 auto;
    min-width: 35px;
    color: #89968f;
    font-size: 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: center;
}


/* =========================================================
   PROGRESS
========================================================= */

.player-progress {
    flex: 1;
    min-width: 0;
}


/* =========================================================
   PROGRESS RANGE
========================================================= */

.progress-range {
    appearance: none;
    width: 100%;
    height: 4px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    outline: none;
    background: #e4ece8;
    cursor: pointer;
    direction: ltr;
}


    /* =========================================================
   CHROME / EDGE / SAFARI
========================================================= */

    .progress-range::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: 999px;
        background: #e4ece8;
    }


    .progress-range::-webkit-slider-thumb {
        appearance: none;
        width: 12px;
        height: 12px;
        margin-top: -4px;
        border: 3px solid #ffffff;
        border-radius: 50%;
        background: #16845a;
        box-shadow: 0 2px 7px rgba(22,132,90,.25);
        transition: transform .2s ease, box-shadow .2s ease;
    }


        .progress-range::-webkit-slider-thumb:hover {
            transform: scale(1.25);
            box-shadow: 0 3px 10px rgba(22,132,90,.32);
        }


    /* =========================================================
   FIREFOX
========================================================= */

    .progress-range::-moz-range-track {
        height: 4px;
        border-radius: 999px;
        background: #e4ece8;
    }


    .progress-range::-moz-range-progress {
        height: 4px;
        border-radius: 999px;
        background: #16845a;
    }


    .progress-range::-moz-range-thumb {
        width: 12px;
        height: 12px;
        border: 3px solid #ffffff;
        border-radius: 50%;
        background: #16845a;
        box-shadow: 0 2px 7px rgba(22,132,90,.25);
    }


/* =========================================================
   BOTTOM
========================================================= */

.player-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
}


/* =========================================================
   VOLUME
========================================================= */

.player-volume {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}


/* =========================================================
   CONTROL
========================================================= */

.player-control {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #73827a;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}


    .player-control:hover {
        background: #edf7f1;
        color: #16845a;
        transform: scale(1.04);
    }


    .player-control:focus-visible {
        outline: 2px solid rgba(22,132,90,.22);
        outline-offset: 2px;
    }


/* =========================================================
   VOLUME RANGE
========================================================= */

.volume-range {
    appearance: none;
    width: 65px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: #e4ece8;
    cursor: pointer;
    direction: ltr;
}


    .volume-range::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: 999px;
        background: #e4ece8;
    }


    .volume-range::-webkit-slider-thumb {
        appearance: none;
        width: 10px;
        height: 10px;
        margin-top: -3px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background: #16845a;
        box-shadow: 0 1px 5px rgba(22,132,90,.22);
    }


    .volume-range::-moz-range-track {
        height: 4px;
        border-radius: 999px;
        background: #e4ece8;
    }


    .volume-range::-moz-range-progress {
        height: 4px;
        border-radius: 999px;
        background: #16845a;
    }


    .volume-range::-moz-range-thumb {
        width: 10px;
        height: 10px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background: #16845a;
        box-shadow: 0 1px 5px rgba(22,132,90,.22);
    }


/* =========================================================
   DETAILS
========================================================= */

.player-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 2px;
    color: #6d7d75 !important;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none !important;
    transition: color .2s ease, gap .2s ease;
}


    /* Accent line */

    .player-more::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 0;
        width: 0;
        height: 1px;
        background: #16845a;
        transition: width .25s ease;
    }


    /* Arrow */

    .player-more span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #16845a;
        font-size: 12px;
        line-height: 1;
        transition: transform .2s ease;
    }


    /* Hover */

    .player-more:hover {
        color: #16845a !important;
        gap: 9px;
    }


        .player-more:hover::after {
            width: 100%;
        }


        .player-more:hover span {
            transform: translateX(-3px);
        }


    /* Focus */

    .player-more:focus-visible {
        outline: 2px solid rgba(22,132,90,.20);
        outline-offset: 4px;
        border-radius: 4px;
    }


/* =========================================================
   DOWNLOAD
========================================================= */

.player-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #dcebe2;
    border-radius: 8px;
    background: #f5faf7;
    color: #16714d !important;
    font-size: 8px;
    font-weight: 750;
    text-decoration: none !important;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}


    .player-download span {
        font-size: 13px;
        line-height: 1;
    }


    .player-download:hover {
        background: #e8f6ed;
        border-color: #c9dfd2;
        color: #0d583b !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(22,132,90,.07);
    }


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 576px) {

    .custom-audio-player {
        padding: 14px;
        border-radius: 16px;
    }


    .player-top {
        gap: 10px;
    }


    .player-cover {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }


    .player-cover-placeholder {
        font-size: 19px;
    }


    .player-play-button {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }


    .player-title {
        font-size: 11px;
    }


    .player-label {
        font-size: 7px;
    }


    .player-progress-area {
        gap: 6px;
        margin-top: 14px;
    }


    .player-time {
        min-width: 32px;
        font-size: 7px;
    }


    .player-bottom {
        gap: 8px;
        margin-top: 11px;
    }


    .volume-range {
        width: 48px;
    }


    .player-more {
        min-height: 28px;
        font-size: 8px;
    }


        .player-more span {
            font-size: 11px;
        }


    .player-download {
        min-height: 28px;
        padding: 5px 8px;
        font-size: 7px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .custom-audio-player {
        padding: 12px;
        border-radius: 15px;
    }


    .player-cover {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }


    .player-play-button {
        flex-basis: 39px;
        width: 39px;
        height: 39px;
    }


    .player-title {
        font-size: 10px;
    }


    .player-bottom {
        gap: 5px;
    }


    .volume-range {
        width: 40px;
    }


    .player-more {
        font-size: 7px;
    }


    .player-download {
        padding: 5px 6px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .custom-audio-player,
    .player-cover,
    .player-play-button,
    .player-control,
    .player-more,
    .player-download,
    .progress-range::-webkit-slider-thumb {
        transition: none !important;
    }


        .custom-audio-player.is-playing .player-label::before {
            animation: none;
        }
}
