/* ============================================================
   PiEED.com — Main Stylesheet
   Blue & White — Trust, Local, Professional
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-900:  #0F2756;
    --blue-800:  #1A3A6B;
    --blue-700:  #1E4D8C;
    --blue-600:  #1D5FAD;
    --blue-500:  #2272CC;
    --blue-400:  #4A90E2;
    --blue-100:  #DDEEFF;
    --blue-50:   #EEF6FF;
    --white:     #FFFFFF;
    --gray-900:  #111827;
    --gray-700:  #374151;
    --gray-500:  #6B7280;
    --gray-300:  #D1D5DB;
    --gray-100:  #F3F4F6;
    --green-500: #16A34A;
    --red-500:   #DC2626;
    --orange-500:#EA580C;
    --yellow-400:#FBBF24;

    --font-head: 'Inter', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
    --shadow-md: 0 4px 16px rgba(0,0,0,.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
    --transition: .18s ease;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--gray-900); background: var(--white); line-height: 1.6; }
img  { max-width: 100%; display: block; }
a    { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-800); }

/* --- Typography -------------------------------------------- */
h1,h2,h3,h4,h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-weight: 600; }
p  { margin-bottom: 1rem; }

/* --- Layout ------------------------------------------------ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section    { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { color: var(--blue-900); }
.section-title p  { color: var(--gray-500); margin-top: .5rem; font-size: 1.05rem; }

/* --- Header ------------------------------------------------ */
.site-header {
    background: var(--blue-900);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
    display: flex; align-items: center; gap: 2rem;
    padding-top: .85rem; padding-bottom: .85rem;
}
.logo { display: flex; align-items: baseline; gap: 1px; font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.logo-pi  { color: var(--white); }
.logo-eed { color: var(--blue-400); }
.logo-dot { color: var(--yellow-400); }
.logo-com { color: var(--gray-300); font-size: 1rem; font-weight: 500; }

.main-nav { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.main-nav a { color: var(--gray-300); font-size: .93rem; font-weight: 500; transition: color var(--transition); }
.main-nav a:hover { color: var(--white); }
.nav-cta-outline {
    border: 1.5px solid var(--blue-400); color: var(--blue-400) !important;
    padding: .4rem .9rem; border-radius: var(--radius-sm);
}
.nav-cta-outline:hover { background: var(--blue-400); color: var(--white) !important; }
.nav-cta {
    background: var(--blue-500); color: var(--white) !important;
    padding: .4rem .9rem; border-radius: var(--radius-sm);
}
.nav-cta:hover { background: var(--blue-400) !important; }
.nav-login { color: var(--gray-300) !important; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; margin-left: auto; padding: .25rem; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: all .2s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero -------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-500) 100%);
    padding: 5rem 0 4rem;
    color: var(--white);
    text-align: center;
}
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero p   { color: var(--blue-100); font-size: 1.15rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-search {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 720px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}
.hero-search-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-search input,
.hero-search select {
    flex: 1; min-width: 140px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: .65rem 1rem;
    font-size: .95rem;
    font-family: var(--font-body);
    color: var(--gray-900);
    transition: border-color var(--transition);
}
.hero-search input:focus,
.hero-search select:focus { outline: none; border-color: var(--blue-500); }
.hero-search .btn-search {
    background: var(--blue-600); color: var(--white);
    border: none; border-radius: var(--radius-sm);
    padding: .65rem 1.5rem; font-size: .95rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background var(--transition);
}
.hero-search .btn-search:hover { background: var(--blue-800); }
.hero-stats { display: flex; justify-content: center; gap: 2.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stat  { text-align: center; }
.hero-stat-num  { font-size: 1.8rem; font-weight: 800; color: var(--white); }
.hero-stat-label{ font-size: .85rem; color: var(--blue-100); margin-top: .1rem; }

/* --- Buttons ----------------------------------------------- */
.btn { display: inline-block; padding: .6rem 1.4rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem; cursor: pointer; transition: all var(--transition); border: none; font-family: var(--font-body); }
.btn-primary   { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-800); color: var(--white); }
.btn-outline   { background: transparent; border: 1.5px solid var(--blue-600); color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-600); color: var(--white); }
.btn-success   { background: var(--green-500); color: var(--white); }
.btn-danger    { background: var(--red-500); color: var(--white); }
.btn-sm        { padding: .35rem .85rem; font-size: .85rem; }
.btn-lg        { padding: .8rem 2rem; font-size: 1.05rem; }
.btn-block     { display: block; width: 100%; text-align: center; }

