/**
 * Divya Care - Centralized Master Application Stylesheet (assets/css/style.css)
 * Authentic PhonePe Vibrant Theme, Mobile-First WebView App UX, Desktop-Optimized
 */

/* ==========================================================================
   1. Theme Variables & Utilities
   ========================================================================== */
:root {
    /* PhonePe Brand Colors */
    --primary-color: #5f259f;
    --primary-dark: #47187c;
    --primary-light: #f4ecfb;
    
    --secondary-color: #00d285;
    --secondary-dark: #00a86b;
    --secondary-light: #e6fbf3;
    
    /* Layout & Surface Colors */
    --dark-color: #240c42;
    --app-bg: #f6f3f9;
    --card-bg: #ffffff;
    --card-border: #e9e2f3;
    --text-main: #212529;
    --text-muted: #6c757d;
}

/* Global utility classes based on theme */
.bg-theme-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.bg-theme-secondary {
    background-color: var(--secondary-color) !important;
    color: #ffffff !important;
}

.text-theme-primary {
    color: var(--primary-color) !important;
}

.text-theme-secondary {
    color: var(--secondary-dark) !important;
}

.border-theme-primary {
    border-color: var(--primary-color) !important;
}

.btn-brand {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.25s ease-in-out;
}

.btn-brand:hover, .btn-brand:focus, .btn-brand:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(95, 37, 159, 0.35);
}

.btn-theme-accent {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-dark) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.btn-theme-accent:hover {
    background-color: var(--secondary-dark) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   2. Base & Global Styles
   ========================================================================== */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--app-bg, #f6f3f9);
    color: var(--text-main, #212529);
    padding-top: 68px;
    padding-bottom: 80px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

/* Vertically Centered Alert Close Buttons on Far Right */
.alert-dismissible {
    position: relative !important;
    padding-right: 42px !important;
}
.alert-dismissible .btn-close {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    box-shadow: none !important;
}

/* ==========================================================================
   3. App Navigation & Header
   ========================================================================== */
.app-container {
    max-width: 1080px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.app-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 18px rgba(95, 37, 159, 0.28);
    height: 62px;
    z-index: 1040;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   4. Offcanvas Sidebar Drawer
   ========================================================================== */
.offcanvas-drawer {
    width: 320px !important;
    background-color: #ffffff;
    border-right: none;
    z-index: 1200 !important;
    box-shadow: 5px 0 25px rgba(0,0,0,0.18);
}

.drawer-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 22px 20px 18px;
}

/* Verified Active Member Badge (Facebook / Instagram Style) */
.verified-check-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #00d285;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

.verified-check-badge.badge-lg {
    width: 22px;
    height: 22px;
    font-size: 11.5px;
    top: -3px;
    right: -3px;
}

.drawer-list {
    overflow-y: auto;
    max-height: calc(100vh - 190px);
    -webkit-overflow-scrolling: touch;
    padding-bottom: 60px !important;
}

.drawer-list::-webkit-scrollbar {
    width: 5px;
}

.drawer-list::-webkit-scrollbar-thumb {
    background: #d8cde8;
    border-radius: 4px;
}

.drawer-list a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333333;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-bottom: 1px solid #f3edf8;
    transition: all 0.2s;
}

.drawer-list a:hover, .drawer-list a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 24px;
}

.drawer-list a i {
    width: 28px;
    font-size: 16px;
    color: var(--primary-color);
}

/* ==========================================================================
   5. Bottom Mobile App Navigation
   ========================================================================== */
.app-bottom-nav {
    background: #ffffff;
    border-top: 1.5px solid #ece4f5;
    box-shadow: 0 -4px 20px rgba(95, 37, 159, 0.08);
    height: 65px;
    z-index: 1050;
}

.bottom-nav-item {
    text-decoration: none;
    color: #777777;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 500;
    transition: all 0.2s;
}

