/* DepozitulOnline.ro — hand-written CSS, no build pipeline required (spec section 24).
   Design tokens exposed as CSS custom properties so the admin "Design" screen can
   override them (logo/colors/fonts) without touching this file or redeploying code. */
:root {
  --color-primary: #2d5d9a;
  --color-primary-dark: #224674;
  --color-secondary: #f5a623;
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #1c2530;
  --color-text-muted: #5b6572;
  --color-border: #e2e6ea;
  --color-danger: #d9453a;
  --color-success: #1c9a5b;
  --font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 24, 30, .08);
  --container-w: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20; }
.site-header .bar { display: flex; align-items: center; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.4rem; color: var(--color-primary); }
.search-form { flex: 1; display: flex; min-width: 220px; }
.search-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius) 0 0 var(--radius); font-size: .95rem; }
.search-form button { padding: 10px 16px; background: var(--color-primary); color: #fff; border: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.btn { display: inline-block; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; font-size: .92rem; }
.btn:hover { text-decoration: none; border-color: var(--color-primary); }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }

/* Sections */
.section { padding: 28px 0; }
.section h2 { font-size: 1.35rem; margin: 0 0 16px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-premium { background: var(--color-secondary); color: #4a2e00; }
.badge-status-active { background: #dff5e8; color: var(--color-success); }
.badge-status-pending_approval, .badge-status-pending_payment { background: #fff3d6; color: #93650a; }
.badge-status-rejected, .badge-status-suspended { background: #fde3e1; color: var(--color-danger); }
.badge-status-expired { background: #e9eaec; color: var(--color-text-muted); }

/* Category chips */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.category-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; text-align: center; }
.category-card:hover { border-color: var(--color-primary); text-decoration: none; }

/* Listing detail page */
.fav-heart {
  position: absolute; top: 10px; right: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #aab1b9;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; line-height: 1; text-decoration: none; box-shadow: var(--shadow);
}
.fav-heart:hover { text-decoration: none; }
.fav-heart.active { color: var(--color-danger); }

/* Listing cards */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.listing-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.listing-card img { height: 160px; object-fit: cover; width: 100%; background: #eee; }
.listing-card .body { padding: 10px 12px; }
.listing-card .price { font-weight: 700; font-size: 1.1rem; }
.listing-card .title { font-size: .92rem; margin: 4px 0; color: var(--color-text); }
.listing-card .meta { font-size: .78rem; color: var(--color-text-muted); }
.listing-card .badge-premium { position: absolute; top: 8px; left: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: .95rem; background: #fff; color: var(--color-text);
}
textarea { min-height: 120px; }
.form-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; max-width: 560px; margin: 0 auto; }
.error-text { color: var(--color-danger); font-size: .82rem; margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-success { background: #dff5e8; color: var(--color-success); }
.alert-warning { background: #fff3d6; color: #93650a; }
.alert-danger { background: #fde3e1; color: var(--color-danger); }

/* Footer */
.site-footer { background: #14212c; color: #c9d2da; margin-top: 40px; padding: 32px 0; font-size: .88rem; }
.site-footer a { color: #fff; }

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: #14212c; color: #c9d2da; flex-shrink: 0; }
.admin-sidebar a { color: #c9d2da; display: block; padding: 10px 18px; font-size: .9rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.admin-main { flex: 1; padding: 24px; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; font-size: .88rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; }
.stat-card .num { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { font-size: .8rem; color: var(--color-text-muted); }

.categories-toggle { display: none; }

@media (max-width: 720px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .hero-search { display: none; }
  .section { padding: 12px 0; }
.header-actions { gap: 6px; flex-wrap: nowrap; width: 100%; }
  .header-actions > .btn, .header-actions > form { flex: 1 1 0; min-width: 0; }
  .header-actions .btn { width: 100%; padding: 7px 4px; font-size: .7rem; white-space: nowrap; text-align: center; }
  .page-top-section { padding-top: 4px; }
  .page-top-section h1 { margin-top: 0; }

  .categories-section { padding-top: 8px; padding-bottom: 8px; }
  .categories-section + section { padding-top: 8px; }
  .categories-heading { display: none; }
  .categories-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .categories-toggle .caret { transition: transform .2s ease; }
  .categories-section.open .categories-toggle .caret { transform: rotate(180deg); }
  .categories-section .category-grid { display: none; margin-top: 10px; }
  .categories-section.open .category-grid { display: grid; }

  .listing-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .listing-card img { height: 120px; }
  .listing-card .body { padding: 8px 10px; }
  .listing-card .price { font-size: 1rem; }
  .listing-card .title { font-size: .85rem; margin: 3px 0; line-height: 1.3; }
  .listing-card .meta { font-size: .72rem; }
}
