/**
 * Filmix Download Modal Styles – Dark / Match Single Movie Theme
 */

.filmix-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    direction: rtl;
    font-family: inherit;
}

.filmix-modal-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(229, 9, 20, 0.5), transparent 55%),
                rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* کارت مدال */
.filmix-modal-content {
    position: relative;
    width: 90%;
    max-width: 520px;
    margin: 6% auto;
    background: #101020;
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    animation: filmixModalSlideIn 0.3s ease-out;
}

/* هدر مدال */
.filmix-modal-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, #e50914, #b20710);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filmix-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

/* دکمه بستن */
.filmix-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #ffe4e4;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: all 0.25s ease;
}

.filmix-modal-close:hover {
    background: rgba(0, 0, 0, 0.18);
    color: #ffffff;
}

/* بدنه مدال */
.filmix-modal-body {
    padding: 26px 24px 24px;
    text-align: center;
    background: radial-gradient(circle at top, rgba(229, 9, 20, 0.15), transparent 55%),
                #151528;
    color: #f5f5ff;
}

/* Loader */
.filmix-loader {
    width: 54px;
    height: 54px;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid #e50914;
    border-radius: 50%;
    animation: filmixSpin 1s linear infinite;
    margin: 0 auto 18px;
}

/* متن وضعیت */
.filmix-status-text {
    font-size: 15px;
    color: #d0d0ff;
    margin: 10px 0 14px;
    font-weight: 500;
}

/* Progress */
.filmix-progress-wrapper {
    margin: 14px 0 10px;
}

.filmix-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.filmix-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e50914 0%, #f89c1b 40%, #1db954 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
    animation: filmixProgressShine 1.5s infinite;
}

.filmix-progress-text {
    display: block;
    font-size: 13px;
    color: #f89c1b;
    font-weight: 600;
}

/* اطلاعات فایل */
.filmix-download-info {
    background: rgba(5, 5, 15, 0.85);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 18px 0 8px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.filmix-info-item {
    margin: 6px 0;
    font-size: 13px;
    color: #d0d0ff;
}

.filmix-info-item strong {
    color: #ffffff;
    margin-left: 6px;
}

/* حالت آماده (موفقیت) */
.filmix-download-ready {
    display: none;
    margin-top: 18px;
    text-align: center;
}

.filmix-success-icon {
    width: 70px;
    height: 70px;
    background: #23c55e;
    color: #ffffff;
    font-size: 38px;
    line-height: 70px;
    border-radius: 50%;
    margin: 0 auto 12px;
    box-shadow: 0 0 0 6px rgba(35, 197, 94, 0.2);
    animation: filmixSuccessPop 0.5s ease-out;
}

.filmix-success-text {
    font-size: 16px;
    font-weight: 600;
    color: #23c55e;
    margin: 8px 0 14px;
}

/* دکمه نهایی دانلود */
.filmix-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #2271b1 0%, #72aee6 50%, #46b450 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(34, 113, 177, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.filmix-download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(34, 113, 177, 0.7);
    background: linear-gradient(135deg, #1b5f8f 0%, #5ba4e0 50%, #2fad4a 100%);
}

.filmix-download-button .dashicons {
    margin-left: 4px;
    font-size: 18px;
    line-height: 1;
}

/* حالت خطا */
.filmix-download-error {
    display: none;
    margin-top: 18px;
}

.filmix-error-icon {
    width: 70px;
    height: 70px;
    background: #dc2626;
    color: #ffffff;
    font-size: 38px;
    line-height: 70px;
    border-radius: 50%;
    margin: 0 auto 12px;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.2);
    animation: filmixErrorShake 0.5s;
}

.filmix-error-text {
    font-size: 15px;
    color: #fecaca;
    margin: 10px 0 16px;
    font-weight: 500;
}

.filmix-retry-button {
    padding: 9px 22px;
    background: #e50914;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.5);
}

.filmix-retry-button:hover {
    background: #b20710;
    transform: translateY(-1px);
}

/* انیمیشن‌ها */
@keyframes filmixModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes filmixSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes filmixProgressShine {
    0%   { opacity: 1; }
    50%  { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes filmixSuccessPop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes filmixErrorShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-6px); }
    80%      { transform: translateX(6px); }
}

/* ریسپانسیو */
@media (max-width: 600px) {
    .filmix-modal-content {
        width: 94%;
        margin: 14% auto;
        border-radius: 16px;
    }

    .filmix-modal-header h3 {
        font-size: 14px;
    }

    .filmix-modal-body {
        padding: 20px 16px 18px;
    }

    .filmix-download-button {
        width: 100%;
        justify-content: center;
    }
}