/* ======================================================= */
/* ====== 1. BASE AND UTILITIES STYLES START HERE ====== */
/* ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --drykun-blue: #0A3C8B;
    --drykun-orange: #F78F20;
    --drykun-blue-dark: #072C66;
    --drykun-orange-dark: #E07E1C;
    --drykun-orange-shadow: rgba(247, 143, 32, 0.4);
    --bs-primary: var(--drykun-blue);
    --bs-secondary: var(--drykun-orange);
    --bs-font-sans-serif: 'Poppins', sans-serif;
    --bs-body-bg: #f9f9f9;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --card-border-radius: 12px;
    --header-bg: #ffffff;
    --header-border-color: #e9ecef;
    --header-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
body {
    display: flex;
    min-height: 100vh;
    font-family: var(--bs-font-sans-serif);
    background-color: var(--bs-body-bg);
    padding-bottom: 80px;
}

.text-bg-purple {
    color: #fff !important;
    background-color: #6f42c1 !important;
}
.status-badge-clickable {
    cursor: pointer;
    transition: transform 0.1s ease-in-out;
}
.status-badge-clickable:hover {
    transform: scale(1.05);
}

/* ======================================================= */
/* ====== 2. DESKTOP SIDEBAR STYLES START HERE ======= */
/* ======================================================= */

