/* style.css - Clean, Modern, Mobile-First Styling with Dark Mode & RTL Support */
:root {
  --primary: #e63946;
  --primary-hover: #d62828;
  --primary-glow: rgba(230, 57, 70, 0.25);
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #21262d;
  --border-color: #30363d;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --accent: #f77f00;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f5;
  --border-color: #e9ecef;
  --text-main: #212529;
  --text-muted: #6c757d;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-selector select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

/* HERO SECTION */
.hero {
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(230, 57, 70, 0.08) 0%, transparent 100%);
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(230, 57, 70, 0.15);
  color: var(--primary);
  border: 1px solid rgba(230, 57, 70, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* SEARCH & FILTER CONTROLS */
.controls-container {
  max-width: 1280px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}

.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

.search-bar input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-btn.active, .cat-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sort-wrapper select {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

/* MOTOR GRID & CARDS */
.catalog-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  flex: 1;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.motor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.motor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.motor-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  background: #000;
  overflow: hidden;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.motor-card:hover .card-img-wrap img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

[dir="rtl"] .card-badge {
  left: auto;
  right: 12px;
}

.card-year {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

[dir="rtl"] .card-year {
  right: auto;
  left: 12px;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-specs-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.spec-item span {
  color: var(--text-muted);
  display: block;
  font-size: 0.75rem;
}

.btn-detail {
  display: block;
  text-align: center;
  background: var(--primary);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-detail:hover {
  background: var(--primary-hover);
}

/* ADSENSE CONTAINERS */
.ad-slot {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.ad-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* DETAIL PAGE SPECIFIC */
.detail-container {
  max-width: 1080px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.back-btn-wrap {
  margin-bottom: 1.5rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--primary);
}

.detail-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}

.detail-image-box {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: #000;
}

.detail-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header-content {
  padding: 2rem;
}

.detail-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-header-content h1 {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.detail-summary {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.history-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
}

.history-text p {
  margin-bottom: 1.25rem;
}

.specs-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-color);
}

.specs-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 45%;
}

[dir="rtl"] .specs-table th {
  text-align: right;
}

.specs-table td {
  padding: 0.75rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

/* FOOTER */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul li a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* CONSENT BANNER & MODAL */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(22, 27, 34, 0.98);
  border-top: 2px solid var(--primary);
  padding: 1.25rem 1.5rem;
  z-index: 9999;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.consent-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.consent-text {
  flex: 1;
  min-width: 280px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-main);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.consent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.consent-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
}

.cookie-options {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cookie-option input {
  margin-top: 0.2rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
