/* =============================================
   Ibad Foodz - Premium Food Delivery Platform
   Style like Zomato/Swiggy
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

/* ====== SHADOWS & TRANSITIONS ====== */
:root {
    --primary: #ff6b35;
    --primary-dark: #e85d2c;
    --secondary: #ffb347;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --info: #3498db;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --gray: #7f8c8d;
    --white: #ffffff;
    --bg-gradient: linear-gradient(135deg, #ff6b35, #ff8c42, #ffb347);
    --shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.1);
    --radius: 20px;
    --radius-sm: 12px;
}

* { font-family: 'Poppins', sans-serif; box-sizing: border-box; }

body {
    background: #fbfbfb;
    min-height: 100vh;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== NAVBAR ====== */
.navbar {
    background: var(--white) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 12px 0;
}
.navbar-brand {
    font-weight: 900;
    font-size: 1.6rem;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.navbar-brand i { -webkit-text-fill-color: initial; color: var(--primary); margin-right: 6px; }
.nav-link {
    font-weight: 500;
    margin: 0 4px;
    border-radius: 24px;
    padding: 8px 18px !important;
    transition: all 0.3s;
}
.nav-link:hover { background: var(--bg-gradient); color: white !important; }

/* ====== HERO ====== */
.hero-section {
    background: var(--bg-gradient);
    color: white;
    padding: calc(80px + 60px) 0 80px;
    margin-bottom: 30px;
    border-radius: 0 0 40px 40px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.08)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,208C1248,224,1344,192,1392,176L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>') no-repeat bottom;
    background-size: cover;
}
.hero-section h1 { font-weight: 900; font-size: clamp(1.8rem, 5vw, 3.2rem); position: relative; line-height: 1.2; }
.hero-section p { font-size: clamp(0.95rem, 2.5vw, 1.2rem); opacity: 0.95; position: relative; }

/* ====== SEARCH ====== */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.search-box input {
    padding: 16px 20px 16px 50px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    background: white;
}
.search-box input:focus { box-shadow: 0 8px 30px rgba(0,0,0,0.2); outline: none; }
.search-box i {
    position: absolute; left: 20px; top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
}
.location-box {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    max-width: 100%;
}
.location-box button { border-radius: 999px; padding: 6px 14px; }
.location-box { flex-wrap: wrap; justify-content: center; border-radius: 24px; }

/* ====== CATEGORY PILLS ====== */
.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0 20px;
    -webkit-overflow-scrolling: touch;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
    flex-shrink: 0;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    background: white;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-pill:hover,
.category-pill.active {
    background: var(--bg-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow);
}

/* ====== RESTAURANT CARDS ====== */
.restaurant-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s;
    height: 100%;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}
.restaurant-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.15);
}
.restaurant-card .banner-wrap {
    position: relative;
    height: 180px;
    overflow: hidden;
}
.restaurant-card .banner-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.restaurant-card:hover .banner-wrap img { transform: scale(1.08); }
.restaurant-card .offer-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--bg-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}
.restaurant-card .logo-wrap {
    position: absolute;
    bottom: -30px; left: 16px;
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white;
}
.restaurant-card .logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.restaurant-card .card-body { padding: 40px 16px 16px; }
.restaurant-card .card-body h5 { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.restaurant-card .card-body .rating {
    background: var(--success);
    color: white;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-block;
}
.restaurant-card .card-body .delivery-time {
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--dark);
}

/* ====== MENU ITEMS ====== */
.menu-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}
.menu-item:last-child { border-bottom: none; }
.menu-item img {
    width: 120px; height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.menu-item .item-info { flex: 1; min-width: 0; }
.menu-item .item-actions { min-width: 96px; }
.menu-item .item-info { flex: 1; }
.menu-item .item-info h6 { font-weight: 700; margin-bottom: 4px; }
.menu-item .item-info .desc { font-size: 0.85rem; color: var(--gray); margin-bottom: 6px; }
.menu-item .item-info .price { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.add-btn {
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex-shrink: 0;
}
.add-btn:hover { transform: scale(1.05); box-shadow: var(--shadow); }

/* ====== BUTTONS ====== */
.btn-primary {
    background: var(--bg-gradient);
    border: none;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-soft);
}
.btn-primary:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow); 
}
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    border-radius: 50px !important;
    padding: 10px 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn-outline-primary:hover { 
    background: var(--bg-gradient); 
    border-color: transparent; 
    color: white; 
    box-shadow: var(--shadow);
}

/* ====== CARDS ====== */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: white;
}
.card:hover { 
    box-shadow: var(--shadow-hover); 
    transform: translateY(-2px);
}

/* ====== SIDEBAR ====== */
.sidebar {
    min-height: 100vh;
    background: var(--white);
    box-shadow: 2px 0 20px rgba(0,0,0,0.03);
}
.sidebar .nav-link {
    color: var(--gray);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--bg-gradient);
    color: white !important;
    box-shadow: var(--shadow-soft);
}