/* --- Cards ------------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.cat-card {
    display: flex; flex-direction: column; align-items: center; gap: .6rem;
    padding: 1.25rem 1rem; border-radius: var(--radius-md);
    border: 1.5px solid var(--blue-100); background: var(--blue-50);
    cursor: pointer; transition: all var(--transition); text-align: center;
    text-decoration: none; color: var(--blue-800);
}
.cat-card:hover { background: var(--blue-600); color: var(--white); border-color: var(--blue-600); }
.cat-card i  { font-size: 1.6rem; }
.cat-card span{ font-size: .88rem; font-weight: 600; }

/* Listing cards */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.listing-card { display: flex; flex-direction: column; gap: .6rem; }
.listing-card-top { display: flex; gap: 1rem; align-items: flex-start; }
.listing-logo {
    width: 64px; height: 64px; border-radius: var(--radius-sm);
    object-fit: cover; border: 1px solid var(--gray-300); flex-shrink: 0;
    background: var(--blue-50); display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--blue-600);
}
.listing-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.listing-info h3 { font-size: 1rem; color: var(--blue-900); margin-bottom: .15rem; }
.listing-info .cat-badge {
    display: inline-block; background: var(--blue-100); color: var(--blue-800);
    font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px;
}
.listing-meta  { font-size: .85rem; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.listing-meta i{ color: var(--blue-500); margin-right: .2rem; }
.star-row { display: flex; align-items: center; gap: .3rem; font-size: .88rem; }
.star-row .stars { color: var(--yellow-400); letter-spacing: 1px; }
.listing-card .btn { margin-top: auto; }

/* --- Forms ------------------------------------------------- */
.form-card { max-width: 520px; margin: 3rem auto; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; color: var(--gray-700); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm); padding: .65rem 1rem;
    font-size: .95rem; font-family: var(--font-body); color: var(--gray-900);
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(34,114,204,.1); }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group .hint { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .93rem; }
.form-check input { width: auto; }

/* Logo upload preview */
.logo-upload-wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo-preview {
    width: 80px; height: 80px; border-radius: var(--radius-sm);
    border: 2px dashed var(--gray-300); display: flex; align-items: center;
    justify-content: center; overflow: hidden; background: var(--gray-100);
    font-size: 1.8rem; color: var(--gray-300);
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* --- Breadcrumb -------------------------------------------- */
.breadcrumb { padding: .75rem 0; font-size: .85rem; color: var(--gray-500); }
.breadcrumb a { color: var(--blue-600); }
.breadcrumb span { margin: 0 .4rem; }

/* --- Badges / Status --------------------------------------- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-pending  { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-premium  { background: var(--blue-900); color: var(--yellow-400); }
.badge-free     { background: var(--gray-100); color: var(--gray-700); }

/* --- Flash messages ---------------------------------------- */
.flash {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem; font-size: .93rem; font-weight: 500;
}
.flash button { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .7; }
.flash-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--green-500); }
.flash-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--red-500); }
.flash-info    { background: var(--blue-50); color: var(--blue-800); border-left: 4px solid var(--blue-500); }

/* --- Rating stars ------------------------------------------ */
.rating-input { display: flex; flex-direction: row-reverse; gap: .25rem; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.6rem; color: var(--gray-300); cursor: pointer; }
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label { color: var(--yellow-400); }

/* --- Trust bar --------------------------------------------- */
.trust-bar {
    background: var(--blue-50); border-top: 1px solid var(--blue-100);
    border-bottom: 1px solid var(--blue-100); padding: 1rem 0;
}
.trust-bar-inner { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--blue-800); }
.trust-item i { color: var(--blue-600); }

