/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

/* === COLOR VARIABLES === */
:root {
  --bg-dark: #1e1e1e;
  --bg-medium: #2a2a2a;
  --bg-light: #333;
  --text-light: #e0e0e0;
  --gold: #d4af37;
  --gold-bright: #f9d342;
  --gold-muted: #c9a33d;
  --accent-border: #444;
  --shadow: rgba(0, 0, 0, 0.5);
}

/* === BODY === */
body {
  background-color: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Audiowide', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* === HEADER === */
header {
  background: var(--bg-medium);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px var(--shadow);
  border-bottom: 2px solid rgba(255,255,255,0.1);
  background: linear-gradient(90deg, rgba(211,47,47,0.2), transparent);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gold);
}

nav ul {
  animation: fadeIn 2s ease;
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* === Dropdown Menu === */
.dropdown {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-medium);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  z-index: 1000;
  min-width: 160px;
}
.dropdown-menu li {
  padding: 0.5rem 1rem;
  white-space: nowrap;
}
.dropdown-menu li a {
  color: #fff;
  display: block;
}
.dropdown-menu li a:hover {
  background: var(--bg-light);
  color: var(--gold);
}
.dropdown.open .dropdown-menu {
  display: block;
}

/* Pending and submitted cards */
.pending-card, .user-test-card {
  background: var(--bg-dark);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.pending-card h3, .user-test-card h3 {
  margin-bottom: 0.5rem;
  color: var(--gold);
}
.pending-fields .form-group, .pending-card .form-group {
  margin-bottom: 0.5rem;
}
.pending-card .pending-actions button {
  margin-right: 0.5rem;
}

/* Status labels */
.status-pending {
  color: #d4af37;
}
.status-accepted {
  color: #4caf50;
}
.status-rejected {
  color: #f44336;
}

a {
  color: #d32f2f;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ff4a4a;
}

nav a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

nav a:hover {
  color: var(--gold-bright);
}

nav a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  left: 0;
  bottom: -3px;
  background: var(--gold);
  transition: width 0.3s ease;
}
nav a:hover::after {
  width: 100%;
}

/* Mobile Header */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  nav ul {
    gap: 1rem;
    justify-content: center;
  }

  nav a {
    font-size: 0.9rem;
  }
}

/* === HERO SECTION === */
.hero {
  background: radial-gradient(circle at 50% 20%, #1a1a1a, #000);
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3.5rem;
  letter-spacing: 3px;
  animation: fadeIn 2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Responsive Typography */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero {
    padding: 4rem 1rem;
  }
}

/* === CONTAINER === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }
}

.procedure-card {
  background: transparent;
  border-left: 2px solid #d32f2f;
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.procedure-card h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.procedure-card p {
  color: #aaa;
  line-height: 1.6;
}


/* === SEARCH BAR === */
.search-container {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-bar {
  flex: 1;
  min-width: 200px;
  padding: 0.8rem 1.5rem;
  background: var(--bg-light);
  border: 2px solid var(--accent-border);
  border-radius: 25px;
  color: var(--text-light);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-bar:focus {
  outline: none;
  border-color: var(--gold);
}

.search-bar::placeholder {
  color: #777;
}

/* === Filter Button === */
/* Style the button that opens the filter modal. It matches the theme with a pill shape, gold border, and hover effect. */
.modal-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 9999px;
  font-family: 'Audiowide', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.modal-btn:hover {
  background: var(--gold);
  color: #111;
  transform: translateY(-2px);
}


.sort-select {
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--accent-border);
  background: var(--bg-light);
  color: var(--text-light);
  border-radius: 25px;
  cursor: pointer;
}

/* === MODAL === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-medium);
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 40px var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header h2 {
  color: var(--gold);
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s;
}
.close-modal:hover {
  color: var(--gold);
}

/* General modal fixes */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

/* Header spacing fix */
.modal-header {
  position: sticky;
  top: 0;
  background: #111;
  z-index: 1002;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

/* Close button tweak */
.close-modal {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1003;
}




/* Danger button for destructive actions */
.danger {
  background: #c62828 !important;
  border-color: #c62828 !important;
}
.danger:hover {
  background: #b71c1c !important;
  border-color: #b71c1c !important;
}


/* === BUTTONS === */
.apply-btn,
.submit-btn,
.back-btn {
  padding: 0.8rem 2rem;
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}
.apply-btn:hover,
.submit-btn:hover,
.back-btn:hover {
  background: var(--gold-muted);
  transform: translateY(-2px);
}

.clear-btn {
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--text-light);
  border: 2px solid var(--accent-border);
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}
.clear-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* === CAR GRID === */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.car-card {
  background: var(--bg-medium);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  border: 1px solid var(--accent-border);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
}
.car-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  border-color: var(--gold);
}
.car-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--bg-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}
.car-info h3 {
  color: var(--gold);
}

/* === DETAIL PAGE === */
.detail-header h1 {
  color: var(--gold);
}
.detail-image {
  background: linear-gradient(135deg, var(--gold) 0%, var(--bg-dark) 100%);
  border: 2px solid var(--accent-border);
}
.result-value {
  color: var(--gold);
}
.opinion-section h2 {
  color: var(--gold);
}

/* === FOOTER === */
footer {
  background: var(--bg-medium);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
  border-top: 2px solid var(--gold);
}
.social-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}
.social-links a:hover {
  color: var(--gold);
}

/* === FORM & SIGN-IN === */
.form-group label {
  color: var(--gold);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}

