/**
 * PWA Styles for Dallni Platform (منصة دلّني)
 */

/* =========================================
   1. Floating Install Pill & Icon (الأيقونة العائمة)
   ========================================= */
.dallni-floating-install-pill {
    position: fixed;
    z-index: 2050;
    bottom: 84px;
    right: 14px;
    background: #ffffff;
    border: 1.5px solid rgba(20, 86, 225, 0.25);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(20, 86, 225, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px 14px 6px 8px;
    display: none;
    align-items: center;
    direction: rtl;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: pwaPillFloat 3.5s ease-in-out infinite alternate;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dallni-floating-install-pill.is-visible {
    display: flex;
}

@keyframes pwaPillFloat {
    0% {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(20, 86, 225, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    100% {
        transform: translateY(-5px);
        box-shadow: 0 16px 36px rgba(20, 86, 225, 0.32), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

.floating-install-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.floating-install-icon-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.floating-install-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #1456E1;
}

.floating-install-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #1456E1;
    color: #ffffff;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 1.5px solid #ffffff;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.floating-install-content {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.floating-install-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: #1456E1;
    white-space: nowrap;
}

.floating-install-desc {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.floating-install-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.floating-install-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* Compact Minimized State (أيقونة دائرية عند تصغيرها) */
.dallni-floating-install-pill.is-minimized {
    padding: 4px;
    border-radius: 50%;
}

.dallni-floating-install-pill.is-minimized .floating-install-content,
.dallni-floating-install-pill.is-minimized .floating-install-close {
    display: none;
}

.dallni-floating-install-pill.is-minimized .floating-install-icon-wrap {
    width: 44px;
    height: 44px;
}

@media (min-width: 769px) {
    .dallni-floating-install-pill {
        bottom: 28px;
        right: 28px;
    }
}

@media (max-width: 820px) {
    .dallni-floating-install-pill--restaurant {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        right: 14px;
    }
}

/* =========================================
   2. iOS Install Guide Modal
   ========================================= */
.dallni-ios-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    direction: rtl;
    padding: 0 12px 12px 12px;
    box-sizing: border-box;
}

.dallni-ios-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.dallni-ios-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 24px 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(40px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.dallni-ios-modal.is-open .dallni-ios-modal-card {
    transform: translateY(0);
}

.dallni-ios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dallni-ios-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dallni-ios-header-info img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
}

.dallni-ios-header-info h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.dallni-ios-header-info p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.dallni-ios-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    font-size: 1.25rem;
}

.dallni-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.dallni-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
}

.dallni-ios-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1456E1;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.dallni-ios-step-text {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
}

.dallni-ios-step-text strong {
    color: #0f172a;
}

.dallni-ios-step-text i {
    font-size: 1.15rem;
    color: #1456E1;
    vertical-align: middle;
    margin: 0 2px;
}

.dallni-ios-btn-done {
    width: 100%;
    background: #1456E1;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.dallni-ios-btn-done:hover {
    background: #0d44b8;
}

@media (min-width: 769px) {
    .dallni-ios-modal {
        align-items: center;
    }
}

/* =========================================
   3. Drawer Menu PWA Button
   ========================================= */
.drawer-pwa-btn {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(20, 86, 225, 0.08) 0%, rgba(20, 86, 225, 0.03) 100%);
    border: 1px dashed rgba(20, 86, 225, 0.35);
    color: #1456E1 !important;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    box-sizing: border-box;
}

.drawer-pwa-btn[hidden] {
    display: none !important;
}

.drawer-pwa-btn:hover {
    background: rgba(20, 86, 225, 0.12);
    border-color: #1456E1;
    transform: translateY(-1px);
}

.drawer-pwa-btn i {
    font-size: 1.35rem;
    color: #1456E1;
}

.drawer-pwa-badge {
    margin-right: auto;
    background: #1456E1;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