/* --- Admin panel ------------------------------------------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--blue-900); padding: 1.5rem 0;
    position: sticky; top: 56px; height: calc(100vh - 56px);
    overflow-y: auto;
}
.admin-sidebar .sidebar-logo { padding: .5rem 1.5rem 1.5rem; border-bottom: 1px solid var(--blue-800); margin-bottom: 1rem; }
.admin-sidebar a {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.5rem; color: var(--gray-300);
    font-size: .9rem; font-weight: 500; transition: all var(--transition);
}
.admin-sidebar a:hover,
.admin-sidebar a.active { background: var(--blue-800); color: var(--white); }
.admin-sidebar a i { width: 18px; text-align: center; }
.admin-main { padding: 2rem; background: var(--gray-100); }
.admin-card { background: var(--white); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius-md); padding: 1.25rem; box-shadow: var(--shadow-sm); border-left: 4px solid var(--blue-500); }
.stat-card .num  { font-size: 2rem; font-weight: 800; color: var(--blue-900); }
.stat-card .label{ font-size: .82rem; color: var(--gray-500); margin-top: .15rem; }

/* Data tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { background: var(--blue-900); color: var(--white); padding: .65rem 1rem; text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.data-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-300); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--blue-50); }
.table-wrap { overflow-x: auto; }

/* --- Dashboard (contractor) -------------------------------- */
.dash-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: start; padding: 2rem 0; }
.dash-sidebar { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.dash-sidebar a {
    display: flex; align-items: center; gap: .6rem;
    padding: .8rem 1.25rem; color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100); font-size: .9rem; font-weight: 500;
    transition: all var(--transition);
}
.dash-sidebar a:last-child { border-bottom: none; }
.dash-sidebar a:hover,
.dash-sidebar a.active { background: var(--blue-50); color: var(--blue-700); }
.dash-sidebar a i { width: 16px; text-align: center; color: var(--blue-500); }

/* --- Listing detail page ----------------------------------- */
.listing-detail-header {
    background: var(--blue-900); color: var(--white); padding: 2.5rem 0;
}
.listing-detail-header-inner { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.listing-detail-logo {
    width: 110px; height: 110px; border-radius: var(--radius-md);
    border: 3px solid rgba(255,255,255,.25); background: var(--white);
    flex-shrink: 0; overflow: hidden; display: flex; align-items: center;
    justify-content: center; font-size: 2.5rem; color: var(--blue-600);
}
.listing-detail-logo img { width: 100%; height: 100%; object-fit: cover; }
.listing-detail-info h1 { color: var(--white); font-size: 1.8rem; margin-bottom: .3rem; }
.listing-detail-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; color: var(--blue-100); margin-top: .5rem; }
.listing-detail-meta i { color: var(--blue-400); margin-right: .2rem; }
.listing-contact-box { background: var(--white); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-md); }
.listing-contact-box .phone-link { font-size: 1.4rem; font-weight: 700; color: var(--blue-700); display: block; margin-bottom: .75rem; }

/* --- Tabs -------------------------------------------------- */
.tabs { display: flex; border-bottom: 2px solid var(--gray-300); margin-bottom: 1.5rem; gap: .25rem; }
.tab-btn { background: none; border: none; padding: .65rem 1.25rem; font-size: .93rem; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.tab-btn.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- How it works ------------------------------------------ */
.hiw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.hiw-step { text-align: center; padding: 1.5rem; }
.hiw-icon { width: 64px; height: 64px; background: var(--blue-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; color: var(--blue-700); }
.hiw-step h3 { font-size: 1rem; color: var(--blue-900); margin-bottom: .4rem; }
.hiw-step p  { font-size: .88rem; color: var(--gray-500); }

/* --- Utility ----------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: var(--gray-500); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.divider { border: none; border-top: 1px solid var(--gray-300); margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }
.empty-state i { font-size: 2.5rem; color: var(--gray-300); display: block; margin-bottom: 1rem; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
    .hamburger { display: flex; }
    .main-nav {
        display: none; flex-direction: column; align-items: flex-start;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--blue-900); padding: 1rem 1.25rem 1.5rem;
        gap: .75rem; box-shadow: var(--shadow-md); z-index: 999;
    }
    .main-nav.open { display: flex; }
    .site-header { position: relative; }

    .hero { padding: 3rem 0 2rem; }
    .hero-search-row { flex-direction: column; }
    .hero-stats { gap: 1.5rem; }

    .listing-grid { grid-template-columns: 1fr; }
    .cat-grid     { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .form-row     { grid-template-columns: 1fr; }

    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }

    .dash-layout { grid-template-columns: 1fr; }

    .listing-detail-header-inner { flex-direction: column; }
    .trust-bar-inner { gap: 1.25rem; }
}
