/* ============================================
   Japan Car World - Unified Styles
   Japanese Design Aesthetics
   ============================================ */

/* --- CSS VARIABLES --- */

:root {
  /* Background colors - Japanese indigo-ai (藍色) theme */
  --bg: #0F1A2A;                /* Main background - Deep indigo-ai */
  --bg-elevated: #182637;       /* Elevated surfaces - Night blue */
  --bg-header: #0F1A2A;         /* Header background */
  --bg-section: #223447;        /* Large section backgrounds */

  /* Text colors */
  --text-main: #D8E1EC;         /* Main text on dark backgrounds */
  --text-main-light: #111111;   /* Main text on light backgrounds */
  --text-secondary: #A9B4C1;    /* Secondary text - Cold grey */
  --text-muted: #8C97A4;        /* Muted text */
  --text-heading: #F2F6FA;      /* Headings - Near white */

  /* Accent colors - Japanese palette */
  --accent-red: #D72631;        /* Japanese aka (赤) - Primary accent */
  --accent-red-hover: #F54749;  /* Red hover state */
  --accent-sakura: #F9C6D3;     /* Sakura pink - Soft highlights */
  --accent-sunrise: #FFB38A;    /* Peach-orange sunrise */
  --accent-blue: #4DA3FF;       /* Cool blue - Links and tech accents */
  --accent-blue-hover: #1E6BD6; /* Blue hover state */

  /* UI state colors */
  --success: #3CCB87;
  --warning: #FFB38A;
  --error: #D72631;
  --info: #4DA3FF;

  /* Borders and dividers */
  --border-dark: #1F2C3A;       /* Borders on dark backgrounds */
  --border-light: #E5E8EB;      /* Borders on light backgrounds */
  --border-subtle: #1F262D;

  /* Shadows */
  --shadow-soft: 0 18px 55px rgba(0, 0, 0, 0.28);
  --shadow-red: 0 0 18px rgba(215, 38, 49, 0.45);

  /* Border radius */
  --radius-lg: 18px;
  --radius-xl: 26px;

  /* Transitions */
  --transition-fast: 160ms ease-out;
  --transition-slow: 420ms ease-out;
}

/* --- RESET & BASE --- */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0F1A2A 0%, #1B2E44 35%, #223447 100%);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  margin-top: 64px;
}

/* --- NAVIGATION --- */

.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(10, 13, 16, 0.94),
    rgba(10, 13, 16, 0.82),
    transparent
  );
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--accent-red) 40%, var(--bg-header) 100%);
  box-shadow: var(--shadow-red);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  border: 1px solid rgba(15, 26, 42, 0.45);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.8) inset;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 0.96rem;
  text-transform: uppercase;
}

.logo-sub {
  display: block;
  font-size: 0.65rem;
  opacity: 0.65;
  letter-spacing: 0.16em;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
  color: var(--text-muted);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-red-hover));
  transition: width var(--transition-slow);
  opacity: 0.8;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-chip {
  font-size: 0.7rem;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 0 0, rgba(215, 38, 49, 0.15), transparent 60%);
  color: var(--text-muted);
}

/* Breadcrumbs - now positioned below page headers */
.breadcrumbs-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  background: rgba(20, 26, 32, 0.3);
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.breadcrumbs a {
  color: var(--accent-red);
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--accent-red-hover);
}

/* --- FOOTER --- */

footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-header);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
}

/* --- ANIMATIONS --- */

.fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- COMMON ELEMENTS --- */

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-red);
  box-shadow: var(--shadow-red);
}

/* ============================================
   HOME PAGE STYLES
   ============================================ */

/* --- HERO SECTION --- */

.hero {
  margin-top: 64px;
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('../images/japancarworld-dark.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 26, 42, 0.3),
    rgba(15, 26, 42, 0.6)
  );
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 80px;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    135deg,
    rgba(20, 26, 32, 0.5),
    rgba(20, 26, 32, 0.4)
  );
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--accent-red);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-red);
  box-shadow: var(--shadow-red);
  animation: pulse-dot 2.4s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(215, 38, 49, 0.7);
  }
  60% {
    transform: scale(1.15);
    box-shadow: 0 0 22px rgba(215, 38, 49, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(215, 38, 49, 0.7);
  }
}

.hero-title {
  font-size: clamp(2.5rem, 4vw + 1.5rem, 4rem);
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  line-height: 1.2;
  text-align: center;
}

.hero-title span {
  background: linear-gradient(120deg, var(--text-heading), var(--accent-sunrise));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  max-width: 100%;
  color: var(--text-main);
  margin-bottom: 30px;
  line-height: 1.6;
  text-align: center;
}

.hero-subtitle-strong {
  color: var(--accent-red);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
  justify-content: center;
}

