/* =============================================================
   HorseSales.ie — Main Stylesheet
   Color: #3a7a6e (dark teal-green), #5a9e90 (mid), #e8f4f2 (light bg)
   ============================================================= */

:root {
  --green:      #3a7a6e;
  --green-dark: #2d6259;
  --green-mid:  #5a9e90;
  --green-light:#e8f4f2;
  --accent:     #f0a500;
  --text:       #1a1a1a;
  --muted:      #6c757d;
  --border:     #dee2e6;
  --white:      #ffffff;
  --danger:     #dc3545;
  --success:    #198754;
  --warn:       #fd7e14;
  --radius:     10px;
  --shadow:     0 2px 16px rgba(58,122,110,.10);
  --shadow-lg:  0 6px 32px rgba(58,122,110,.18);
  --font:       'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #f8faf9;
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.25; color: var(--green-dark); }
h1 { font-size: clamp(1.6rem,4vw,2.4rem); }
h2 { font-size: clamp(1.3rem,3vw,1.9rem); }
h3 { font-size: 1.2rem; }
p  { margin-bottom: .8rem; }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section    { padding: 60px 0; }
.section-sm { padding: 32px 0; }
.row        { display: flex; flex-wrap: wrap; gap: 24px; }
.col-2      { flex: 0 0 calc(50% - 12px); }
.col-3      { flex: 0 0 calc(33.333% - 16px); }
.col-4      { flex: 0 0 calc(25% - 18px); }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 1000;
}
.navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 68px; padding: 0 16px;
  max-width: 1200px; margin: 0 auto;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800;
  color: var(--green); text-decoration: none;
}
.navbar-brand img { height: 44px; width: auto; }
.navbar-brand span { color: var(--green-dark); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 6px;
  font-size: .9rem; font-weight: 600;
  color: var(--text); transition: all .2s;
}
.nav-links a:hover { background: var(--green-light); color: var(--green); text-decoration: none; }
.nav-links a.btn-nav {
  background: var(--green); color: #fff;
  padding: 8px 18px;
}
.nav-links a.btn-nav:hover { background: var(--green-dark); }
.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--green); margin: 5px 0; border-radius: 2px;
  transition: all .3s;
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 60%, #7bbfb0 100%);
  color: #fff; text-align: center;
  padding: 80px 16px 70px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 { color: #fff; font-size: clamp(2rem,5vw,3rem); margin-bottom: 12px; position:relative; }
.hero p  { font-size: 1.1rem; opacity: .9; max-width: 560px; margin: 0 auto 28px; position:relative; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position:relative; }
.hero-search {
  max-width: 660px; margin: 0 auto 30px;
  display: flex; gap: 0; position:relative;
}
.hero-search input {
  flex: 1; padding: 14px 18px; border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem; outline: none;
}
.hero-search button {
  background: var(--accent); color: #fff; border: none;
  padding: 14px 24px; cursor: pointer; font-weight: 700;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1rem; transition: background .2s;
}
.hero-search button:hover { background: #d4900a; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--radius);
  font-weight: 700; font-size: .9rem;
  cursor: pointer; border: 2px solid transparent;
  transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-outline   { border-color: #fff; color: #fff; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover  { background: #d4900a; }
.btn-sm        { padding: 7px 14px; font-size: .82rem; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-warn      { background: var(--warn); color: #fff; }
.btn-ghost     { background: var(--green-light); color: var(--green); border-color: var(--green); }

/* ---- SCAM WARNING BANNER ---- */
.scam-banner {
  background: #fff3cd; border-left: 4px solid var(--accent);
  padding: 10px 16px; font-size: .85rem; color: #5a4000;
  display: flex; align-items: center; gap: 8px;
}
.scam-banner strong { color: #c87000; }

/* ---- CATEGORY CARDS ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.cat-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px; text-align: center;
  transition: all .2s; cursor: pointer;
  text-decoration: none; color: var(--text);
}
.cat-card:hover {
  border-color: var(--green); background: var(--green-light);
  transform: translateY(-2px); box-shadow: var(--shadow);
  text-decoration: none; color: var(--green-dark);
}
.cat-card .cat-icon { font-size: 2rem; margin-bottom: 8px; }
.cat-card .cat-name { font-weight: 700; font-size: .9rem; }
.cat-card .cat-count { font-size: .78rem; color: var(--muted); }

/* ---- LISTING CARDS ---- */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.listing-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; transition: all .25s;
  display: flex; flex-direction: column;
  position: relative;
}
.listing-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.listing-card .card-img {
  width: 100%; height: 200px; object-fit: cover;
  background: var(--green-light);
}
.listing-card .card-img-placeholder {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, var(--green-light), #c8e6e2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--green);
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-category {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  color: var(--green); letter-spacing: .5px; margin-bottom: 6px;
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--green); text-decoration: none; }
.card-meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.card-meta span { margin-right: 12px; }
.card-price {
  font-size: 1.15rem; font-weight: 800; color: var(--green-dark);
  margin-top: auto; padding-top: 10px;
}
.badge-sold { position: absolute; top: 12px; left: 12px; background: var(--danger); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-new  { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; font-family: var(--font);
  background: var(--white); color: var(--text);
  transition: border-color .2s;
}
.form-control:focus {
  border-color: var(--green); outline: none;
  box-shadow: 0 0 0 3px rgba(58,122,110,.12);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.form-check input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--green); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-error { font-size: .82rem; color: var(--danger); margin-top: 4px; }

/* ---- CARD/PANEL ---- */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.card-header {
  border-bottom: 2px solid var(--green-light);
  padding-bottom: 16px; margin-bottom: 20px;
}

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: .92rem;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #7f1d1d; border-left: 4px solid var(--danger); }
.alert-warn    { background: #fff3cd; color: #5a4000; border-left: 4px solid var(--accent); }
.alert-info    { background: var(--green-light); color: var(--green-dark); border-left: 4px solid var(--green); }

/* ---- LISTING DETAIL ---- */
.listing-gallery { display: grid; grid-template-columns: 1fr; gap: 8px; }
.gallery-main img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 80px; height: 60px; object-fit: cover;
  border-radius: 6px; cursor: pointer; border: 2px solid transparent;
  transition: border-color .2s;
}
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--green); }

.contact-reveal-box {
  background: var(--green-light); border: 2px solid var(--green);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.contact-reveal-box h4 { color: var(--green-dark); margin-bottom: 14px; }
.reveal-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.revealed-info {
  background: #fff; border: 2px solid var(--green);
  border-radius: var(--radius); padding: 14px 20px;
  margin-top: 12px; font-size: 1.1rem; font-weight: 700;
  color: var(--green-dark); text-align: center;
}
.countdown { font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* ---- IMAGE UPLOAD ---- */
.upload-zone {
  border: 2px dashed var(--green);
  border-radius: var(--radius); padding: 32px;
  text-align: center; cursor: pointer;
  transition: all .2s; background: var(--green-light);
}
.upload-zone:hover, .upload-zone.drag-over {
  background: #c8e6e2; border-color: var(--green-dark);
}
.upload-zone input { display: none; }
.upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.upload-previews .preview-item {
  position: relative; width: 90px; height: 70px;
}
.upload-previews img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
}
.upload-previews .remove-img {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff; border: none;
  border-radius: 50%; width: 20px; height: 20px;
  cursor: pointer; font-size: .7rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--green-dark); color: rgba(255,255,255,.85);
  padding: 50px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px; margin-bottom: 36px;
}
.footer h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
.footer a { color: rgba(255,255,255,.75); font-size: .9rem; display: block; margin-bottom: 6px; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 20px; text-align: center;
  font-size: .82rem; color: rgba(255,255,255,.6);
}
.footer-logo { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.social-links { display: flex; gap: 10px; margin-top: 14px; }
.social-links a {
  width: 36px; height: 36px; background: rgba(255,255,255,.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}
.social-links a:hover { background: rgba(255,255,255,.3); }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  width: 40px; height: 40px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 600; font-size: .9rem;
  border: 2px solid var(--border); color: var(--text);
  text-decoration: none; transition: all .2s;
}
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }

/* ---- ADMIN PANEL ---- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--green-dark); color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .sidebar-brand {
  padding: 22px 20px; font-size: 1.1rem; font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: rgba(255,255,255,.8);
  font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent; transition: all .2s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(255,255,255,.1); color: #fff;
  border-left-color: var(--accent); text-decoration: none;
}
.admin-main { flex: 1; padding: 28px; overflow-x: hidden; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border-left: 4px solid var(--green);
}
.stat-card .val { font-size: 2rem; font-weight: 800; color: var(--green-dark); }
.stat-card .lbl { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: var(--green-light); color: var(--green-dark); font-weight: 700; white-space: nowrap; }
tr:hover td { background: #f8faf9; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.badge-pending  { background: #fff3cd; color: #7a5000; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-disabled { background: #f3f4f6; color: #555; }
.badge-sold     { background: #fee2e2; color: #7f1d1d; }
.badge-edit_requested { background: #dbeafe; color: #1e3a8a; }

/* ---- USER PANEL ---- */
.user-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.user-sidebar {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  position: sticky; top: 90px;
}
.user-sidebar .user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; margin: 0 auto 12px;
}
.user-sidebar .user-name { text-align: center; font-weight: 700; margin-bottom: 20px; }
.user-sidebar nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 7px;
  color: var(--text); font-size: .9rem;
  margin-bottom: 4px; transition: all .2s;
}
.user-sidebar nav a:hover, .user-sidebar nav a.active {
  background: var(--green-light); color: var(--green); text-decoration: none;
}

/* ---- SEARCH FILTERS ---- */
.filter-bar {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  margin-bottom: 24px;
}
.filter-bar form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar .form-group { margin: 0; flex: 1; min-width: 140px; }
.filter-bar label { font-size: .82rem; margin-bottom: 4px; }
.filter-bar .form-control { padding: 8px 12px; font-size: .88rem; }

/* ---- STEPS (listing wizard) ---- */
.steps { display: flex; justify-content: center; gap: 0; margin-bottom: 28px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 30px;
  font-weight: 600; font-size: .88rem; color: var(--muted);
  background: var(--green-light); margin: 4px;
}
.step.active { background: var(--green); color: #fff; }
.step.done   { background: var(--success); color: #fff; }

/* ---- MISC ---- */
.divider { border: none; border-top: 2px solid var(--green-light); margin: 28px 0; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-green  { color: var(--green); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .gap-2 { gap: 16px; } .flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
  .col-3, .col-4 { flex: 0 0 calc(50% - 12px); }
  .user-layout { grid-template-columns: 1fr; }
  .user-sidebar { position: static; }
  .admin-sidebar { display: none; }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--white); box-shadow: 0 8px 20px rgba(0,0,0,.12); padding: 16px; z-index: 999; }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: 8px; padding: 10px 14px; }
  .hamburger { display: flex; flex-direction: column; }
  .col-2, .col-3, .col-4 { flex: 0 0 100%; }
  .hero { padding: 50px 16px 44px; }
  .section { padding: 36px 0; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .admin-layout { flex-direction: column; }
  .admin-main { padding: 16px; }
}
@media (max-width: 480px) {
  .listings-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-search { flex-direction: column; }
  .hero-search input { border-radius: var(--radius); }
  .hero-search button { border-radius: var(--radius); }
}

/* ---- PRINT ---- */
@media print {
  .navbar, .footer, .btn, .scam-banner { display: none; }
}

/* ---- SCHEMA.ORG HIDDEN ---- */
[itemscope] { display: contents; }
