/*
 * MyCarPlate.my — Premium Dark Theme (style.css)
 * Counter above search, SEARCH button hidden, CLEAR full width
 */

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

:root {
    --mp-black:  #000000;
    --mp-dark:   #0a0a0a;
    --mp-card:   #111111;
    --mp-gold:   #fcd116;
    --mp-red:    #e30613;
    --mp-text:   #ffffff;
    --mp-mute:   #999999;
    --mp-border: rgba(252,209,22,.25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--mp-black);
    color: var(--mp-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--mp-gold); text-decoration: none; }
a:hover { color: #fff; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    position: relative;
    background: var(--mp-black);
    overflow: hidden;
    padding-bottom: 18px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%);
    background-size: 8px 8px;
    z-index: 1;
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../img/hero-car.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.45;
}
.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0,0,0,.4) 0%,
        rgba(0,0,0,.15) 35%,
        rgba(0,0,0,.7) 75%,
        rgba(0,0,0,.95) 100%);
}

/* ---------- TOP BAR ---------- */
.topbar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px;
}
.topbar .logo-link { display: flex; align-items: center; gap: 10px; }
.topbar .logo-img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
@media (min-width: 768px) {
    .topbar .logo-img { height: 44px; }
}
.topbar .menu-btn {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.topbar .menu-btn:hover { background: var(--mp-gold); color: #000; border-color: var(--mp-gold); }

/* ---------- HERO TEXT ---------- */
.hero-text {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 14px 20px 0;
    animation: heroFadeIn .9s ease-out;
}
/* Hero center logo (above slogan) */
.hero-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.hero-logo-img {
    width: 140px;
    height: auto;
    display: block;
    max-width: 50vw;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
@media (min-width: 768px) {
    .hero-logo-img { width: 180px; }
}
.hero-text h1 {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 1px;
    text-shadow: 0 2px 18px rgba(0,0,0,.95);
}
.hero-text h1 .red  { color: var(--mp-red); }
.hero-text h1 .gold { color: var(--mp-gold); }
.hero-text .sub {
    margin-top: 10px;
    font-size: 12px;
    color: #ccc;
    letter-spacing: 1px;
}

@media (min-width: 768px) {
    .hero-text h1 { font-size: 56px; }
    .hero-text .sub { font-size: 15px; }
}

/* ---------- COUNTER STRIP (NOW BEFORE SEARCH) ---------- */
.stats {
    position: relative;
    z-index: 5;
    margin: 22px 14px 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    animation: heroFadeIn 1.1s ease-out .25s both;
}
.stat {
    text-align: center;
    padding: 6px 2px;
    border-right: 1px solid rgba(252,209,22,.18);
}
.stat:last-child { border-right: 0; }
.stat .num {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--mp-gold);
    line-height: 1;
    letter-spacing: 1px;
}
.stat .num .plus { color: var(--mp-red); }
.stat .label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.3;
}
@media (min-width: 768px) {
    .stat .num { font-size: 36px; }
    .stat .label { font-size: 11px; }
    .stat { padding: 8px 4px; }
}

/* ---------- SEARCH CARD (NOW AFTER COUNTER) ---------- */
.search-section {
    position: relative;
    z-index: 5;
    margin: 16px 14px 0;
}
.search-card {
    background: rgba(15,15,15,.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--mp-border);
    border-radius: 14px;
    padding: 14px;
    max-width: 540px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0,0,0,.6);
    animation: heroFadeIn 1s ease-out .35s both;
}
.search-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-wrap input {
    width: 100%;
    height: 42px;
    background: #000;
    border: 1px solid #2a2a2a;
    color: #fff;
    padding: 0 56px 0 14px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    transition: border-color .15s, box-shadow .15s;
}
.search-input-wrap input::placeholder {
    color: #aaa;
    font-size: 12px;
    letter-spacing: 1.5px;
}
.search-input-wrap input:focus {
    outline: none;
    border-color: var(--mp-gold);
    box-shadow: 0 0 0 3px rgba(252,209,22,.15);
}
.search-clear-btn {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    background: #2a2a2a;
    border: 0;
    border-radius: 50%;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all .15s;
}
.search-clear-btn:hover { background: var(--mp-red); color: #fff; }
.search-input-wrap.has-value .search-clear-btn { display: flex; }
.search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    border: 2px solid #333;
    border-top-color: var(--mp-gold);
    border-radius: 50%;
    display: none;
    animation: spin .8s linear infinite;
}
.search-spinner.is-active { display: inline-block; }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.btn-row { display: flex; gap: 8px; margin-top: 4px; }

