/* Mobile PWA Styles */

/* دکمه نصب موبایل */
#mobile-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(3, 23, 61, 0.95), rgba(3, 23, 61, 0.8));
    color: white;
    padding: 16px;
    z-index: 10000;
    direction: rtl;
    font-family: inherit;
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: none;
}

#mobile-install-prompt.show {
    transform: translateY(0);
}

/* دکمه‌های موبایل */
#mobile-install-btn, #mobile-dismiss-btn {
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

#mobile-install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
}

#mobile-install-btn:hover, #mobile-install-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#mobile-dismiss-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
}

#mobile-dismiss-btn:hover, #mobile-dismiss-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* تنظیمات خاص iOS */
@supports (-webkit-touch-callout: none) {
    #mobile-install-prompt {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* تنظیمات responsive */
@media (max-width: 480px) {
    #mobile-install-prompt {
        padding: 12px;
        font-size: 14px;
    }
    
    #mobile-install-btn, #mobile-dismiss-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #mobile-install-prompt {
        padding: 8px 16px;
    }
}

/* انیمیشن‌های اضافی */
@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownMobile {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.mobile-install-prompt-enter {
    animation: slideUpMobile 0.3s ease-out;
}

.mobile-install-prompt-exit {
    animation: slideDownMobile 0.3s ease-in;
}

/* تنظیمات PWA در standalone mode */
@media (display-mode: standalone) {
    #mobile-install-prompt {
        display: none !important;
    }
    
    .pwa-install-button {
        display: none !important;
    }
}

/* تنظیمات خاص Android */
@media (max-width: 768px) and (orientation: portrait) {
    .android-chrome #mobile-install-prompt {
        background: linear-gradient(to top, rgba(3, 23, 61, 0.98), rgba(3, 23, 61, 0.9));
    }
}

/* تنظیمات خاص iOS */
.ios-safari #mobile-install-prompt {
    background: linear-gradient(to top, rgba(3, 23, 61, 0.95), rgba(3, 23, 61, 0.85));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* حالت تاریک */
@media (prefers-color-scheme: dark) {
    #mobile-install-prompt {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
        border-top-color: rgba(255, 255, 255, 0.15);
    }
}

/* تنظیمات accessibility */
@media (prefers-reduced-motion: reduce) {
    #mobile-install-prompt {
        transition: none;
    }
    
    .mobile-install-prompt-enter,
    .mobile-install-prompt-exit {
        animation: none;
    }
}

/* فونت‌های بهتر برای موبایل */
@media (max-width: 768px) {
    #mobile-install-prompt {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }
}

/* حذف outline در موبایل */
#mobile-install-btn:focus,
#mobile-dismiss-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* تنظیمات خاص برای safe area */
@supports (padding: max(0px)) {
    #mobile-install-prompt {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}


