/* =====================================================
   HOME SERVICES MARKETPLACE - CUSTOM STYLES
   Theme: Navy Blue (#0A3D91) & White
   ===================================================== */

:root {
    --navy: #0A3D91;
    --navy-dark: #062a66;
    --navy-light: #e8eef9;
    --white: #ffffff;
    --gray-light: #f5f7fb;
    --text-muted: #6b7280;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(10, 61, 145, 0.08);
    --shadow-md: 0 6px 20px rgba(10, 61, 145, 0.12);
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #2b2f33;
    background-color: var(--gray-light);
    -webkit-font-smoothing: antialiased;
}

/* ===== Color Utilities ===== */
.text-navy { color: var(--navy) !important; }
.bg-navy { background-color: var(--navy) !important; }
.bg-navy-light { background-color: var(--navy-light) !important; }

.btn-navy {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
    transition: var(--transition);
}
.btn-navy:hover, .btn-navy:focus {
    background-color: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

.btn-outline-navy {
    border-color: var(--navy);
    color: var(--navy);
    transition: var(--transition);
}
.btn-outline-navy:hover, .btn-outline-navy:focus {
    background-color: var(--navy);
    color: #fff;
}

a { text-decoration: none; }
a.footer-link { color: rgba(255,255,255,0.75); transition: var(--transition); }
a.footer-link:hover { color: #fff; padding-left: 4px; }

/* ===== Header ===== */
.site-header { z-index: 1030; }
.navbar-brand img { object-fit: contain; }
.nav-link {
    font-weight: 500;
    color: #344054;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--navy); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
}
.greeting-bar { font-size: 0.85rem; }

/* ===== Hero Carousel ===== */
.hero-carousel .carousel-item {
    height: 720px;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 0px 0px;
    overflow: hidden;
}
.hero-carousel .carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,61,145,0.75) 0%, rgba(10,61,145,0.25) 60%, rgba(10,61,145,0.05) 100%);
}
.hero-carousel .carousel-caption {
    text-align: left;
    left: 5%;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    max-width: 560px;
    z-index: 2;
}
.hero-carousel .carousel-caption h2 {
    font-weight: 700;
    font-size: 2.4rem;
}
.hero-carousel .carousel-indicators [data-bs-target] {
    background-color: #fff;
}
@media (max-width: 768px) {
    .hero-carousel .carousel-item { height: 320px; }
    .hero-carousel .carousel-caption h2 { font-size: 1.5rem; }
    .hero-carousel .carousel-caption { max-width: 90%; }
}

/* ===== Search Bar ===== */
.search-bar-wrapper {
    margin-top: -40px;
    position: relative;
    z-index: 5;
}
.search-bar-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: #fff;
    padding: 1rem;
}
.search-bar-card .form-control,
.search-bar-card .form-select {
    border-radius: 10px;
    padding: 0.7rem 1rem;
}

