/* Perasway B2B - Enterprise UI (Tek stil dosyası) */

:root {
  /* Background & surfaces */
  --bg: #0b1324;
  --panel: rgba(15, 27, 49, 0.84);
  --panel-2: rgba(18, 32, 56, 0.68);
  --card: rgba(15, 27, 49, 0.78);
  --card-2: rgba(18, 32, 56, 0.55);

  /* Borders & text */
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: rgba(148, 163, 184, 0.78);
  --muted-3: rgba(148, 163, 184, 0.62);

  /* Brand colors */
  --blue: #2f6fe6;
  --blue-2: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.16);

  /* Status */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.16);

  /* Shadows (soft, controlled) */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-deep: 0 16px 52px rgba(0, 0, 0, 0.42);

  /* Radii */
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  /* Detail background (dark) */
  --detail-page-bg-1: rgba(11, 19, 36, 0.98);
  --detail-page-bg-2: rgba(7, 12, 24, 0.98);

  /* Detail surfaces (dark) */
  --detail-surface-subtle: rgba(2, 6, 23, 0.14);
  --detail-surface-subtle-2: rgba(2, 6, 23, 0.10);
  --detail-border-subtle: rgba(148, 163, 184, 0.14);
  --detail-image-wrap-bg: rgba(2, 6, 23, 0.18);
  --detail-image-wrap-border: rgba(148, 163, 184, 0.14);
  --detail-flag-bg: rgba(255, 255, 255, 0.06);
  --detail-flag-border: rgba(148, 163, 184, 0.16);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", "Noto Naskh Arabic",
    "Arial Unicode MS", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  background: rgba(8, 17, 32, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: none;
}

header .container {
  padding-top: 12px;
  padding-bottom: 12px;
}

main {
  padding-top: 10px;
}

footer {
  background: transparent;
  color: var(--muted);
  padding: 24px 16px;
}

/* Nav */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.16);
}

/* Base form elements */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  background: rgba(2, 6, 23, 0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

/* Buttons (single system) */
.btn-primary,
.btn-muted,
.detail-btn-primary,
.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-primary,
.detail-btn-primary {
  background: linear-gradient(180deg, rgba(47, 111, 230, 0.96), rgba(47, 111, 230, 0.78));
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 12px 28px rgba(47, 111, 230, 0.18);
  color: #ffffff;
}

.btn-primary:hover,
.detail-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(47, 111, 230, 0.25);
}

.btn-primary:active,
.detail-btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible,
.detail-btn-primary:focus-visible,
.btn-muted:focus-visible,
.detail-btn:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

.btn-muted,
.detail-btn {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.btn-muted:hover,
.detail-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
  transform: translateY(-1px);
}

.btn-muted:active,
.detail-btn:active {
  transform: translateY(0);
}

/* Cards / surfaces */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* Existing classes (compatibility for other pages) */
.hero {
  padding: 10px 0 18px;
}

.filters {
  margin-bottom: 18px;
}

.listing-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  gap: 12px;
}

.listing-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.badge-type {
  background: rgba(148, 163, 184, 0.10);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.listing-title {
  color: var(--blue-2);
  text-decoration: none;
  font-weight: 900;
}

.listing-title:hover {
  text-decoration: underline;
}

.listing-meta {
  display: flex;
  gap: 14px;
  color: var(--muted-2);
  font-size: 13px;
  flex-wrap: wrap;
}

.listing-qty {
  display: flex;
  align-items: center;
}

.qty {
  font-weight: 900;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 10px 12px;
  border-radius: 14px;
}

.auth-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.12);
}

.auth-form button {
  margin-top: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.alert-success {
  background: rgba(34, 197, 94, 0.13);
  color: #bbf7d0;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

/* ===== Home (Ana Sayfa) ===== */
.home-hero {
  padding: 18px 0 20px;
}

.home-hero h1 {
  margin: 0 0 10px;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.home-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.home-market {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.filters-card {
  padding: 18px;
}

.filters-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted-2);
  margin-bottom: 8px;
}

.field input, .field select {
  width: 100%;
}

.home-right {
  padding: 18px;
}

.home-right-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-inline {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-inline input {
  flex: 1;
  min-width: 220px;
}

.search-inline select {
  width: 190px;
}

.market-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.market-column {
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.10);
  border-radius: 16px;
  padding: 14px;
}

.market-column h4 {
  margin: 0 0 12px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.market-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.pill-buy {
  background: rgba(47, 111, 230, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.pill-sell {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 12px;
  background: rgba(15, 27, 49, 0.56);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 27, 49, 0.70);
}

.listing-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.listing-card-title {
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-top: 4px;
}

.listing-card-title:hover {
  text-decoration: underline;
}

.listing-card-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-size: 13px;
}

.listing-card-qty {
  font-weight: 900;
  color: var(--text);
  text-align: right;
}

/* Unit label used in home cards (index.php) */
.unit-name {
  display: inline-block;
  margin-left: 6px;
  font-weight: 900;
  color: var(--muted);
  font-size: 12px;
}

.muted-text {
  color: var(--muted);
  margin: 0;
}

.mt-6 {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .home-market {
    grid-template-columns: 1fr;
  }

  .market-columns {
    grid-template-columns: 1fr;
  }
}

/* ===== Listing Detail (show.php) ===== */
.detail-page {
  background: linear-gradient(180deg, var(--detail-page-bg-1), var(--detail-page-bg-2));
  color: var(--text);
  min-height: 100vh;
  padding: 26px 0 44px;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.detail-subtitle {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.18px;
  font-size: 13px;
  margin-bottom: 10px;
}

.detail-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.detail-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.detail-pill {
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  text-decoration: none;
}

.detail-pill-ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

.detail-pill-premium {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.95), rgba(217, 119, 6, 0.78));
  border-color: rgba(217, 119, 6, 0.45);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.18);
}

.detail-pill-restricted {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.16);
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 310px 1fr 320px;
  gap: 18px;
  align-items: start;
}