.sidebar {
    width: 250px;
    height: 100vh; /* 100vh hi rehne den */
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform 0.3s ease;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    height: 60px !important; /* FIX: 80px par lock kiya gaya hai */
    min-height: 60px !important;
    padding: 0 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-header .d-flex { gap: 0.75rem; }
.sidebar-header i { color: var(--bs-primary); }
.sidebar-nav { list-style: none; padding: 1rem; margin: 0; flex-grow: 1; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.sidebar-nav a i { width: 20px; text-align: center; color: #888; }
.sidebar-nav li.active > a {
    background-color: #e7f0ff;
    color: var(--bs-primary);
}

.sidebar-nav li.active > a i {
    color: var(--bs-primary);
}
.sidebar-nav a.logout { color: #dc3545; }

/* ======================================================= */
/* ====== 3. MAIN CONTENT & HEADER STYLES START HERE === */
/* ======================================================= */

.main-container {
    margin-left: 250px;
    flex-grow: 1;
    width: calc(100% - 250px);
    padding-top: 0px;
}
.main-eheader.header-hidden {
    transform: translateY(-100%);
    box-shadow: none !important;
}

.main-eheader {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease;
    height: 60px !important; /* FIX: Fixed to 80px for alignment in all modes */
    min-height: 60px !important; /* Added min-height lock */
    box-sizing: border-box;
    align-items: center;
}
.main-profileheader {
    height: 600px;
    border-bottom: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.content-area { flex-grow: 1; padding: 1.5rem; }
.header-search { background-color: #f8f9fa; border: none; border-radius: 8px; width: 300px; }
.header-search .form-control { background: transparent; border: none; box-shadow: none; }

.main-eheader .d-flex.align-items-center { align-items: center !important; }
.mobile-header-logo-text {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1;
}
.mobile-header-logo-text img { vertical-align: middle; }
#menu-toggle-btn { line-height: 1; }

#menu-toggle-btn i {
    font-size: 1.5rem !important;
    color: #555;
    transition: color 0.2s ease;
}

.main-eheader .fa-regular.fa-bell,
.main-profileheader .fa-regular.fa-bell {
    font-size: 1.5rem !important;
    color: #555;
    transition: color 0.2s ease;
}

#menu-toggle-btn:hover i,
#menu-toggle-btn:focus i,
#menu-toggle-btn:active i {
    color: var(--bs-primary) !important;
}

.main-eheader .fa-regular.fa-bell:hover,
.main-profileheader .fa-regular.fa-bell:hover {
    color: var(--bs-primary) !important;
    cursor: pointer;
}

.main-profileheader .d-flex.align-items-center { align-items: center !important; }

/* ======================================================= */
/* ====== 4. MOBILE BOTTOM NAV STYLES START HERE ======= */
/* ======================================================= */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: none;
    align-items: center;
    justify-content: space-around;
    z-index: 1021;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}
.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    font-size: 0.7rem;
    font-weight: 600;
    flex: 1;
}
.mobile-bottom-nav a i { font-size: 1.2rem; margin-bottom: 2px; }
.mobile-bottom-nav a.active {
    color: var(--bs-primary);
}
.mobile-bottom-nav a.fab-center { flex: 0 1 auto; margin: 0 0.5rem; }
.mobile-bottom-nav .fab-icon-wrapper {
    background-color: var(--bs-secondary);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-top: -30px;
    box-shadow: 0 4px 10px var(--drykun-orange-shadow);
}

/* ======================================================= */
/* ====== 5. DASHBOARD & ORDER STYLES START HERE ======= */
/* ======================================================= */

.stat-card {
    background: #fff;
    border-radius: var(--card-border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    border: 1px solid #f0f0f0;
    box-shadow: none;
}
.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-card .info {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}
.stat-card .info span {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    display: block;
}
.quick-action-btn {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}
.quick-action-btn:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}
.icon-box.bg-light-red { background-color: #ffe8e8; color: #dc3545; }
.icon-box.bg-light-yellow { background-color: #fff9e0; color: #ffc107; }
.icon-box.bg-light-blue { background-color: #e0f7ff; color: #0dcaf0; }
.icon-box.bg-light-purple { background-color: #f3e8ff; color: #6f42c1; }
.icon-box.bg-light-green { background-color: #e6f8f0; color: #198754; }
.icon-box.bg-light-pink { background-color: #ffeef6; color: #d63384; }

.search-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    height: 40px;
    overflow: hidden;
}
.search-container .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
    z-index: 3;
    font-size: 0.9rem;
}
.search-container .search-input {
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding-left: 32px;
    padding-right: 32px;
    height: 100%;
    border-radius: 10px;
    font-size: 0.9rem;
    flex-grow: 1;
    width: 100%;
}
.search-container .search-input::placeholder {
    color: #adb5bd;
    font-size: 0.9rem;
}
.search-container .clear-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background-color: transparent;
    color: #adb5bd;
    padding: 0 0.4rem;
    box-shadow: none;
    line-height: 1;
    z-index: 3;
    font-size: 0.8rem;
    display: none;
}
.search-container .clear-search-btn:hover { color: #6c757d; }
.search-container:focus-within {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    border-color: #ced4da;
}

.new-order-btn {
    background-color: var(--bs-secondary) !important;
    color: white !important;
    border-color: var(--bs-secondary) !important;
    border-radius: 10px;
    height: 40px;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    padding: 1px 18px;
}
.new-order-btn:hover,
.new-order-btn:focus {
    background-color: var(--drykun-orange-dark) !important;
    border-color: var(--drykun-orange-dark) !important;
    color: white !important;
}
.new-order-btn i { font-size: 2.6em; }
.new-order-btn .fa-plus { font-size: 1.9rem; }


/* ======================================================= */
/* ====== 6. POS PRODUCT CARD STYLES START HERE ======== */
/* ======================================================= */

@keyframes pop-effect {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.0); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.0); }
}

.pos-product-card {
    cursor: default;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.product-added .pos-product-card,
.pos-product-card.product-added-pop {
    animation: pop-effect 0.3s ease-out;
}

.pos-product-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}
.grid-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
}
.grid-qty-btn:hover {
    background-color: #e2e6ea;
    border-color: #c0c0c0;
}
.btn-add-to-grid {
    background-color: var(--bs-primary);
    color: white;
    border: none;
}
.btn-add-to-grid:hover {
    background-color: var(--drykun-blue-dark);
    color: white;
}
.product-grid-qty {
    font-size: 16px;
    font-weight: bold;
    padding: 0 12px;
    min-width: 40px;
    text-align: center;
}
.product-grid-qty,
.btn-remove-from-grid {
    display: none;
}
.pos-product-card.has-in-cart .product-grid-qty,
.pos-product-card.has-in-cart .btn-remove-from-grid {
    display: inline-block;
}

/* ======================================================= */
/* ====== 7. RESPONSIVE DESIGN STYLES START HERE ======= */
/* ======================================================= */

@media (max-width: 767.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    
    .main-container { margin-left: 0; width: 100%; }
    
    .main-eheader {
        width: 100%;
    }
    .main-profileheader {
        left: 0;
        width: 100%;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 1029;
        display: none;
    }
    .sidebar.active + .main-container .mobile-overlay { display: block; }
    
    .mobile-bottom-nav { display: flex; }
    
    .content-area { padding: 1rem; padding-bottom: 90px; }
    
    .stat-card {
        box-shadow: var(--card-shadow);
        border: none;
    }

    .desktop-title-text { display: none !important; }
    .mobile-header-logo { display: block !important; }
}

@media (min-width: 768px) {
    .desktop-title-text { display: block !important; }
    .mobile-header-logo { display: none !important; }
}

/* ======================================================= */
/* ====== 8. SETTINGS PAGE START HERE ======= */
/* ======================================================= */
.profile-avatar-wrapper {
    width: 150px;
    height: 150px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e9ecef;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initials {
    font-size: 3rem;
    font-weight: bold;
    color: #495057;
}
/* ======================================================= */
/* ====== 9. CUSTOMER PAGE FIXES START HERE ======= */
/* ======================================================= */

.map-z-index-fix {
    z-index: 1000;
}

.col-lg-4 .card.sticky-top {
    z-index: 1010;
}

/* =========================================
   Mobile Bottom Nav Style
   ========================================= */

.mobile-bottom-nav .nav-link {
    color: #495057;
}

.mobile-bottom-nav .nav-link span {
    font-weight: 600;
    color: #212529;
}

.mobile-bottom-nav .nav-link.active {
    color: #0d6efd;
}

.mobile-bottom-nav .nav-link.active span {
    color: #0d6efd;
    font-weight: 700;
}
/* =========================================
   Settings Page - Profile Picture Fix
   ========================================= */

.profile-image-container {
    width: 150px;
    height: 150px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e9ecef;
    background-color: #f8f9fa;
}

img.profile-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-initials-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #495057;
    border-radius: 50%;
    background-color: #e9ecef;
}

/* =========================================
   Order Modal - Flatpickr Placeholder Fix
   ========================================= */

#modal-delivery-time-input {
    position: relative;
    line-height: 1.5;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

#modal-delivery-time-input::before {
    content: 'dd/mm/yyyy, --:-- --';
    color: #6c757d;
    position: absolute;
    left: 12px;
    top: 6px;
    pointer-events: none;
}

#modal-delivery-time-input.active::before,
#modal-delivery-time-input:valid::before {
    display: none;
}

