/* ========================================= */
/* دکمه بازگشت به بالا - طراحی مینیمال و خفن */
/* موقعیت ثابت: پایین سمت چپ               */
/* ========================================= */

/* Reset برای دکمه */
#pst-button,
.pst-btn {
    all: unset;
    box-sizing: border-box;
}

/* دکمه اصلی */
#pst-button,
.pst-btn {
    position: fixed !important;
    left: 35px !important;
    right: auto !important;
    bottom: 35px !important;
    top: auto !important;
    width: 64px !important;
    height: 64px !important;
    background: linear-gradient(135deg, #1e293b 0%, #161f30 40%, #0f172a 100%) !important;
    border: 2px solid transparent !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(30px) scale(0.9) !important;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    overflow: hidden !important;
    box-shadow: 
        inset 0 0 15px rgba(255, 255, 255, 0.04),
        0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

/* حالت نمایش */
#pst-button.pst-visible,
.pst-btn.pst-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* آیکون فلش بالا */
.pst-icon {
    position: relative !important;
    width: 30px !important;
    height: 30px !important;
    z-index: 2 !important;
    transition: all 0.4s ease !important;
}

/* خط عمودی */
.pst-icon::before {
    content: '' !important;
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 3px !important;
    height: 16px !important;
    background: linear-gradient(to top, #FFC03D, #FFD166) !important;
    border-radius: 2px !important;
    box-shadow: 0 0 8px rgba(255, 192, 61, 0.6) !important;
}

/* سر فلش */
.pst-icon::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(45deg) !important;
    width: 12px !important;
    height: 12px !important;
    border-top: 3px solid #FFC03D !important;
    border-left: 3px solid #FFC03D !important;
    border-radius: 2px 0 0 0 !important;
    box-shadow: -1px -1px 4px rgba(255, 192, 61, 0.7) !important;
}

/* هاور مینیمال و زیبا */
#pst-button:hover,
.pst-btn:hover {
    transform: translateY(-6px) scale(1.1) !important;
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.08),
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 192, 61, 0.25) !important;
    border-color: rgba(255, 192, 61, 0.4) !important;
}

#pst-button:hover .pst-icon::before,
.pst-btn:hover .pst-icon::before {
    height: 18px !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6) !important;
}

#pst-button:hover .pst-icon::after,
.pst-btn:hover .pst-icon::after {
    border-color: #ffffff !important;
}

/* کلیک */
#pst-button:active,
.pst-btn:active {
    transform: scale(0.95) !important;
}

/* حلقه نورانی ملایم دور دکمه */
#pst-button::before,
.pst-btn::before {
    content: '' !important;
    position: absolute !important;
    inset: -8px !important;
    background: conic-gradient(from 0deg, transparent, rgba(255, 192, 61, 0.15), transparent) !important;
    border-radius: 50% !important;
    z-index: -1 !important;
    opacity: 0.6 !important;
    animation: rotate 6s linear infinite !important;
    filter: blur(12px) !important;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

/* شناور شدن ملایم */
#pst-button.pst-floating,
.pst-btn.pst-floating {
    animation: float 4s ease-in-out infinite !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============ ریسپانسیو - همیشه سمت چپ ============ */
@media (max-width: 1024px) {
    #pst-button, .pst-btn {
        left: 30px !important;
        bottom: 30px !important;
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 768px) {
    #pst-button, .pst-btn {
        left: 25px !important;
        bottom: 25px !important;
        width: 56px !important;
        height: 56px !important;
    }
}

@media (max-width: 480px) {
    #pst-button, .pst-btn {
        left: 20px !important;
        bottom: 20px !important;
        width: 52px !important;
        height: 52px !important;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #pst-button, .pst-btn {
        left: 15px !important;
        bottom: 15px !important;
        width: 48px !important;
        height: 48px !important;
    }
}

/* ============ فورس سمت چپ حتی در RTL ============ */
html[dir="rtl"] #pst-button,
html[dir="rtl"] .pst-btn,
body.rtl #pst-button,
body.rtl .pst-btn,
.rtl #pst-button,
.rtl .pst-btn,
[dir="rtl"] #pst-button,
[dir="rtl"] .pst-btn {
    left: 35px !important;
    right: auto !important;
}

@media (max-width: 1024px) {
    html[dir="rtl"] #pst-button,
    body.rtl #pst-button { left: 30px !important; right: auto !important; bottom: 30px !important; }
}

@media (max-width: 768px) {
    html[dir="rtl"] #pst-button,
    body.rtl #pst-button { left: 25px !important; right: auto !important; bottom: 25px !important; }
}

@media (max-width: 480px) {
    html[dir="rtl"] #pst-button,
    body.rtl #pst-button { left: 20px !important; right: auto !important; bottom: 20px !important; }
}