.detail-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.30);
}

.detail-panel-inner {
  padding: 18px;
}

.detail-panel-h {
  font-weight: 900;
  color: var(--text);
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.detail-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row-title {
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 3px;
}

.detail-row-subtitle {
  color: var(--muted-2);
  font-weight: 800;
  font-size: 13px;
}

.detail-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 34px;
  border-radius: 12px;
  background: var(--detail-flag-bg);
  border: 1px solid var(--detail-flag-border);
  color: var(--text);
  font-weight: 900;
}

.detail-fav {
  margin-top: 10px;
}

.detail-mini-verify {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--detail-surface-subtle);
  border: 1px solid var(--detail-border-subtle);
}

.detail-mini-verify-top {
  font-weight: 900;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.20px;
  margin-bottom: 8px;
}

.detail-mini-verify-status {
  font-weight: 900;
  color: #bbf7d0;
}

.detail-mini-verify-status.bad {
  color: rgba(217, 119, 6, 0.95);
}

.detail-center .detail-panel-inner {
  padding: 16px;
}

.detail-image-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: var(--detail-image-wrap-bg);
  border: 1px solid var(--detail-image-wrap-border);
}

.detail-image {
  width: 100%;
  height: 290px;
  display: block;
  object-fit: contain;
  padding: 14px;
  opacity: 0.92;
}

.detail-content {
  padding-top: 14px;
}

.detail-section-title {
  margin: 0 0 8px;
  font-weight: 900;
  font-size: 18px;
  color: var(--text);
}

.detail-description {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.detail-features {
  margin: 0 0 18px 18px;
  color: var(--muted);
}

.detail-features li {
  margin-bottom: 10px;
  font-weight: 750;
  line-height: 1.55;
}

.detail-contact-block {
  padding: 14px;
  border-radius: 14px;
  background: var(--detail-surface-subtle);
  border: 1px solid var(--detail-border-subtle);
}

.detail-muted {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.detail-btn-primary {
  width: 100%;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.95), rgba(217, 119, 6, 0.78));
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 16px 34px rgba(217, 119, 6, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

.detail-btn {
  width: 100%;
}

.detail-contact-block .btn-primary {
  width: 100%;
}

.detail-right-title {
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 15px;
}

.detail-right-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-weight: 900;
}

.detail-right-item:last-of-type {
  border-bottom: 0;
}

.detail-check {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: var(--success-soft);
  border: 1px solid rgba(34, 197, 94, 0.26);
  color: #bbf7d0;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.detail-check-off {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(148, 163, 184, 0.95);
}

.detail-right-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.meta-key {
  color: var(--muted-2);
  font-weight: 800;
}

.meta-val {
  color: var(--text);
  font-weight: 900;
}

.detail-right-actions {
  margin-top: 14px;
}

.detail-btn-primary.full,
.detail-btn.full {
  width: 100%;
}

.full {
  width: 100%;
}

@media (max-width: 1100px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-image {
    height: 240px;
  }
}

/* ===== Global / i18n ===== */
html[lang^="ar"] {
  direction: rtl;
}

html[lang^="ar"] .detail-features {
  margin-left: 0;
  margin-right: 18px;
}

html[lang^="ar"] .listing-card-qty {
  text-align: left;
}

/* ===== Light theme (enterprise white UI) - manual toggle ===== */
html[data-theme="light"] {
    --bg: #f5f7fb;
    --panel: rgba(255, 255, 255, 0.95);
    --panel-2: rgba(255, 255, 255, 0.82);
    --card: rgba(255, 255, 255, 0.92);
    --card-2: rgba(255, 255, 255, 0.70);

    --text: #0b1324;
    --muted: #4b5563;
    --muted-2: rgba(75, 85, 99, 0.88);

    --border: rgba(15, 23, 42, 0.12);
    --border-strong: rgba(15, 23, 42, 0.18);

    --detail-page-bg-1: rgba(243, 246, 252, 1);
    --detail-page-bg-2: rgba(236, 241, 249, 1);

    --detail-surface-subtle: rgba(15, 23, 42, 0.04);
    --detail-surface-subtle-2: rgba(15, 23, 42, 0.03);
    --detail-border-subtle: rgba(15, 23, 42, 0.10);
    --detail-image-wrap-bg: rgba(15, 23, 42, 0.03);
    --detail-image-wrap-border: rgba(15, 23, 42, 0.10);
    --detail-flag-bg: rgba(15, 23, 42, 0.04);
    --detail-flag-border: rgba(15, 23, 42, 0.12);

  header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  }

  .market-column {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.10);
  }

  .listing-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(15, 23, 42, 0.12);
  }

  .listing-card:hover {
    background: rgba(255, 255, 255, 0.92);
  }

  .detail-pill {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text);
  }

  .detail-pill-restricted {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.10);
    color: var(--muted);
  }
}