/* === MISSION PAGE === */
.mission {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--text-light);
}
.mission h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

p {
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #ccc;
}

.car-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
  transition: 0.3s ease;
}


.mission p {
  margin-top: 1rem;
  font-size: 1.05rem;
}
.mission blockquote {
  margin: 2rem 0;
  font-style: italic;
  text-align: center;
  color: #ccc;
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
}

/* === PAGE VISIBILITY === */
.page {
  display: none;
}
.page.active {
  display: block;
}

h1, h2, h3 {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
}

/* === LINK ACCENT === */
.link-accent {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}
.link-accent:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.range-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.range-group input[type="range"] {
  /* Ensure the slider stretches the full width of its container */
  width: 100%;
  /* Remove default browser styling for consistent look */
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 5px;
  background: var(--accent-border);
  outline: none;
  cursor: pointer;
  margin: 0.5rem 0;
}

/* Custom thumb styling for WebKit browsers (Chrome, Safari, Edge) */
.range-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px var(--gold-bright);
}

/* Custom thumb styling for Firefox */
.range-group input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px var(--gold-bright);
}

.range-label {
  color: #ccc;
  font-size: 0.9rem;
}

.arrow {
  font-size: 1rem;
  color: #f9d342;
}


.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

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

/* === FORM FIELD REFINEMENT === */
form {
  display: flex;
  flex-direction: column;
  align-items: center; /* center all inputs horizontally */
  gap: 1.5rem; /* add space between groups */
}

/* Group layout cleanup */
.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Style all input fields, selects, and textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 80%; /* center and limit width */
  max-width: 500px;
  padding: 0.9rem 1.2rem;
  background: var(--bg-light);
  border: 2px solid var(--accent-border);
  border-radius: 12px; /* rounded corners */
  color: var(--text-light);
  font-size: 1rem;
  text-align: center; /* center text inside fields */
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Focus glow effect */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Label alignment */
.form-group label {
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

/* For textareas */
textarea {
  resize: vertical;
  min-height: 100px;
}

/* Fix overlapping in multi-column rows */
.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  width: 100%;
}

@media (max-width: 600px) {
  .modal-content {
    max-width: 90%;
    padding: 1.2rem;
  }

  .filter-option {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }
}

.modal-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-medium);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}




/* === Popup Modal === */
.popup-modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: var(--bg-medium);
  color: var(--text-light);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease;
}

.popup-content.success {
  border: 2px solid var(--gold);
}

.popup-content.error {
  border: 2px solid red;
}

.popup-btn {
  background: var(--gold);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  margin-top: 1rem;
  cursor: pointer;
  color: #000;
  font-weight: bold;
}

/* === FILTER MODAL STYLING (FINAL VERSION) === */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden; /* Prevent background scroll */
}

.modal.active {
  display: flex;
}

/* === Modal Content === */
.filter-modal {
  position: relative;
  background: var(--bg-medium);
  color: var(--text-light);
  padding: 2.5rem 2rem;
  border-radius: 18px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto; /* Allow inner scrolling */
  box-shadow: 0 0 25px var(--shadow);
  border: 1px solid var(--gold-muted);
}

/* === Title & Close Button === */
.filter-title {
  text-align: center;
  font-size: 1.7rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}
.close-btn:hover {
  color: var(--gold-bright);
  transform: scale(1.15);
}

/* === Container === */
.filter-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.filter-category {
  border-bottom: 1px solid var(--gold-muted);
  padding-bottom: 0.5rem;
}

/* === Category Header Bar === */
.filter-bar {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  font-family: 'Audiowide', sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  cursor: pointer;
  transition: color 0.3s ease;
}
.filter-bar:hover {
  color: var(--gold-bright);
}
.filter-bar.active {
  color: var(--gold);
}

.arrow {
  transition: transform 0.3s ease;
  font-size: 1rem;
  color: var(--gold);
}
.filter-bar.active .arrow {
  transform: rotate(180deg);
}

/* === Dropdown Animation === */
.filter-dropdown {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.filter-dropdown.open {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
}

/* === Filter Option Buttons === */
.filter-option {
  background: var(--bg-light);
  color: var(--text-light);
  border: 1px solid var(--gold-muted);
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-option:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.filter-option.selected {
  background: var(--gold);
  color: #000;
  border-color: var(--gold-bright);
}

/* === Slider Filters === */
.slider-dropdown {
  flex-direction: column;
  width: 100%;
  padding-top: 0.5rem;
}

.slider-dropdown input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: var(--accent-border);
  outline: none;
  cursor: pointer;
  margin: 0.5rem 0;
}
.slider-dropdown input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 5px var(--gold-bright);
  cursor: pointer;
}
.slider-dropdown input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 5px var(--gold-bright);
  cursor: pointer;
}

.range-label {
  text-align: right;
  font-size: 0.85rem;
  color: var(--gold-muted);
  margin-top: 0.5rem;
}

/* === Action Buttons === */
.filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.clear-btn,
.apply-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  font-family: 'Audiowide', sans-serif;
  border: 1px solid var(--gold);
  border-radius: 9999px;
  background: transparent;
  color: var(--gold);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.clear-btn:hover,
.apply-btn:hover {
  background: var(--gold);
  color: #000;
  transform: translateY(-2px);
}

/* === Mobile Adjustments === */
@media (max-width: 600px) {
  .filter-modal {
    padding: 1.5rem;
    max-width: 90%;
  }

  .filter-title {
    font-size: 1.3rem;
  }

  .filter-option {
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
  }
}