/* ===== Section Titles ===== */
.section-title {
    font-weight: 700;
    color: var(--navy);
    position: relative;
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ===== Cards ===== */
.category-card, .service-card, .provider-card, .info-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #eef1f6;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}
.category-card:hover, .service-card:hover, .provider-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.category-card { text-align: center; padding: 1.5rem 1rem; cursor: pointer; }
.category-card .cat-icon-wrap {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: var(--navy-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    transition: var(--transition);
}
.category-card:hover .cat-icon-wrap { background: var(--navy); }
.category-card .cat-icon-wrap i { font-size: 1.8rem; color: var(--navy); transition: var(--transition); }
.category-card:hover .cat-icon-wrap i { color: #fff; }
.category-card h6 { font-weight: 600; margin-bottom: 0.25rem; }
.category-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.service-card img, .category-card img {
    width: 100%; height: 140px; object-fit: cover;
}
.service-card .card-body { padding: 1rem; }
.service-card .price-tag {
    font-weight: 700; color: var(--navy); font-size: 1.1rem;
}
.service-card .duration-tag {
    font-size: 0.78rem; color: var(--text-muted);
}

.provider-card img.provider-avatar {
    width: 64px; height: 64px; object-fit: cover; border-radius: 50%;
    border: 2px solid var(--navy-light);
}
.provider-card .rating-badge {
    background: var(--navy-light); color: var(--navy);
    border-radius: 8px; padding: 2px 8px; font-size: 0.85rem; font-weight: 600;
}

/* ===== Step Indicator (Booking Flow) ===== */
.booking-steps {
    display: flex; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 0.5rem;
}
.booking-steps .step {
    flex: 1; text-align: center; padding: 0.5rem; font-size: 0.8rem; color: var(--text-muted);
    border-bottom: 3px solid #e5e9f2; font-weight: 600;
}
.booking-steps .step.active { color: var(--navy); border-color: var(--navy); }
.booking-steps .step.done { color: #198754; border-color: #198754; }

/* ===== Dashboard Sidebar ===== */
.dash-sidebar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}
.dash-sidebar .nav-link {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.25rem;
    color: #344054;
}
.dash-sidebar .nav-link.active, .dash-sidebar .nav-link:hover {
    background: var(--navy-light);
    color: var(--navy);
}
.dash-sidebar .nav-link i { width: 20px; text-align: center; margin-right: 8px; }

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy-light); color: var(--navy); font-size: 1.3rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

/* ===== Forms ===== */
.form-control:focus, .form-select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 0.2rem rgba(10, 61, 145, 0.15);
}
.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.auth-card .auth-side {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #fff;
    padding: 3rem 2rem;
    display: flex; flex-direction: column; justify-content: center;
}

/* ===== Misc ===== */
.badge { font-weight: 500; }
.fade-in { animation: fadeInUp 0.5s ease both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.map-container { height: 350px; border-radius: var(--radius); overflow: hidden; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; color: var(--navy-light); margin-bottom: 1rem; }

/* ===== Scroll-snap horizontal lists (mobile) ===== */
.scroll-row {
    display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}
.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 4px; }
.scroll-row > * { scroll-snap-align: start; flex: 0 0 auto; }

@media (min-width: 992px) {
    .scroll-row { overflow: visible; flex-wrap: wrap; }
}

/* =====================================================
   HOME DASHBOARD (app-style homepage)
   ===================================================== */

/* Push page content above the fixed bottom nav on mobile */
body.page-home-dashboard { padding-bottom: 0; }
@media (max-width: 991.98px) {
    body.page-home-dashboard { padding-bottom: 72px; }
}

/* ----- Hero ----- */
.home-hero {
    background: linear-gradient(160deg, var(--navy) 0%, #1455c4 55%, #1f6fe0 100%);
    color: #fff;
    padding: 1.5rem 0 2.75rem;
    border-radius: 0 0 28px 28px;
    position: relative;
    overflow: hidden;
}
.home-hero::after {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    top: -140px; right: -80px;
}
.home-hero-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.1rem; position: relative; z-index: 1;
}
.home-hero-location {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 500; opacity: 0.95;
}
.home-hero-location i { color: #6fe3a4; }
.home-hero-bell {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    color: #fff; position: relative; transition: var(--transition);
}
.home-hero-bell:hover { background: rgba(255,255,255,0.25); }
.home-hero-bell-dot {
    position: absolute; top: 7px; right: 8px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #ffb020; border: 2px solid var(--navy);
}
.home-hero-greeting {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 0.2rem;
    position: relative; z-index: 1;
}
.home-hero-sub {
    font-size: 0.95rem; opacity: 0.85; margin-bottom: 1.25rem;
    position: relative; z-index: 1;
}
.home-search-form { position: relative; z-index: 1; }
.home-search-bar {
    background: #fff; border-radius: 14px;
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1rem;
}
.home-search-bar i.fa-magnifying-glass { color: var(--navy); }
.home-search-input {
    border: none; outline: none; flex: 1;
    font-size: 0.95rem; color: #2b2f33; min-width: 0;
}
.home-search-locate {
    background: var(--navy-light); color: var(--navy);
    border: none; width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: var(--transition);
}
.home-search-locate:hover { background: var(--navy); color: #fff; }

/* ----- Emergency banner ----- */
.emergency-banner {
    display: flex; align-items: center; gap: 0.9rem;
    background: linear-gradient(135deg, #e6373c 0%, #c41e2a 100%);
    color: #fff; text-decoration: none;
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin-top: -1.4rem;
    box-shadow: 0 8px 20px rgba(196, 30, 42, 0.25);
    position: relative; z-index: 2;
    transition: var(--transition);
}
.emergency-banner:hover { transform: translateY(-2px); color: #fff; }
.emergency-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.emergency-title { font-weight: 700; font-size: 0.95rem; }
.emergency-sub { font-size: 0.78rem; opacity: 0.9; }
.emergency-arrow { opacity: 0.8; }

/* ----- Radius filter pills ----- */
.radius-filter {
    display: flex; gap: 0.6rem; overflow-x: auto;
    margin: 1.4rem 0 0.5rem; padding-bottom: 4px;
}
.radius-chip {
    flex: 0 0 auto;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    background: #fff; border: 1px solid #e5e9f2;
    color: #344054; font-size: 0.85rem; font-weight: 600;
    text-decoration: none; transition: var(--transition);
    white-space: nowrap;
}
.radius-chip:hover { border-color: var(--navy); color: var(--navy); }
.radius-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ----- Section headers used across the dashboard ----- */
.home-section { margin-top: 2.2rem; }
.home-section-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 1rem;
}
.home-section-head h2 {
    font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 0;
}
.home-section-head a {
    font-size: 0.85rem; font-weight: 600; color: var(--navy);
    text-decoration: none;
}
.home-section-head a:hover { text-decoration: underline; }

/* ----- Service tiles grid ----- */
.service-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}
@media (max-width: 575.98px) {
    .service-tile-grid { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
}
.service-tile {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    text-decoration: none; color: #344054; text-align: center;
}
.service-tile-icon {
    width: 100%; aspect-ratio: 1 / 1; max-width: 130px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--navy);
    transition: var(--transition);
}
.service-tile:hover .service-tile-icon { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.service-tile span { font-size: 0.9rem; font-weight: 600; line-height: 1.2; }

/* ----- Mini "map" widget (stylized, no external map dependency) ----- */
.mini-map {
    position: relative;
    height: 230px;
    border-radius: var(--radius);
    background:
        linear-gradient(0deg, rgba(10,61,145,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10,61,145,0.06) 1px, transparent 1px),
        var(--navy-light);
    background-size: 28px 28px, 28px 28px, cover;
    overflow: hidden;
    border: 1px solid #dbe6f7;
}
.mini-map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
}
.mini-map-pin-icon { font-size: 1.6rem; }
.mini-map-pin.is-available .mini-map-pin-icon { color: #d81b4b; }
.mini-map-pin.is-busy .mini-map-pin-icon { color: #9aa5b1; }
.mini-map-pin-label {
    background: #fff; border-radius: 999px;
    padding: 2px 9px; font-size: 0.72rem; font-weight: 600; color: #2b2f33;
    box-shadow: var(--shadow-sm); white-space: nowrap;
    display: flex; align-items: center; gap: 4px;
}
.mini-map-pin-label i { color: #ffb020; font-size: 0.65rem; }
.mini-map-you {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 38px; border-radius: 12px;
    background: #fff; box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy); font-size: 1.1rem;
}

/* ----- Nearby provider rows ----- */
.provider-row {
    display: flex; align-items: center; gap: 0.9rem;
    background: #fff; border-radius: var(--radius);
    border: 1px solid #eef1f6; box-shadow: var(--shadow-sm);
    padding: 0.9rem; transition: var(--transition);
}
.provider-row:hover { box-shadow: var(--shadow-md); }
.provider-row-avatar-link { position: relative; flex-shrink: 0; }
.provider-row-avatar {
    width: 58px; height: 58px; border-radius: 14px; object-fit: cover;
}
.provider-row-status-dot {
    position: absolute; bottom: -2px; right: -2px;
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid #fff;
}
.provider-row-status-dot.online { background: #2ecc71; }
.provider-row-status-dot.offline { background: #b0b8c1; }
.provider-row-info { flex: 1; min-width: 0; }
.provider-row-name {
    display: block; font-weight: 700; color: #1f2430; font-size: 0.98rem;
    text-decoration: none; margin-bottom: 1px;
}
.provider-row-name:hover { color: var(--navy); }
.provider-row-skill { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.provider-row-meta { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.provider-row-rating { color: #f5a524; font-weight: 700; }
.provider-row-rating i { margin-right: 2px; }
.provider-row-reviews { color: var(--text-muted); }
.provider-row-distance {
    background: var(--navy-light); color: var(--navy);
    border-radius: 6px; padding: 1px 7px; font-weight: 600;
    margin-left: 2px;
}
.provider-row-action { text-align: right; flex-shrink: 0; }
.provider-row-price { font-weight: 700; color: #1f2430; font-size: 0.9rem; margin-bottom: 6px; }
.provider-row-price span { font-weight: 500; color: var(--text-muted); font-size: 0.72rem; }
.btn-book-now {
    display: inline-block; background: var(--navy); color: #fff;
    font-size: 0.8rem; font-weight: 600; border: none;
    padding: 0.4rem 0.95rem; border-radius: 8px; text-decoration: none;
    transition: var(--transition);
}
.btn-book-now:hover { background: var(--navy-dark); color: #fff; }
.btn-busy {
    background: #e3e7ee; color: #7c8694; font-size: 0.8rem; font-weight: 600;
    border: none; padding: 0.4rem 0.95rem; border-radius: 8px; cursor: not-allowed;
}

/* ----- Mobile bottom navigation ----- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
    background: #fff;
    border-top: 1px solid #eef1f6;
    box-shadow: 0 -4px 16px rgba(10,61,145,0.08);
    display: flex; justify-content: space-around;
    padding: 0.5rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: #9aa5b1; text-decoration: none; font-size: 0.68rem; font-weight: 600;
    flex: 1; padding: 4px 0; transition: var(--transition);
}
.bottom-nav-item i { font-size: 1.15rem; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--navy); }

/* ----- Desktop refinements (same theme, adapted layout) ----- */
@media (min-width: 992px) {
    .home-hero { padding: 2.25rem 0 4rem; border-radius: 0 0 32px 32px; }
    .home-hero-greeting { font-size: 2rem; }
    .home-hero-sub { font-size: 1.05rem; }
    .home-search-form { max-width: 640px; }
    .home-search-bar { padding: 1rem 1.25rem; }

    .emergency-banner { margin-top: -2rem; max-width: 100%; }

    .service-tile-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
    .service-tile-icon { font-size: 2.4rem; border-radius: 22px; }

    .mini-map { height: 320px; }

    .provider-row { padding: 1.1rem 1.3rem; }
    .provider-row-avatar { width: 66px; height: 66px; }
}
@media (min-width: 1200px) {
    .home-search-form { max-width: 720px; }
}