/* ============================================
   FKN Car Guess – Main Styles
   ============================================ */

:root {
  --fkn-red: #e63946;
  --fkn-dark: #0d1117;
  --fkn-card: #161b22;
  --fkn-border: #30363d;
  --fkn-text: #c9d1d9;
  --fkn-muted: #8b949e;
  --fkn-gold: #f0c040;
  --bottom-nav-height: 68px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--fkn-dark);
  color: var(--fkn-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  padding-bottom: calc(var(--bottom-nav-height) + 30px);
  min-height: 100vh;
}

/* ---- Top Header ---- */
.app-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid var(--fkn-border);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.app-header .navbar-brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}
.app-header .btn-outline-light {
  border-color: var(--fkn-border);
  color: var(--fkn-text);
}
.app-header .btn-outline-light:hover {
  background: var(--fkn-red);
  border-color: var(--fkn-red);
  color: #fff;
}

/* ---- Bottom Navigation Bar ---- */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--bottom-nav-height);
  background: #161b22;
  border-top: 2px solid var(--fkn-border);
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: center !important;
  z-index: 9999 !important;
  padding: 4px 8px;
  margin: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--fkn-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
  min-width: 50px;
  position: relative;
  flex: 0 0 auto;
  gap: 2px;
}

.bottom-nav-item .nav-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.bottom-nav-item .nav-label {
  line-height: 1;
  white-space: nowrap;
}

.bottom-nav-item.active {
  color: var(--fkn-red) !important;
}

.bottom-nav-item.active .nav-icon {
  transform: scale(1.2);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--fkn-red);
  border-radius: 0 0 4px 4px;
}

.bottom-nav-item:active .nav-icon {
  transform: scale(0.85);
}

/* ---- Cards ---- */
.card {
  background: var(--fkn-card);
  border: 1px solid var(--fkn-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(230, 57, 70, 0.15);
}
.card-img-top {
  height: 180px;
  object-fit: cover;
}
.card-title {
  font-weight: 700;
  color: #fff;
}
.card-text {
  color: var(--fkn-muted);
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--fkn-red) !important;
  border-color: var(--fkn-red) !important;
  font-weight: 600;
  border-radius: 10px;
}
.btn-primary:hover {
  background: #c1121f !important;
  border-color: #c1121f !important;
}
.btn-success {
  background: #2ecc71 !important;
  border: none !important;
  border-radius: 10px;
  font-weight: 600;
  color: #000 !important;
}
.btn-outline-light {
  border-radius: 10px;
}

/* ---- Tables ---- */
.table {
  color: var(--fkn-text);
  border-color: var(--fkn-border);
}
.table thead {
  background: var(--fkn-card);
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(255, 255, 255, 0.02);
}
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}

/* ---- Forms ---- */
.form-control,
.form-select {
  background: var(--fkn-card) !important;
  border: 1px solid var(--fkn-border) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--fkn-red) !important;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.25) !important;
}
.form-check-input:checked {
  background-color: var(--fkn-red);
  border-color: var(--fkn-red);
}

/* ---- Badges ---- */
.badge {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

/* ---- Alerts ---- */
.alert-info {
  background: #1a3a4a;
  color: #7cc8e8;
  border: 1px solid #2a5a6a;
}

/* ---- Carousel ---- */
.carousel-item img {
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
}

/* ---- PWA safe areas ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: calc(var(--bottom-nav-height) + 30px + env(safe-area-inset-bottom));
  }
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom) !important;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)) !important;
  }
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
  .card-img-top {
    height: 140px;
  }
  h1 {
    font-size: 1.4rem;
  }
  h2 {
    font-size: 1.2rem;
  }
  .carousel-item img {
    height: 200px;
  }
}

/* ---- SVG Icons in Bottom Nav ---- */
.bottom-nav-item .nav-icon svg {
  display: block;
  margin: 0 auto;
  transition: transform 0.2s ease;
}

.bottom-nav-item.active .nav-icon svg {
  transform: scale(1.15);
  /* Color is inherited from parent (.active = red) */
}

.bottom-nav-item:active .nav-icon svg {
  transform: scale(0.85);
}