.refresh-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.refresh-modal.open {
    opacity: 1;
    display: flex !important;
}

body.dark-theme .refresh-modal {
    background: rgba(0, 0, 0, 0.6);
}

.refresh-modal-content {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 32px 28px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.08),
        0 10px 30px -10px rgba(0, 0, 0, 0.04),
        inset 0 2px 3px -1px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px -1px rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.refresh-modal.open .refresh-modal-content {
    transform: scale(1) translateY(0);
}

body.dark-theme .refresh-modal-content {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.5),
        0 10px 30px -10px rgba(0, 0, 0, 0.3),
        inset 0 2px 3px -1px rgba(255, 255, 255, 0.08),
        inset 0 -2px 4px -1px rgba(255, 255, 255, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.refresh-modal-content::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 46%;
    border-radius: 20px 20px 12px 12px / 20px 20px 8px 8px;
    background: transparent;
    pointer-events: none;
    z-index: 6;
    transition: background 0.5s ease;
}

body.dark-theme .refresh-modal-content::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

.refresh-modal-content .modal-glare-container {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.refresh-modal-content .modal-glare {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle 120px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    mix-blend-mode: overlay;
}

body.dark-theme .refresh-modal-content .modal-glare {
    background: radial-gradient(circle 120px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06) 0%, transparent 100%);
}

.refresh-modal-content:hover .modal-glare {
    opacity: 1;
}

.refresh-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.25);
    z-index: 2;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-theme .refresh-modal-close {
    color: rgba(255, 255, 255, 0.25);
}

.refresh-modal-close:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #000000 !important;
}

body.dark-theme .refresh-modal-close:hover {
    background: rgba(255, 215, 0, 0.08) !important;
    color: #ffd700 !important;
}

.refresh-modal-close i {
    width: 20px;
    height: 20px;
}

.refresh-modal-content-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.refresh-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    color: #007aff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px auto;
}

body.dark-theme .refresh-modal-icon {
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
}

.refresh-modal-icon i {
    width: 28px;
    height: 28px;
}

.refresh-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
}

body.dark-theme .refresh-modal-title {
    color: #e0e0e0;
}

.refresh-modal-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #444;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    margin: 0 0 24px 0;
    text-align: center;
}

body.dark-theme .refresh-modal-desc {
    color: #b0b8c8;
}

.refresh-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 32px;
    background: #007aff !important;
    border: 1px solid #007aff !important;
    color: white !important;
    border-radius: 30px;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.refresh-modal-btn:hover {
    background: #007aff !important;
    border-color: #007aff !important;
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
}

.refresh-modal-btn:active {
    transform: scale(0.95);
}

body.dark-theme .refresh-modal-btn {
    background: #ffd700 !important;
    border-color: #ffd700 !important;
    color: #0a1628 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

body.dark-theme .refresh-modal-btn:hover {
    background: #ffd700 !important;
    border-color: #ffd700 !important;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.refresh-modal-btn i {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .refresh-modal-content {
        max-width: 95%;
        padding: 24px 20px;
        border-radius: 18px;
    }
    .refresh-modal-title {
        font-size: 1.1rem;
    }
    .refresh-modal-desc {
        font-size: 0.85rem;
    }
    .refresh-modal-btn {
        font-size: 0.8rem;
        padding: 8px 24px;
    }
    .refresh-modal-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    .refresh-modal-icon i {
        width: 24px;
        height: 24px;
    }
    .refresh-modal-close {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
    }
    .refresh-modal-close i {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .refresh-modal-content {
        max-width: 98%;
        padding: 20px 16px;
        border-radius: 16px;
    }
    .refresh-modal-title {
        font-size: 1rem;
    }
    .refresh-modal-desc {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }
    .refresh-modal-btn {
        font-size: 0.75rem;
        padding: 6px 20px;
    }
    .refresh-modal-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    .refresh-modal-icon i {
        width: 22px;
        height: 22px;
    }
    .refresh-modal-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
    }
    .refresh-modal-close i {
        width: 16px;
        height: 16px;
    }
}