/* ========================================================
   Single Media Page Styles (em_media)
   ======================================================== */

.em-single-media-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'IRANSansWeb', Tahoma, sans-serif !important;
    direction: rtl;
    color: #333;
}

/* --- Hero Section (Top Info & Image) --- */
.em-media-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}
.box-title {
    display: flex;
    gap: 10px;
    margin-top: 48px;
    margin-bottom: 16px;
    h3{
        color: #424242;
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 900;
    }
}
.em-media-info {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.em-media-title {
    color: #424242;
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 6px;
}
.em-media-program-name{
    color: #616161;
    font-size: 16px;
    margin-bottom: 18px;
}


.em-media-image-wrapper {
    flex-shrink: 0;
    width: 350px;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.em-media-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Audio Player & Download --- */
.em-media-player-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #eaeaea;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.em-media-audio {
    flex: 1;
    min-width: 250px;
    width: 100%;
}

.em-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /*background-color: #0073aa;*/
    color: #fff;
    /*padding: 12px 24px;*/
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.em-download-btn:hover {
    /*background-color: #005177;*/
    color: #7b000d;
}
/* --- Content / Description --- */
.em-media-content {
    line-height: 1.8;
    font-size: 16px;
    color: #444;
    margin-bottom: 50px;
}

/* --- Two Column Layout for Related Info --- */
.em-media-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.em-info-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.em-info-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    color: #111;
}

/* Series Link Style inside Box */
.em-series-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.em-series-link:hover {
    transform: translateX(-5px);
}

.em-series-link img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.em-series-link div h4 {
    margin: 0 0 5px 0;
    color: #0073aa;
}

.em-series-link div p {
    margin: 0;
    font-size: 13px;
    color: #777;
}

/* Program Info Style */
.em-program-details p {
    margin: 10px 0;
    font-size: 14px;
}

.em-program-details strong {
    color: #333;
}

/* --- Related Sessions (Other Media in Series) --- */
.em-related-sessions {
    margin-top: 40px;
}

.em-related-sessions h3 {
    color: #424242;
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 900;
}
.em-section-header h3{
    color: #424242;
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 900;
}

.em-media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}


.em-media-cover {
    width: 25%;
    img {
        border-radius: 26px;
    }
}

ul.em-media-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 2;
    li {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
}


/* ========================================================
   Custom Player style
   ======================================================== */
   .em-custom-audio-player {
    width: 100%;
    margin: 20px 0 10px;
    font-family: inherit; /* از فونت ایران سنس شما استفاده میکند */
}

/* Progress Bar */
.em-audio-progress-container {
    width: 100%;
    height: 6px;
    background-color: #d1d1d1;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 20px;
}

.em-audio-progress-bar {
    height: 100%;
    background-color: #7b000d; /* رنگ قرمز تیره مشابه تصویر */
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.em-audio-progress-bar::after {
    content: '';
    position: absolute;
    right: -6px; /* چون rtl/ltr ممکنه متفاوت باشه تنظیم کنید */
    top: -5px;
    width: 16px;
    height: 16px;
    background-color: white;
    border: 3px solid #7b000d;
    border-radius: 50%;
}

/* Controls */
.em-audio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.em-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-play-btn {
    width: 50px;
    height: 50px;
    background-color: #7b000d;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 0;
    padding: 0;

    img{
        width: 15px;
    }
}

.em-speed-btn {
    background: transparent;
    border: 1px solid #7b000d;
    color: #7b000d;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    height: 32px;
    width: 33px;
        margin-bottom: 0;
}

.em-quality-badge {
    display: flex;
    align-items: center;
    border: 1px solid #999;
    color: #555;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
}

.em-time-display {
    font-size: 12px;
    color: #777;
    direction: ltr;
}

.em-download-btn {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.em-timestamps-toggle {
    width: 100%;
    background-color: #7b000d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 20px;
}

/* ========================================================
   Timestamps Accordion Styles
   ======================================================== */
.em-timestamps-accordion summary {
    list-style: none; 
    outline: none;
    user-select: none;
    transition: opacity 0.2s ease;
}

.em-timestamps-accordion summary::-webkit-details-marker {
    display: none; /* حذف فلش پیش‌فرض مرورگر */
}

.em-timestamps-accordion summary:hover {
    opacity: 0.8;
}

/* ساخت آیکون فلش (Chevron) با CSS خالص */
.em-arrow-icon {
    margin-left: 13px;
    margin-right: 8px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: translateY(-3px) rotate(45deg); /* چرخش به سمت پایین */
    transition: transform 0.3s ease; /* حرکت نرم هنگام تغییر وضعیت */
    display: inline-block;
}

/* تغییر وضعیت فلش به سمت بالا در هنگام باز شدن (open) */
.em-timestamps-accordion[open] .em-arrow-icon {
    transform: translateY(2px) rotate(225deg);
}

/* انیمیشن نرم برای باز شدن محتوای ul */
.em-timestamps-accordion[open] .em-timestamps-list {
    animation: smoothSlideDown 0.4s ease-out forwards;
}

@keyframes smoothSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* افکت هاور برای ردیف‌های زمانی */
.em-timestamps-list li:hover {
    background-color: #ebebeb;
    border-radius: 6px;
    padding-right: 12px !important;
}

.em-timestamps-section summary.title {
        align-items: center;
    background-color: #77000b;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 32px;
    padding: 4px 10px;
}

ul.em-timestamps-list {
    margin: 10px 0;
    background: #f9f9f9;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #eee;
    
    
}
   
   
ul.em-timestamps-list .em-seek-btn {
       margin: 0px;
    cursor: pointer;
    border-bottom: 1px solid #bdbdbd;
    padding: 10px 5px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

   
   
ul.em-timestamps-list .em-seek-btn:last-child {
    border-bottom: 0px;
}

/* ========================================================
   Responsive Design (Mobile & Tablet)
   ======================================================== */

@media (max-width: 992px) {
    .em-media-details-grid {
        grid-template-columns: 1fr; /* Stack program and series info */
    }
}

@media (max-width: 768px) {
    .em-media-hero {
        flex-direction: column-reverse;
        padding: 20px;
    }

    .em-media-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .em-media-title {
        font-size: 24px;
    }

    .em-media-player-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .em-download-btn {
        justify-content: center;
    }
}
