/**
 * PWA & Mobile Stylesheet
 * PT RARA INDONET SOLUTION (RA2 Net)
 */

/* Floating Install Banner for Mobile/Desktop */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1060;
    max-width: 480px;
    margin: 0 auto;
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-banner-card {
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: #fff;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.pwa-banner-text {
    overflow: hidden;
}

.pwa-banner-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.pwa-banner-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

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

.btn-pwa-install {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-pwa-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
    color: #fff;
}

.btn-pwa-dismiss {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s;
}

.btn-pwa-dismiss:hover {
    color: #fff;
}

/* Native Mobile Bottom Navigation Bar (Modern iOS & Android App Style) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1040;
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)) 6px;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
    user-select: none;
    -webkit-user-select: none;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #64748b;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 0;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-bottom-nav-item .nav-icon-wrap {
    width: 44px;
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav-item .nav-icon-wa {
    color: #25d366;
}

.mobile-bottom-nav-item span {
    margin-top: 2px;
    line-height: 1.15;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.mobile-bottom-nav-item.active {
    color: var(--isp-primary, #2563eb);
    font-weight: 700;
}

.mobile-bottom-nav-item.active .nav-icon-wrap {
    background: rgba(37, 99, 235, 0.12);
    color: var(--isp-primary, #2563eb);
    transform: scale(1.05);
}

.mobile-bottom-nav-item:active {
    transform: scale(0.92);
}

/* Horizontal Segmented Tabs on Mobile (Riwayat Tagihan/Pembayaran/Kwitansi) */
.segmented-tabs-wrapper {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 8px 2px;
    margin-bottom: 12px;
}

.segmented-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.segmented-tabs {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    min-width: min-content;
}

.segmented-tab-btn {
    border-radius: 9999px !important;
    padding: 8px 16px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.segmented-tab-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

/* Mobile Record Card (For Invoices, Payments, Receipts in mobile view) */
.mobile-record-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-record-card:active {
    transform: scale(0.985);
}

/* Copy button utility */
.btn-copy-chip {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-copy-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-copy-chip:active {
    transform: scale(0.94);
}

.btn-copy-chip.copied {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

/* Mobile View Adjustments */
@media (max-width: 991.98px) {
    body.has-bottom-nav {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }
    /* Hide floating WA on mobile to prevent overlapping cards and bottom nav */
    .floating-wa-btn {
        display: none !important;
    }
    .pwa-install-banner {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
        left: 12px;
        right: 12px;
    }
    .customer-card {
        border-radius: 18px;
    }
}
