/**
 * Dakhl Theme - PWA Install Experience Styles
 */

/* 1. Mobile Bottom Sheet Install Prompt */
.dk-pwa-bottom-sheet {
    position: fixed;
    bottom: -150%;
    left: 16px;
    right: 16px;
    max-width: 440px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    z-index: 999999;
    direction: rtl;
    text-align: right;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.dk-pwa-bottom-sheet.is-visible {
    bottom: 20px;
}

@media (max-width: 768px) {
    .dk-pwa-bottom-sheet.is-visible {
        bottom: 74px; /* Above mobile bottom navigation bar */
    }
}

.dk-pwa-sheet-body {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.dk-pwa-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    background: #0284c7;
}

.dk-pwa-sheet-info {
    flex: 1;
    min-width: 0;
}

.dk-pwa-app-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dk-pwa-app-desc {
    font-size: 11.5px;
    color: #64748b;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dk-pwa-app-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: #059669;
    font-weight: 700;
}

.dk-pwa-stars {
    color: #f59e0b;
    font-size: 11px;
    letter-spacing: -1px;
}

.dk-pwa-sheet-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dk-pwa-install-btn {
    flex: 1;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    transition: transform 0.15s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.dk-pwa-install-btn:active {
    transform: scale(0.97);
}

.dk-pwa-dismiss-btn {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.dk-pwa-dismiss-btn:active {
    background: #e2e8f0;
}

/* 2. iOS Safari Add to Home Screen Modal */
.dk-ios-guide-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dk-ios-guide-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.dk-ios-guide-modal {
    position: fixed;
    bottom: -150%;
    left: 16px;
    right: 16px;
    max-width: 400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 9999999;
    direction: rtl;
    text-align: center;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.dk-ios-guide-modal.is-visible {
    bottom: 24px;
}

.dk-ios-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin: 0 auto 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.dk-ios-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.dk-ios-desc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.dk-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 10px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.dk-ios-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dk-ios-close-btn {
    width: 100%;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
}

/* 3. Toast Notifications */
.dk-pwa-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-50px);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 10000000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    direction: rtl;
}

.dk-pwa-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 4. Desktop: Smart Entrance Floating Notification (Ultra Modern Capsule / Pill Style at Bottom Center) */
.dk-pwa-entrance-notice {
    position: fixed;
    bottom: 24px;
    top: auto;
    left: 50%;
    right: auto;
    width: auto;
    min-width: 360px;
    max-width: min(600px, calc(100vw - 32px));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 100px;
    padding: 8px 12px 8px 22px;
    box-shadow: 0 16px 40px -6px rgba(15, 23, 42, 0.16), 0 2px 10px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    z-index: 999999;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateX(-50%) translateY(140%) scale(0.96);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.45s;
}

.dk-pwa-entrance-notice.is-visible {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.dk-pwa-entrance-notice.is-closing,
.dk-pwa-entrance-notice.is-scrolled-away {
    transform: translateX(-50%) translateY(140%) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}



.dk-pwa-notice-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.dk-pwa-entrance-notice.dk-no-icon .dk-pwa-notice-main {
    gap: 0;
}

.dk-pwa-notice-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    overflow: hidden;
}

.dk-pwa-notice-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.dk-pwa-notice-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dk-pwa-notice-title {
    font-size: 14px;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.dk-pwa-notice-desc {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .dk-pwa-notice-desc {
        display: none;
    }
    .dk-pwa-notice-main {
        gap: 10px;
    }
    .dk-pwa-notice-title {
        font-size: 12.5px;
        font-weight: 800;
        line-height: 1.35;
    }
    .dk-pwa-notice-icon-wrap {
        width: 34px;
        height: 34px;
    }
}

.dk-pwa-notice-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dk-btn-text-mobile {
    display: none;
}

.dk-pwa-notice-btn-install {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 100px;
    padding: 9px 18px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.dk-pwa-notice-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.dk-pwa-notice-btn-install:active {
    transform: scale(0.97);
}

.dk-pwa-notice-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.dk-pwa-notice-close-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Mobile: Smart App Banner Attached to the Very Top (Flush, Edge-to-Edge) */
@media (max-width: 768px) {
    .dk-pwa-entrance-notice {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        padding: 0 14px !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
        z-index: 9999 !important;
        transform: none !important;
        box-sizing: border-box !important;
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        cursor: default !important;
        transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, padding 0.35s ease, visibility 0.45s !important;
    }

    .dk-pwa-entrance-notice.is-visible {
        max-height: 64px !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 8px 14px !important;
        transform: none !important;
    }

    .dk-pwa-entrance-notice.is-closing {
        max-height: 0 !important;
        opacity: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-bottom-color: transparent !important;
        transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, padding 0.3s ease !important;
    }

    .dk-pwa-entrance-notice.is-scrolled-away {
        /* Natural page scroll on mobile */
        transform: none !important;
    }

    .dk-btn-text-desktop {
        display: none !important;
    }
    .dk-btn-text-mobile {
        display: inline !important;
    }
    .dk-pwa-notice-main {
        gap: 10px !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    .dk-pwa-notice-icon-wrap {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.22) !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
    }
    .dk-pwa-notice-icon-wrap img {
        border-radius: 50% !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    .dk-pwa-notice-body {
        gap: 2px !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    .dk-pwa-notice-title {
        font-size: 13px !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        color: #0f172a !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }
    .dk-pwa-notice-desc {
        display: block !important;
        font-size: 11px !important;
        color: #64748b !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .dk-pwa-notice-actions {
        gap: 8px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    .dk-pwa-notice-btn-install {
        padding: 0 16px !important;
        font-size: 12px !important;
        height: 34px !important;
        border-radius: 50px !important;
        gap: 5px !important;
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .dk-pwa-notice-btn-install svg {
        width: 13px !important;
        height: 13px !important;
    }
    .dk-pwa-notice-close-btn {
        width: 28px !important;
        height: 28px !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        color: #94a3b8 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
    .dk-pwa-notice-close-btn:hover {
        background: #fee2e2 !important;
        border-color: #fca5a5 !important;
        color: #ef4444 !important;
    }
    .dk-pwa-notice-close-btn svg {
        width: 12px !important;
        height: 12px !important;
    }
}