/* SEARCH button hidden — using auto-search */
.btn-search { display: none !important; }

/* CLEAR button — stretches full width since SEARCH is hidden */
.btn-clear-all {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--mp-gold);
    color: var(--mp-gold);
    border-radius: 7px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 12px;
    cursor: pointer;
    height: 38px;
    transition: all .2s;
}
.btn-clear-all:hover { background: var(--mp-gold); color: #000; }

#search-result-count {
    text-align: center;
    color: #fcd116;
    font-size: 11px;
    margin-top: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
    min-height: 14px;
    text-transform: uppercase;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CATEGORY CHIPS
   ============================================================ */
.chips-section {
    background: var(--mp-dark);
    border-top: 1px solid rgba(252,209,22,.1);
    border-bottom: 1px solid rgba(252,209,22,.1);
    padding: 14px 14px;
    text-align: center;
}
.chips-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.chips a {
    padding: 7px 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #ccc;
    border-radius: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.chips a:hover { border-color: var(--mp-gold); color: var(--mp-gold); }
.chips a.active {
    background: var(--mp-gold);
    color: #000;
    border-color: var(--mp-gold);
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content {
    background: var(--mp-dark);
    padding: 24px 14px 40px;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 14px;
}
.section-title:first-child { margin-top: 0; }
.section-title h2 {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--mp-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    border-left: 3px solid var(--mp-red);
    padding-left: 10px;
}
.section-title .count {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    color: #666;
    letter-spacing: 1px;
}

/* ============================================================
   PLATE GRID
   ============================================================ */
.plate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (min-width: 600px) { .plate-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .plate-grid { grid-template-columns: repeat(4, 1fr); } }

.empty-state {
    background: #1a1a1a;
    border: 1px dashed #333;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: #666;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}

.loading {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid #333;
    border-top-color: var(--mp-gold);
    border-radius: 50%;
    animation: spinc .8s linear infinite;
    vertical-align: middle;
}
@keyframes spinc { to { transform: rotate(360deg); } }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
    background: #fff;
    color: #1f2937;
    border-radius: 14px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 12px 40px rgba(252,209,22,.15);
    border: 1px solid rgba(252,209,22,.2);
    animation: modalIn .25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: transparent;
    border: 0;
    font-size: 26px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}
.modal-close:hover { color: #000; }
.modal h3 {
    margin: 0 0 6px;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.modal .price {
    font-family: 'Rajdhani', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #1e3a8a;
    text-align: center;
    margin: 18px 0;
    letter-spacing: 1px;
}
.modal .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(1px); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5d; }
.btn-enquiry { background: #1e3a8a; color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-top: 0;
    padding: 30px 16px 24px;
    text-align: center;
    color: #666;
    font-size: 12px;
    background: #000;
    border-top: 1px solid rgba(252,209,22,.1);
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}
.site-footer .sa-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    background: transparent;
    color: var(--mp-gold);
    border: 1px solid var(--mp-gold);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
}
.site-footer .sa-link:hover { background: var(--mp-gold); color: #000; }

/* ============================================================
   SA BAR
   ============================================================ */
.sa-bar {
    background: linear-gradient(90deg, #1a1a00, #0a0a0a);
    border-bottom: 1px solid var(--mp-gold);
    padding: 10px 14px;
    font-size: 13px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
}
.sa-bar .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.sa-bar .sa-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sa-bar .sa-btn {
    padding: 7px 12px;
    background: var(--mp-gold);
    color: #000;
    border: 0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
}
.sa-bar .sa-btn:hover { background: #ffe04a; }
.sa-bar .sa-logout {
    background: transparent;
    color: var(--mp-red);
    border: 1px solid var(--mp-red);
}
.sa-bar .sa-logout:hover { background: var(--mp-red); color: #fff; }

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity .2s;
}
.drawer-overlay.open { display: block; opacity: 1; }
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: #0a0a0a;
    border-left: 1px solid var(--mp-gold);
    z-index: 901;
    transform: translateX(100%);
    transition: transform .25s ease-out;
    padding: 60px 24px 24px;
}
.drawer.open { transform: translateX(0); }
.drawer h3 {
    color: var(--mp-gold);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    margin: 0 0 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.drawer a {
    display: block;
    padding: 12px 0;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #1a1a1a;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: 600;
}
.drawer a:hover { color: var(--mp-gold); }
.drawer .close-drawer {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