#modal-delivery-time-input:focus::before {
    display: none;
}

/* Naye Header ke liye CSS */
#new-main-header .navbar {
    min-height: 60px;
    transition: min-height 0.2s;
}

#main-header-logo {
    transition: height 0.2s;
}

/* YEH CLASS JAVASCRIPT SE ADD HOGI JAB PHONE ROTATE HOGA */
#new-main-header.is-landscape .navbar {
    min-height: 80px !important; /* FIX: Changed to 80px */
}

#main-main-header.is-landscape {
    height: 80px !important;
    min-height: 80px !important;
}

#main-header-logo.is-landscape {
    height: 40px !important;
}

/* ======================================================= */
/* ====== COMPLETE CSS STYLES END HERE =================== */
/* ======================================================= */
/* Sidebar Header ki height 80px hai */
.sidebar-header {
    height: 60px !important;
}

/* Dashboard Header ki height aur padding ko lock karein */
@media (max-width: 767.98px) {
    /* Main Header (.main-eheader) se padding zero karein */
    .main-eheader {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        height: 60px !important;
        min-height: 60px !important;
    }
}
@media (max-width: 767px) {
    #live-map {
        /* 👇️ यह वह बदलाव है जो हाइट कम करेगा */
        height: 350px !important; /* उदाहरण के लिए 350px सेट करें */
    }
}

/* Notification Panel Styling */
.hover-bg-light:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Mobile Optimization: Full Screen Drawer */
@media (max-width: 768px) {
    #notificationPanel {
        width: 100% !important; /* Poori screen lega mobile par */
    }
    
    /* Button layout adjust */
    .offcanvas-header {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Sidebar Links ka General Style */
.sidebar-nav .nav-link {
    color: #555; /* Thoda dark grey text, poora black nahi */
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent; /* Layout hilne se bachane ke liye */
}

/* 1. Hover Effect (Mouse upar laane par) */
.sidebar-nav .nav-link:hover {
    background-color: #f8f9fa; /* Bilkul halka grey */
    color: #0d6efd; /* Text Blue */
    padding-left: 18px; /* Thoda sa slide effect */
}

/* 2. Active State (Jo aap chahte hain: Halka Feel) */
.sidebar-nav .nav-link.active {
    /* Ye hai wo magic line: Blue color ka 10% transparent version */
    background-color: rgba(13, 110, 253, 0.12); 
    
    /* Text ka color wahi rahega jo aapka theme color hai (Blue) */
    color: #0d6efd !important; 
    
    font-weight: 600; /* Thoda mota text taaki alag dikhe */
    border-color: rgba(13, 110, 253, 0.1); /* Optional: Halka border */
}

/* Active hone par Icon ka color bhi Blue karein */
.sidebar-nav .nav-link.active i {
    color: #0d6efd !important;
}