/* ====== DASHBOARD CARDS ====== */
.dashboard-card {
    border-left: 4px solid var(--primary);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.dashboard-card.restaurants { border-left-color: var(--primary); }
.dashboard-card.orders { border-left-color: var(--info); }
.dashboard-card.revenue { border-left-color: var(--warning); }
.dashboard-card .card-body { padding: 24px; }
.dashboard-card h3 { font-weight: 800; font-size: 2rem; margin-bottom: 4px; color: var(--dark); }
.dashboard-card h6 { color: var(--gray); font-weight: 500; font-size: 0.9rem; }

/* ====== FORM ====== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: #f8fafc;
}
.form-control:focus, .form-select:focus {
    background-color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}
.form-label { font-weight: 600; color: var(--dark); margin-bottom: 8px; font-size: 0.9rem;}

/* ====== MODAL ====== */
.modal-content { border-radius: var(--radius); border: none; overflow: hidden; }
.modal-header {
    background: var(--bg-gradient);
    color: white;
    padding: 20px 24px;
}
.modal-header .btn-close { filter: brightness(0) invert(1); }
.restaurant-profile-header {
    background: linear-gradient(135deg,#ff6b35,#ffb347);
    color: white;
}
.restaurant-profile-header .btn-close { filter: brightness(0) invert(1); }
.restaurant-profile-banner {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
}
.modal-header .btn-close { filter: brightness(0) invert(1); }
.modal-body { padding: 24px; }

/* ====== STATUS BADGES ====== */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-accepted { background: #d1ecf1; color: #0c5460; }
.status-preparing { background: #cce5ff; color: #004085; }
.status-shipped { background: #d1ecf1; color: #0c5460; }
.status-out-for-delivery { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* ====== BADGE ====== */
.badge-food {
    background: var(--bg-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
}
.bg-food { background: var(--bg-gradient) !important; }

/* ====== MAP ====== */
#map, #order-map, #admin-map { height: 400px; border-radius: var(--radius); }

/* ====== TABLE ====== */
.table thead th {
    color: var(--gray);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 12px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; }
.table img.rounded { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm) !important; }

/* ====== SECTION TITLE ====== */
.section-title {
    font-weight: 800;
    padding-bottom: 12px;
    margin-bottom: 24px;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 50px; height: 4px;
    background: var(--bg-gradient);
    border-radius: 2px;
}

/* ====== EMPTY STATE ====== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 4rem; color: #ddd; margin-bottom: 16px; }
.empty-state h4 { font-weight: 700; }
.empty-state p { color: var(--gray); }

/* ====== OFFER BANNER ====== */
.offer-banner {
    background: var(--bg-gradient);
    color: white;
    border-radius: var(--radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.offer-banner h3 { font-weight: 800; }
.offer-banner p { opacity: 0.9; }

/* ====== CHECKOUT ====== */
.checkout-item {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.checkout-item img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.checkout-item .flex-grow-1 { min-width: 0; }
.coupon-box { background: #fff7ed; border: 1px dashed #ff9f43; border-radius: var(--radius-sm); padding: 14px; }
.coupon-applied { background: #e8f8f0; border: 1px solid #2ecc71; border-radius: var(--radius-sm); padding: 12px; }
.wallet-offer-row { gap: 14px; }
.wallet-card, .verification-card { background: #ffffff; border: 1px solid #e9ecef; border-radius: var(--radius-sm); padding: 16px; height: 100%; box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.wallet-card { background: linear-gradient(135deg,#fff7ed,#ffffff); border-color: #ffd8a8; }
.verification-card { background: linear-gradient(135deg,#eef8ff,#ffffff); border-color: #bde0fe; }
.menu-meta { font-size: 0.8rem; color: var(--gray); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.menu-meta span { background: #f1f3f5; border-radius: 999px; padding: 4px 10px; }
.order-success-overlay { position: fixed; inset: 0; background: rgba(20,24,32,0.78); z-index: 3000; display: grid; place-items: center; }
.order-success-card { text-align: center; color: white; background: linear-gradient(135deg,#ff6b35,#ffb347); padding: 36px; border-radius: 28px; width: min(92vw, 420px); box-shadow: 0 24px 80px rgba(0,0,0,0.35); animation: popIn .45s ease; }
.scooter-animation { font-size: 4rem; margin-bottom: 12px; animation: drive 1.1s ease-in-out infinite; }
.success-progress { height: 8px; background: rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; margin-top: 22px; }
.success-progress span { display: block; height: 100%; width: 0; background: white; animation: progressFill 1.6s ease forwards; }
@keyframes popIn { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drive { 0%,100% { transform: translateX(-18px) rotate(-4deg); } 50% { transform: translateX(18px) rotate(4deg); } }
@keyframes progressFill { to { width: 100%; } }

/* ====== PULSE ANIMATION ====== */
.pulse {
    animation: pulse-anim 1.5s infinite;
    display: inline-block;
}
@keyframes pulse-anim {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .hero-section { padding: calc(60px + 50px) 0 50px; }
    .hero-section h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
    .restaurant-card .banner-wrap { height: 140px; }
    .menu-item img { width: 90px; height: 90px; }
    .menu-item { flex-direction: column; align-items: flex-start; }
    .menu-item .item-actions { width: 100%; justify-content: flex-end; }
    .checkout-item { flex-direction: column; align-items: flex-start; }
    .product-main-image { height: 300px; }
    .restaurant-hero { height: 220px; }
    .restaurant-logo-side { width: 60px; height: 60px; margin-top: -40px; }
    .dashboard-card { margin-bottom: 15px; }
}

/* ===== Delivery Partner Page Responsive Tweaks ===== */
@media (max-width: 576px) {
    /* Make navbar actions fit on small screens */
    .navbar .ms-auto { gap: 6px !important; }
    .navbar .btn, .navbar .badge { font-size: 0.85rem; }

    /* Delivery cards become tighter on phones */
    .delivery-card { padding: 14px !important; border-radius: 14px !important; }
    .delivery-card h5 { font-size: 1rem !important; }

    /* Map modal */
    #delivery-map { height: 320px !important; }

    /* Buttons stack better */
    .delivery-card .d-flex { flex-direction: column !important; align-items: stretch !important; }
    .delivery-card .d-flex .btn { width: 100% !important; }
}