.bottom-nav-item i {
    font-size: 18px;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--primary-light, #f4ecfb);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

/* ==========================================================================
   6. Card Layouts & Tiles
   ========================================================================== */
.app-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1.5px solid var(--card-border, #e9e2f3);
    box-shadow: 0 6px 20px rgba(95, 37, 159, 0.06);
    transition: transform 0.2s;
}

.app-card:hover {
    box-shadow: 0 8px 25px rgba(95, 37, 159, 0.09);
}

.wallet-card-purple {
    background: linear-gradient(135deg, #3f1068 0%, #5f259f 60%, #29064a 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(95, 37, 159, 0.3) !important;
}

.wallet-card-purple * {
    color: inherit;
}

.wallet-card-purple .text-white-50 {
    color: rgba(255, 255, 255, 0.72) !important;
}

.wallet-tooltip-indicator {
    cursor: help;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   7. Sliders & Carousels (PhonePe Style Full Display & Indicators)
   ========================================================================== */
.dashboard-banner-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: 18px;
}

@media (max-width: 768px) {
    .dashboard-banner-img {
        aspect-ratio: 16 / 9;
        border-radius: 14px;
    }
}

/* PhonePe Style Indicators (_ _ _ dashes on the image bottom) */
#appBannerCarousel .carousel-indicators,
#shopBannerCarousel .carousel-indicators {
    bottom: 10px !important;
    margin-bottom: 0 !important;
    z-index: 10 !important;
    gap: 4px !important;
}

#appBannerCarousel .carousel-indicators [data-bs-target],
#shopBannerCarousel .carousel-indicators [data-bs-target] {
    width: 20px !important;
    height: 4px !important;
    border-radius: 4px !important;
    border: none !important;
    background-color: rgba(255, 255, 255, 0.6) !important;
    margin: 0 2px !important;
    transition: all 0.3s ease !important;
    opacity: 0.7 !important;
}

#appBannerCarousel .carousel-indicators .active,
#shopBannerCarousel .carousel-indicators .active {
    width: 34px !important;
    background-color: var(--primary-color, #5f259f) !important;
    opacity: 1 !important;
    box-shadow: 0 2px 6px rgba(95, 37, 159, 0.6) !important;
}

/* Left & Right Arrow Buttons - Hidden by default, Visible on Hover */
#appBannerCarousel .carousel-control-prev,
#appBannerCarousel .carousel-control-next,
#shopBannerCarousel .carousel-control-prev,
#shopBannerCarousel .carousel-control-next {
    width: 38px !important;
    height: 38px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease !important;
    z-index: 15 !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    cursor: pointer !important;
}

#appBannerCarousel .carousel-control-prev,
#shopBannerCarousel .carousel-control-prev {
    left: 12px !important;
    right: auto !important;
}

#appBannerCarousel .carousel-control-next,
#shopBannerCarousel .carousel-control-next {
    right: 12px !important;
    left: auto !important;
}

#appBannerCarousel:hover .carousel-control-prev,
#appBannerCarousel:hover .carousel-control-next,
#shopBannerCarousel:hover .carousel-control-prev,
#shopBannerCarousel:hover .carousel-control-next {
    opacity: 0.85 !important;
}

#appBannerCarousel .carousel-control-prev:hover,
#appBannerCarousel .carousel-control-next:hover,
#shopBannerCarousel .carousel-control-prev:hover,
#shopBannerCarousel .carousel-control-next:hover {
    opacity: 1 !important;
    background: var(--primary-color, #5f259f) !important;
    border-color: var(--primary-color, #5f259f) !important;
    transform: translateY(-50%) scale(1.08) !important;
}

/* ==========================================================================
   8. Quick Services 8-Grid
   ========================================================================== */
.service-tile {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    border: 1px solid var(--card-border, #e9e2f3);
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    text-decoration: none !important;
    display: block;
    height: 100%;
    transition: all 0.2s;
}

.service-tile:hover {
    transform: translateY(-3px);
    background-color: #faf7fd;
    box-shadow: 0 8px 18px rgba(95, 37, 159, 0.15);
    border-color: var(--primary-color);
}

.service-tile:active {
    transform: scale(0.96);
}

.service-tile .service-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.service-tile .service-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #333333;
    line-height: 1.2;
}

/* ==========================================================================
   9. Shopping & Product Cards
   ========================================================================== */
.product-card {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border-radius: 16px;
    border: 1px solid var(--card-border, #e9e2f3);
    overflow: hidden;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(95, 37, 159, 0.14);
    border-color: var(--primary-color);
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
    height: 190px;
    cursor: pointer;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-quick-view-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: none;
    transition: all 0.2s;
    z-index: 5;
}

.product-quick-view-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: scale(1.1);
}

.product-cat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 2;
    background: #ffffff;
    color: #333333;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 3px 8px;
    line-height: 1.3;
}

.cat-pill {
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.cat-pill.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(95, 37, 159, 0.25);
}

/* ==========================================================================
   10. App Tables & Sticky Headers
   ========================================================================== */
.table {
    margin-bottom: 0;
    vertical-align: middle;
    width: 100%;
}