.btn-primary {
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-hover) 100%);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 14px 45px rgba(215, 38, 49, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 55px rgba(215, 38, 49, 0.6);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card {
  padding: 0;
  text-align: center;
}

.stat-label {
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.stat-value {
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent-sunrise);
  line-height: 1;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  justify-content: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

/* --- HOME BRANDS SECTION --- */

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 25rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-red);
  box-shadow: var(--shadow-red);
}

/* --- HOME CONTENT SECTION --- */

.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.content-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--text-heading);
  position: relative;
  padding-bottom: 16px;
}

.content-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red), transparent);
}

.content-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content-text p {
  margin-bottom: 16px;
}

.content-text p:last-child {
  margin-bottom: 0;
}

.content-text strong {
  color: var(--accent-red);
  font-weight: 600;
}

/* ============================================
   INNER PAGES STYLES
   ============================================ */

/* --- PAGE HEADER (Brands List, Brand Detail, Model Detail) --- */

.page-header {
  position: relative;
  padding: 80px 20px 60px;
  text-align: center;
  background-image: url('../images/japancarworld-dark.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 26, 42, 0.75),
    rgba(15, 26, 42, 0.85)
  );
  z-index: 1;
}

.page-header > * {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-title {
  font-size: clamp(2rem, 3vw + 1rem, 2.8rem);
  margin-bottom: 16px;
  background: linear-gradient(120deg, var(--text-heading), var(--accent-sunrise));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* --- BRANDS LIST PAGE --- */

.brands-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.brands-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.brands-grid .brand-card {
  background: radial-gradient(circle at 0 0, rgba(215, 38, 49, 0.12), transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(255, 179, 138, 0.1), transparent 65%),
    var(--bg-elevated);
  padding: 24px;
  width: 340px;
  max-width: 100%;
  flex-shrink: 0;
}

.brands-grid .brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
}

.brands-grid .brand-card .brand-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.brands-grid .brand-card .brand-rank {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(215, 38, 49, 0.15);
  border: 1px solid rgba(215, 38, 49, 0.4);
  color: var(--accent-red);
  font-weight: 600;
}

.brands-grid .brand-card .brand-year {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brands-grid .brand-card .brand-name-main {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.brands-grid .brand-card .brand-name-rus {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.brands-grid .brand-card .brand-short-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.brands-grid .brand-card .brand-body-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.brands-grid .brand-card .body-type-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.brands-grid .brand-card .brand-price {
  font-size: 0.8rem;
  color: var(--accent-red);
  font-weight: 500;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- BRAND & MODEL DETAIL HEADER --- */

.brand-header,
.model-header {
  position: relative;
  padding: 80px 20px 60px;
  background-image: url('../images/japancarworld-dark.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.brand-header::before,
.model-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 26, 42, 0.75),
    rgba(15, 26, 42, 0.85)
  );
  z-index: 1;
}

.brand-header-content,
.model-header-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.brand-rank-badge,
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(215, 38, 49, 0.2);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.brand-title,
.model-title {
  font-size: clamp(2.5rem, 4vw + 1rem, 3.5rem);
  margin-bottom: 12px;
  background: linear-gradient(120deg, var(--text-heading), var(--accent-sunrise));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle,
.model-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.brand-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
}

.brand-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

/* --- CONTENT SECTIONS --- */

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.content .section {
  margin-bottom: 50px;
}

.content .section-title {
  font-size: 1.6rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.section-content p {
  margin-bottom: 16px;
}

.section-content strong {
  color: var(--text-main);
  font-weight: 600;
}

/* --- INFO CARDS --- */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.info-card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.info-card-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* --- MODELS LIST --- */

.models-list {
  display: grid;
  gap: 12px;
}

.model-item {
  background: rgba(20, 26, 32, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.model-item:hover {
  border-color: var(--accent-red);
  background: rgba(20, 26, 32, 0.6);
}

a.model-item {
  cursor: pointer;
}

a.model-item:hover {
  border-color: var(--accent-red);
  background: rgba(20, 26, 32, 0.7);
}

.model-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.model-type {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- ENGINE CARD --- */

.engine-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
}

.engine-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.engine-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.engine-spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.engine-spec-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.engine-spec-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* --- MODIFICATIONS TABLE --- */

.modifications-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.modifications-table th,
.modifications-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.modifications-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(20, 26, 32, 0.4);
}

.modifications-table td {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modifications-table tr:hover td {
  background: rgba(20, 26, 32, 0.3);
}

/* --- TAGS --- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(215, 38, 49, 0.15);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  /* Hero section */
  .hero {
    min-height: auto;
    padding: 60px 20px;
  }

  .hero-copy {
    padding: 40px 30px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-header,
  .brand-header,
  .model-header {
    padding: 60px 20px 40px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .modifications-table {
    font-size: 0.85rem;
  }

  .modifications-table th,
  .modifications-table td {
    padding: 10px 12px;
  }
}
