/**
 * Farasod PWA - استایل‌های بخش عمومی (فرانت‌اند)
 *
 * @package FarasodPWA
 */

/* دکمه شناور نصب */
.farasod-pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.farasod-pwa-install-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* پاپ‌آپ نصب */
.farasod-pwa-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    backdrop-filter: blur(4px);
}

.farasod-pwa-popup-content {
    background: white;
    border-radius: 20px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: farasodPwaSlideIn 0.3s ease;
    direction: rtl;
}

@keyframes farasodPwaSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.farasod-pwa-popup-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.farasod-pwa-popup-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
}

.farasod-pwa-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

.farasod-pwa-popup-close:hover {
    color: #333;
}

.farasod-pwa-popup-body {
    padding: 20px;
}

.farasod-pwa-popup-body h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.farasod-pwa-popup-body p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.farasod-pwa-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.farasod-pwa-features li {
    padding: 8px 0;
    color: #555;
    font-size: 14px;
}

.farasod-pwa-popup-footer {
    padding: 15px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
}

.farasod-pwa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.farasod-pwa-btn-primary {
    background: #0073aa;
    color: white;
}

.farasod-pwa-btn-primary:hover {
    background: #005a87;
}

.farasod-pwa-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.farasod-pwa-btn-secondary:hover {
    background: #e0e0e0;
}

/* راهنمای نصب */
.farasod-pwa-guide-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.farasod-pwa-guide-step-number {
    width: 30px;
    height: 30px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.farasod-pwa-guide-step-text {
    flex: 1;
    color: #555;
}

/* نوتیفیکیشن بروزرسانی */
.farasod-pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
    background: #333;
    color: white;
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 99999;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.farasod-pwa-update-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.farasod-pwa-update-content button {
    background: #0073aa;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.farasod-pwa-update-content button:last-child {
    background: #555;
}

/* پیام تشکر پس از نصب */
.farasod-pwa-thankyou {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
    background: #4caf50;
    color: white;
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 99999;
    animation: slideUp 0.3s ease;
}

.farasod-pwa-thankyou-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.farasod-pwa-thankyou-content button {
    background: white;
    border: none;
    color: #4caf50;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* پیام آفلاین */
.farasod-pwa-offline-msg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 10px;
    z-index: 100000;
    font-size: 14px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* حالت اپلیکیشن (standalone) */
@media all and (display-mode: standalone) {
    .farasod-pwa-install-button,
    .farasod-pwa-popup {
        display: none !important;
    }
    
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* موبایل */
@media (max-width: 768px) {
    .farasod-pwa-install-button {
        bottom: 70px;
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .farasod-pwa-popup-content {
        width: 90%;
    }
    
    .farasod-pwa-btn {
        padding: 8px 16px;
    }
}

/* RTL کامل */
.rtl .farasod-pwa-install-button {
    right: auto;
    left: 20px;
}

.rtl .farasod-pwa-popup-close {
    margin-right: auto;
    margin-left: 0;
}

.rtl .farasod-pwa-popup-footer {
    justify-content: flex-start;
}