.table thead th {
    font-size: 12.5px;
    font-weight: 600;
    color: #495057;
    background-color: #f7f4fb;
    border-bottom: 1.5px solid var(--card-border, #e9e2f3);
    padding: 11px 14px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid #f2edf7;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background-color: #faf7fd;
}

.table-sm thead th {
    padding: 8px 12px;
}

.table-sm tbody td {
    padding: 9px 12px;
}

.passbook-scroll-wrapper {
    max-height: 560px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--card-border, #e9e2f3);
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
}

.passbook-scroll-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f7f3fb !important;
    border-bottom: 2px solid #e1d5ef !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* ==========================================================================
   11. App Payment Buttons (Add Fund)
   ========================================================================== */
.app-pay-btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 12px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s, opacity 0.2s;
}

.app-pay-btn:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    color: #ffffff !important;
}

.amount-chip {
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    border-radius: 20px;
}

.amount-chip:hover, .amount-chip.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

/* ==========================================================================
   12. PhonePe Theme Round Icon Pagination Styles
   ========================================================================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    margin-top: 10px;
    border-top: 1px solid var(--card-border, #e9e2f3);
}

.pagination-wrapper .pagination-info {
    font-size: 12.5px;
    color: var(--text-muted, #6c757d);
    font-weight: 500;
}

.pagination-wrapper .pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid var(--primary-color, #5f259f);
    background-color: #ffffff;
    color: var(--primary-color, #5f259f);
    box-shadow: 0 1px 3px rgba(95, 37, 159, 0.1);
}

.pagination-round-btn:not(.disabled):hover {
    background: linear-gradient(135deg, var(--primary-color, #5f259f) 0%, var(--primary-dark, #47187c) 100%);
    color: #ffffff !important;
    border-color: var(--primary-color, #5f259f);
    transform: scale(1.08);
    box-shadow: 0 3px 8px rgba(95, 37, 159, 0.25);
}

.pagination-round-btn.disabled,
.pagination-round-btn:disabled {
    color: #c2b3d6 !important;
    background-color: #faf7fc !important;
    border-color: #ece3f6 !important;
    cursor: not-allowed !important;
    opacity: 0.65;
    box-shadow: none;
    transform: none;
}

.pagination-page-badge {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-color, #5f259f);
    background-color: var(--primary-light, #f4ecfb);
    border: 1px solid rgba(95, 37, 159, 0.2);
    border-radius: 20px;
    padding: 3px 9px;
    letter-spacing: 0.3px;
}

.pagination {
    gap: 6px;
}

.pagination .page-item .page-link {
    color: var(--primary-color, #5f259f);
    background-color: #ffffff;
    border: 1.5px solid #e6dbf3;
    border-radius: 8px !important;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 4px rgba(95, 37, 159, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
}

.pagination .page-item .page-link:hover {
    background-color: var(--primary-light, #f4ecfb);
    color: var(--primary-color, #5f259f);
    border-color: var(--primary-color, #5f259f);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color, #5f259f) 0%, var(--primary-dark, #401373) 100%) !important;
    border-color: var(--primary-color, #5f259f) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(95, 37, 159, 0.35);
    font-weight: 700;
}

.pagination .page-item.disabled .page-link {
    color: #c4b5d6 !important;
    background-color: #faf7fc !important;
    border-color: #efe8f8 !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   Notice & Announcement Marquee Bar
   ========================================================================== */
.app-notice-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #5f259f 0%, #7b2cbf 50%, #47187c 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 7px 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(95, 37, 159, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.app-notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.app-notice-badge i {
    color: #ffd166;
    font-size: 12.5px;
}

.app-notice-marquee {
    flex: 1;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.app-notice-marquee marquee {
    display: block;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   15. Floating Bottom Toast Notification
   ========================================================================== */
.app-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    max-width: 390px;
    width: calc(100% - 32px);
    pointer-events: none;
}

@media (max-width: 576px) {
    .app-toast-container {
        bottom: 74px; /* Sits cleanly above the mobile bottom nav bar */
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

.app-toast {
    pointer-events: auto;
    background: #1f1b2e;
    color: #ffffff;
    border-radius: 14px;
    padding: 12px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-toast.fade-out {
    opacity: 0;
    transform: translateY(15px);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.app-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.2);
    color: #2ecc71;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.app-toast-msg {
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #f1f1f1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.app-toast-btn {
    background: linear-gradient(135deg, var(--primary-color, #5f259f) 0%, var(--primary-dark, #47187c) 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.app-toast-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

.app-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    padding: 0 4px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.app-toast-close:hover {
    color: #ffffff;
}



