/* ============================================================
   Mahalo Travels - PWA Styles
   Install banners, update notifications, iOS hints
   ============================================================ */

/* ---- Install Banner (Android/Desktop) ---- */
.pwa-install-banner {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 0 1rem;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.pwa-install-banner.pwa-install-visible {
    bottom: 1rem;
    pointer-events: auto;
}

.pwa-install-content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pwa-install-icon-wrap {
    flex-shrink: 0;
}

.pwa-install-app-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF385C 0%, #FF1744 100%);
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    font-size: 0.95rem;
    color: #222;
    margin-bottom: 0.15rem;
}

.pwa-install-text span {
    font-size: 0.85rem;
    color: #717171;
}

.pwa-install-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.pwa-install-btn {
    padding: 0.6rem 1.5rem;
    background: #FF385C;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    background: #E31C5F;
    transform: translateY(-1px);
}

.pwa-install-dismiss {
    padding: 0.4rem 1rem;
    background: transparent;
    color: #717171;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.pwa-install-dismiss:hover {
    color: #222;
}

/* ---- Update Banner ---- */
.pwa-update-banner {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 0 1rem;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.pwa-update-banner.pwa-update-visible {
    top: 1rem;
    pointer-events: auto;
}

.pwa-update-content {
    max-width: 600px;
    margin: 0 auto;
    background: #1a1a1a;
    color: white;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pwa-update-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pwa-update-text {
    flex: 1;
    min-width: 0;
}

.pwa-update-text strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.pwa-update-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.pwa-update-btn {
    padding: 0.5rem 1.25rem;
    background: #FF385C;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pwa-update-btn:hover {
    background: #E31C5F;
}

.pwa-update-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.pwa-update-dismiss:hover {
    color: white;
}

/* ---- iOS Install Hint ---- */
.pwa-ios-hint {
    position: fixed;
    bottom: -250px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.pwa-ios-hint.pwa-ios-visible {
    bottom: 1.5rem;
    pointer-events: auto;
}

.pwa-ios-content {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Arrow pointing down (toward Safari share button) */
.pwa-ios-content::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.pwa-ios-dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #717171;
    cursor: pointer;
    line-height: 1;
}

.pwa-ios-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.pwa-ios-content p {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #222;
}

.pwa-ios-instructions {
    font-size: 0.85rem !important;
    color: #717171 !important;
    line-height: 1.5;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 576px) {
    .pwa-install-content {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .pwa-install-text {
        flex-basis: calc(100% - 64px);
    }

    .pwa-install-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .pwa-update-content {
        flex-wrap: wrap;
    }

    .pwa-update-text {
        flex-basis: calc(100% - 60px);
    }

    .pwa-ios-content {
        width: calc(100vw - 2rem);
        max-width: 300px;
    }
}

/* ---- PWA standalone mode adjustments ---- */
@media (display-mode: standalone) {
    /* Add safe area insets for notched phones */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Hide install banners in standalone mode */
    .pwa-install-banner,
    .pwa-ios-hint {
        display: none !important;
    }

    /* Adjust navbar for standalone mode (no browser chrome) */
    .navbar-custom {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }

    /* Adjust footer for bottom safe area */
    .footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}
