/* FIX IT - Theme
   Colors lifted from the prototype: red on black, with light cards. */

:root {
    --fixit-red:       #E53E50;
    --fixit-red-dark:  #C72A3D;
    --fixit-black:     #0B0B0F;
    --fixit-dark-1:    #131826;
    --fixit-dark-2:    #1B2236;
    --fixit-pink:      #FDE7E9;
    --fixit-text:      #E8EAF0;
    --fixit-muted:     #B0B6C5;
}

/* Bootstrap's .text-muted defaults to #6c757d which is unreadable on
   our dark background. Force it to use our brighter shade everywhere. */
.text-muted,
.text-body-secondary { color: var(--fixit-muted) !important; }

* { box-sizing: border-box; }

html, body {
    background: var(--fixit-black);
    color: var(--fixit-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* ---------- Brand ---------- */
.brand-mark        { color: var(--fixit-red); letter-spacing: 1px; }
.brand-mark-light  { color: #fff; letter-spacing: 1px; }

/* ---------- Navigation ---------- */
.fixit-nav {
    background: rgba(11, 11, 15, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fixit-nav .nav-link {
    color: #c9ced9 !important;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
}
.fixit-nav .nav-link:hover { color: #fff !important; }
.fixit-nav .navbar-brand   { font-size: 1.4rem; }

/* ---------- Buttons ---------- */
.btn-fixit {
    background: var(--fixit-red);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.4rem;
    transition: background 0.18s ease, transform 0.18s ease;
}
.btn-fixit:hover { background: var(--fixit-red-dark); color: #fff; transform: translateY(-1px); }
.btn-fixit-outline {
    background: transparent;
    border: 1.5px solid var(--fixit-red);
    color: var(--fixit-red);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 1.4rem;
}
.btn-fixit-outline:hover { background: var(--fixit-red); color: #fff; }

/* ---------- Hero ---------- */
.hero {
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--fixit-red);
    width: 110px;
    border-radius: 0 0 4px 4px;
}
.hero h1 {
    font-weight: 800;
    font-size: 2.6rem;
    line-height: 1.15;
}
.hero .lead {
    color: var(--fixit-muted);
    max-width: 540px;
}
.hero .pill-row .pill {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.45rem 1rem;
    margin-right: 0.4rem;
    margin-bottom: 0.5rem;
    color: #d8dce7;
    font-size: 0.9rem;
}

/* ---------- Cards ---------- */
.fixit-card {
    background: var(--fixit-dark-1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.5rem;
    color: var(--fixit-text);
}
/* Bootstrap rows give equal-height columns, so when you want a card to fill
   its column height add `.h-100` on the element. Default is auto-height so
   stacked cards in a column don't each try to be full-column-tall. */
.fixit-card-title {
    color: var(--fixit-red);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Phone-card mockup style (used on landing) */
.phone {
    background: #fff;
    color: #111;
    border-radius: 22px;
    border: 6px solid #1d2233;
    padding: 0;
    overflow: hidden;
    width: 240px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}
.phone-header {
    background: var(--fixit-red);
    color: #fff;
    padding: 0.85rem 1rem;
    font-weight: 700;
    text-align: center;
}
.phone-body { padding: 1rem; }

/* ---------- Service cards ---------- */
.service-card {
    background: var(--fixit-dark-1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.18s ease, transform 0.18s ease;
    height: 100%;
    color: var(--fixit-text);
    text-decoration: none;
    display: block;
}
.service-card:hover {
    border-color: var(--fixit-red);
    transform: translateY(-3px);
    color: var(--fixit-text);
}
.service-card .icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--fixit-pink);
    color: var(--fixit-red);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
}
.service-card h5 { font-weight: 700; margin-bottom: 0.4rem; }
.service-card p  { color: var(--fixit-muted); font-size: 0.9rem; margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-card {
    background: var(--fixit-dark-1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 2rem;
}
.form-card .form-label { color: var(--fixit-muted); font-size: 0.85rem; font-weight: 500; }
.form-card .form-control,
.form-card .form-select {
    background: var(--fixit-dark-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fixit-text);
    padding: 0.65rem 0.9rem;
}
.form-card .form-control:focus,
.form-card .form-select:focus {
    background: var(--fixit-dark-2);
    color: var(--fixit-text);
    border-color: var(--fixit-red);
    box-shadow: 0 0 0 0.2rem rgba(229, 62, 80, 0.15);
}
.form-card .form-control::placeholder { color: #5b6175; }

/* ---------- Worker card ---------- */
.worker-card {
    background: var(--fixit-dark-1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.worker-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--fixit-pink);
    color: var(--fixit-red);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.worker-meta { color: var(--fixit-muted); font-size: 0.85rem; }
.worker-price { color: var(--fixit-red); font-weight: 700; }

/* ---------- Tracking timeline ---------- */
.tracking {
    background: var(--fixit-dark-1);
    border-radius: 14px;
    padding: 1.5rem;
}
.track-step {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.6rem 0;
    border-left: 2px solid rgba(255,255,255,0.08);
    margin-left: 12px;
    padding-left: 1rem;
    position: relative;
}
.track-step .dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--fixit-dark-2);
    border: 2px solid rgba(255,255,255,0.15);
    position: absolute;
    left: -12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.7rem;
}
.track-step.done .dot      { background: #22c55e; border-color: #22c55e; }
.track-step.current .dot   { background: var(--fixit-red); border-color: var(--fixit-red); }
.track-step .label { font-weight: 500; }
.track-step.done .label,
.track-step.current .label { color: #fff; }
.track-step .label.muted   { color: var(--fixit-muted); }

/* ---------- Stat tiles ---------- */
.stat-tile {
    background: var(--fixit-dark-1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: left;
}
.stat-tile .label { color: var(--fixit-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-tile .value { color: var(--fixit-red); font-size: 1.8rem; font-weight: 700; margin-top: 0.3rem; }

/* ---------- Tables ---------- */
/* Bootstrap 5.3 .table defaults to a white background via --bs-table-bg.
   Inside our dark cards that paints a glaring white block, so we force the
   base table to inherit transparency and our dark theme palette. */
.table {
    --bs-table-bg:           transparent;
    --bs-table-color:        var(--fixit-text);
    --bs-table-striped-bg:   rgba(255, 255, 255, 0.03);
    --bs-table-striped-color:var(--fixit-text);
    --bs-table-hover-bg:     rgba(255, 255, 255, 0.04);
    --bs-table-hover-color:  var(--fixit-text);
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    color: var(--fixit-text);
}
.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--fixit-text);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
.table thead th {
    color: var(--fixit-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* Hide the divider lines on borderless tables used inside cards. */
.fixit-card .table-borderless > :not(caption) > * > * { border: 0; }

.table-dark-soft {
    background: var(--fixit-dark-1);
    color: var(--fixit-text);
    border-radius: 12px;
    overflow: hidden;
}
.table-dark-soft thead th {
    background: var(--fixit-dark-2);
    color: var(--fixit-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
}
.table-dark-soft td, .table-dark-soft th {
    border-color: rgba(255,255,255,0.05);
    vertical-align: middle;
}

/* ---------- Section headings ---------- */
.section-head { position: relative; padding-top: 1rem; }
.section-head::before {
    content: "";
    position: absolute; top: 0; left: 0;
    width: 80px; height: 4px;
    background: var(--fixit-red);
    border-radius: 2px;
}
.section-head h2 { font-weight: 800; }
.section-head .lead { color: var(--fixit-muted); }

/* ---------- Notifications ---------- */
.notify-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    border: 2px solid var(--fixit-black);
}
.notify-menu {
    /* Override Bootstrap dropdown vars so the dark theme actually takes effect. */
    --bs-dropdown-bg:               var(--fixit-dark-1);
    --bs-dropdown-color:            var(--fixit-text);
    --bs-dropdown-link-color:       var(--fixit-text);
    --bs-dropdown-link-hover-bg:    var(--fixit-dark-2);
    --bs-dropdown-link-hover-color: #fff;
    --bs-dropdown-link-active-bg:   var(--fixit-dark-2);
    --bs-dropdown-link-active-color:#fff;
    --bs-dropdown-divider-bg:       rgba(255,255,255,0.05);
    --bs-dropdown-header-color:     var(--fixit-muted);
    --bs-dropdown-border-color:     rgba(255,255,255,0.08);

    min-width: 320px;
    max-width: 360px;
    padding: 0;
}
.notify-menu .dropdown-header {
    background: var(--fixit-dark-2);
    padding: 0.65rem 1rem;
    border-radius: 0;
}
.notify-menu hr.dropdown-divider {
    margin: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    opacity: 1;
}
.notify-menu .notify-item {
    padding: 0.65rem 1rem;
    white-space: normal;
    border-left: 3px solid transparent;
}
.notify-menu .notify-item.unread {
    border-left-color: var(--fixit-red);
    background: rgba(229, 62, 80, 0.08);
}

/* ---------- Online / offline pill ---------- */
.availability-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--fixit-dark-2);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.availability-pill .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #6c757d;
}
.availability-pill.online .dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }

/* ---------- Leaflet maps ---------- */
.fixit-map {
    width: 100%;
    height: 360px;
    border-radius: 12px;
    background: var(--fixit-dark-2);
    z-index: 0;
}
.fixit-map-sm { height: 240px; }
.fixit-map-lg { height: 480px; }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--fixit-dark-1);
    color: var(--fixit-text);
    border: 1px solid rgba(255,255,255,0.08);
}
.leaflet-popup-content { margin: 10px 14px; font-size: 0.85rem; }
.leaflet-popup-content a { color: var(--fixit-red); }
.leaflet-control-attribution {
    background: rgba(11,11,15,0.7) !important;
    color: var(--fixit-muted) !important;
}
.leaflet-control-attribution a { color: var(--fixit-text) !important; }
.fixit-pin {
    width: 28px; height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--fixit-red);
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.fixit-pin i {
    transform: rotate(45deg);
    color: #fff; font-size: 0.8rem;
}
.fixit-pin.muted    { background: #6c757d; }
.fixit-pin.worker   { background: #22c55e; }
.fixit-pin.customer { background: var(--fixit-red); }

/* ---------- Live offer pulse ---------- */
@keyframes fixitPulse {
    0%   { box-shadow: 0 0 0 0 rgba(229, 62, 80, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(229, 62, 80, 0); }
}
.offer-new {
    animation: fixitPulse 1.6s ease-out 1;
    border-color: var(--fixit-red) !important;
}

/* ---------- Footer ---------- */
.fixit-footer {
    background: #07070a;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-link {
    color: var(--fixit-muted);
    text-decoration: none;
}
.footer-link:hover { color: var(--fixit-red); }

/* ---------- Utility ---------- */
.text-red  { color: var(--fixit-red) !important; }
.bg-fixit  { background: var(--fixit-red) !important; color: #fff; }
.divider-red {
    width: 110px; height: 4px;
    background: var(--fixit-red);
    border-radius: 2px;
    margin: 1rem 0;
}

/* ==================================================================
   Responsive tuning
   Bootstrap handles most layout collapse via its grid (col-md-*, etc.).
   These rules tighten the things Bootstrap can't fix: bare font sizes,
   fixed widths, dropdown overflow on narrow viewports, and chrome that
   eats valuable space on phones.
   ================================================================== */

/* --- Tablets and below (<= 991px) --- */
@media (max-width: 991px) {
    .hero { padding: 3rem 0 2.5rem; }
    .hero h1 { font-size: 2.2rem; }
    .section-head h2 { font-size: 1.7rem; }
    /* Phone mockup on landing — center it under the hero copy. */
    .phone { width: 220px; }
}

/* --- Phones (<= 767px) --- */
@media (max-width: 767px) {
    .hero            { padding: 2.5rem 0 2rem; }
    .hero h1         { font-size: 1.8rem; line-height: 1.2; }
    .hero .lead      { font-size: 1rem; }
    .section-head h2 { font-size: 1.4rem; }
    .section-head .lead { font-size: 0.95rem; }

    .fixit-card { padding: 1.1rem; }
    .form-card  { padding: 1.25rem; }

    /* Tighten data tables so 6-10 column tables remain scannable. */
    .table             { font-size: 0.85rem; }
    .table > :not(caption) > * > * { padding: 0.55rem 0.6rem; }

    .stat-tile .value  { font-size: 1.4rem; }
    .stat-tile         { padding: 0.9rem; }

    .fixit-map         { height: 280px; }
    .fixit-map-sm      { height: 220px; }
    .fixit-map-lg      { height: 360px; }

    .navbar-brand      { font-size: 1.2rem; }
    .fixit-nav .nav-link { padding: 0.5rem 0; }

    /* Hero CTAs and most button rows should stack neatly. */
    .btn-fixit, .btn-fixit-outline { padding: 0.5rem 1rem; font-size: 0.92rem; }

    /* Worker meta info line: " ★ 4.8 · 5 yrs · 128 jobs · Wapda Town " */
    .worker-meta { font-size: 0.78rem; line-height: 1.45; }
    .worker-price { font-size: 1rem; }

    /* Worker profile rating-breakdown bars stay legible. */
    .availability-pill { font-size: 0.75rem; padding: 0.25rem 0.55rem; }
}

/* --- Very narrow phones (<= 480px) --- */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.55rem; }
    .phone   { width: 200px; }

    /* The bell dropdown's min-width 320 would overflow a 360px viewport
       after navbar padding. Make it span the screen with safe margins. */
    .notify-menu {
        position: fixed !important;
        top: 64px !important;
        right: 8px !important;
        left: 8px !important;
        min-width: 0;
        max-width: none;
        width: auto !important;
        transform: none !important;
    }

    /* Section heading underline shrinks to keep proportion. */
    .section-head::before { width: 60px; height: 3px; }

    /* Slimmer card padding on tiny screens. */
    .fixit-card  { padding: 1rem; border-radius: 12px; }
    .form-card   { padding: 1rem; }
}

/* --- Data tables on small screens ---
   Force cells to keep their natural width so .table-responsive triggers a
   horizontal scroll instead of breaking column headers character by character. */
@media (max-width: 767px) {
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table-dark-soft .table th,
    .table-dark-soft .table td { white-space: nowrap; }
}

/* Subtle hint that wide tables scroll horizontally on mobile. */
@media (max-width: 767px) {
    .table-responsive {
        background:
            linear-gradient(to right, var(--fixit-dark-1) 30%, rgba(19,24,38,0)) left center / 30px 100% no-repeat,
            linear-gradient(to right, rgba(19,24,38,0), var(--fixit-dark-1) 70%) right center / 30px 100% no-repeat,
            radial-gradient(ellipse at left, rgba(0,0,0,0.2), transparent 70%) left center / 14px 100% no-repeat,
            radial-gradient(ellipse at right, rgba(0,0,0,0.2), transparent 70%) right center / 14px 100% no-repeat;
        background-attachment: local, local, scroll, scroll;
    }
}

/* --- Touch-target accessibility on all small screens --- */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .dropdown-item { min-height: 40px; }
}
