@media only screen and (max-width: 768px) {
  .left-nav {
    display:none;
  }
}

.mobile-icon-nav {
  display: none;
}

/* Main Layout */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: var(--primary-color);
}

/* Container visibility control */
.container {
  display: none; /* Hidden by default */
}

.container.active-section {
  display: block; /* Show when active */
}

/* Make sure this doesn't affect index.html */
body:not(.about-my-car) #registration-section {
  display: block !important; /* Override for index.html */
}

.main-content {
  padding: 20px;
  padding-top: 80px;
}

/* Container Styles */
.container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: calc(100% - 40px);
  box-sizing: border-box;
  max-width: 800px;
  margin: 20px auto;
}

.registration-form {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two columns */
  grid-template-rows: repeat(4, auto); /* Four auto-height rows*/
  grid-gap: 10px;
}

/* Style the carDetails area */

.car-details-grid {
  grid-column: 1 / span 2; /* Span both columns */
  grid-row: 4; /* Place at bottom (adjust as needed) */
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
}

.car-details-grid img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 200px;
  height: auto;
}

.column1 { 
  grid-column: 1; 
}
.column2 { 
  grid-column: 2; 
}

.expandable-section {
  margin-bottom: 10px; /* Add some space between sections */
}

.expandable-section h3 {
  cursor: pointer; /* Make headers clickable */
}

.expandable-section .section-content {
  margin-left: 20px; /* Indent content */
}

.failed {
  color: red;
}

/* Registration Form */
.registration-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  color: #333;
  font-weight: 500;
}

.input-group input,
.input-group select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

#searchButton {
  padding: 0.5rem 1rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
  height: 38px; /* Match input height */
  margin-top: auto; /* Align with inputs */
}

#searchButton:hover {
  background-color: #0056b3;
}

/* Registration input styling to match UK rear number plate */
#registrationInput {
  background-color: #f0c139; /* UK number plate yellow, match index.html */
  color: #000;
  border: 1px solid #000; /* Black border */
  border-radius: 5px; /* Slightly rounded corners */
  font-family: "Charles Wright", Arial, sans-serif; /* UK number plate font */
  text-transform: uppercase; /* Force uppercase input */
  text-align: center;
  font-size: 16px;
  width: 150px;
  padding: 10px;
  margin: 0 auto 10px auto;
  display: block;
}

#registrationInput::placeholder {
  color: rgba(0,0,0,0.3);
  font-size: 16px;
  font-family: "Charles Wright", Arial, sans-serif; /* UK number plate font */
  font-weight: 400; /* Ensure placeholder is not bold */
}

#registrationInput:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Credits Section */
.credits-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.credits-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.credits-info h2 {
  flex: 1;
  text-align: center;
}

.credits-row p {
  flex: 1;
  text-align: center;
  margin: 5px 0;
}

/* Vehicle Information Section */
#vehicle-info {
  margin-top: 1rem;
}

/* Car Details Section */
#carDetails {
  margin-top: 20px; /* Space above the car details section */
}

#carDetailsList {
  list-style-type: none; /* Remove default list styling */
  padding: 0; /* Remove default padding */
}

#carDetailsList li {
  font-size: 16px; /* Adjust font size as needed */
  margin-left: 10px;
  margin-right: 10px;
  line-height: 1.5; /* Increase line height for better readability */
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  /* Mobile Navigation */
  .mobile-icon-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #119DA4;
    z-index: 9999;
    padding: 4px 2px !important;
    height: 50px;
  }

  .mobile-icon-nav .nav-icon {
    color: #000000 !important;
    font-size: 20px !important;
    width: auto !important;
    margin: 0 !important;
    display: inline-block !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
  }

  .mobile-icon-nav .nav-icon::before {
    display: inline-block !important;
  }

  .mobile-icon-nav ul {
    display: flex !important;
    width: 100% !important;
    padding: 0 2px !important;
    margin: 0 !important;
    list-style: none !important;
    justify-content: space-between !important;
  }

  .mobile-icon-nav li {
    flex: 0 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-icon-nav a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    color: #000000 !important;
    text-decoration: none !important;
    min-width: 32px !important;
  }

  /* Ensure header is below nav */
  header {
    margin-top: 50px; /* Space for nav bar */
    margin-bottom: 0; /* Remove bottom margin */
  }

  /* Adjust main content spacing */
  main {
    padding-top: 65px; /* Reduced from 110px */
  }

  /* Registration section mobile styles */
  #registration-section {
    margin-top: 0;
    padding: 0 12px;
  }

  #registration-section h2 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    text-align: left;
  }

  /* Container for the entire registration section */
  .container {
    display: flex;
    flex-direction: column;
  }

  /* Registration form layout */
  .registration-form {
    display: flex;
    flex-direction: column;
    order: 1;
  }

  /* Form elements - specific ordering */
  .input-group {
    width: 100%;
    margin-bottom: 15px;
  }

  /* Target input groups by their position */
  .input-group:nth-of-type(1) {
    order: 1; /* Registration input */
  }

  .input-group:nth-of-type(3) {
    order: 2; /* Service select */
  }

  .input-group:nth-of-type(2) {
    order: 3; /* Existing registrations */
  }

  .input-group input,
  .input-group select {
    width: 100%;
    padding: 8px;
  }

  /* Search button */
  #searchButton {
    order: 4;
    margin-bottom: 20px;
    width: 100%;
  }

  /* Car details section */
  .car-details-grid {
    order: 5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
  }

  .car-details-grid img {
    order: 2;
    margin: 20px auto 0;
    max-width: 300px;
    width: 100%;
  }

  .column1, .column2 {
    width: 100%;
  }

  /* Vehicle details list */
  #registration-section ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  #registration-section li {
    font-size: 0.95em;
    padding: 6px;
    color: #333;
    background: #f8f8f8;
    border-radius: 4px;
    line-height: 1.2;
  }

  /* Search button */
  .search-button {
    width: 100%;
    height: 40px;
    margin-top: 5px;
    font-size: 0.95em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
  }

  #carDetailsList {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #carDetailsList li {
    background: #e9ecef;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    line-height: 1.3;
    color: #333;
  }

  /* Special items that need more space */
  #carDetailsList li:nth-child(1), /* Registration */
  #carDetailsList li:nth-child(2), /* Make */
  #carDetailsList li:nth-child(3), /* Finance */
  #carDetailsList li:nth-child(4), /* Write off */
  #carDetailsList li:nth-child(5), /* Model */
  #carDetailsList li:nth-child(6)  /* Color */ {
    grid-column: span 1;
  }

  /* Engine gets more space */
  #carDetailsList li:nth-child(7) {
    grid-column: span 2;
  }

  /* Mileage and MOT */
  #carDetailsList li:nth-child(8),
  #carDetailsList li:nth-child(9) {
    grid-column: span 1;
  }

  /* Forecourt value gets full width */
  #carDetailsList li:nth-child(10) {
    grid-column: 1 / -1;
    text-align: center;
    font-weight: bold;
  }

  /* Image container styles */
  #carDetailsList li:has(img) {
    grid-column: 1 / -1;
    padding: 8px;
    text-align: center;
    background: none;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Image styles for both containers */
  #carDetailsList li img,
  #images-container img {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    object-fit: contain;
  }

  /* Container styles for both */
  #carDetailsList li:has(img),
  #images-container {
    grid-column: 1 / -1;
    padding: 8px;
    text-align: center;
    background: none;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Ensure images container is visible */
  #images-container {
    display: flex !important;
    margin-top: 10px;
  }
}

@media screen and (min-width: 769px) {
  .mobile-icon-nav {
    display: none;
  }

  .left-nav {
    display: block;
  }
}

/* Mobile Navigation Icons */
.mobile-icon-nav .nav-icon {
  color: #000000;
  font-size: 20px; /* Slightly smaller */
  width: auto;
  margin: 0;
}

.mobile-icon-nav li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-icon-nav li:hover .nav-icon {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.mobile-icon-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Navigation Icons */
.nav-icon {
  color: #000000;
  font-size: 20px;
  width: 24px;
  margin-right: 12px;
  text-align: center;
}

.left-nav li {
  display: flex;
  align-items: center;
  padding: 12px 20px;
}

.left-nav li:hover .nav-icon {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Left Nav */
.left-nav {
  background-color: #119DA4;
  color: black;
  width: 200px;
  position: fixed;
  top: 160px; /* Align with header */
  left: 0;
  height: calc(100vh - 60px);
  padding: 20px;
}

.left-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.left-nav li {
  display: flex;
  align-items: center;
  padding: 10px 15px;
}

.left-nav li img {
  width: 20px;  /* Adjust size as needed */
  height: auto;
  margin-right: 10px;
}

.left-nav a {
  color: black;
  text-decoration: none;
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
}

.left-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Main Header */
.main-header {
  background-color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  color: #040404;
  width: 100%;
  z-index: 101; /* Ensure the header stays on top of other fixed elements */
}

/* Text Container */
.text-container {
  margin-top: 50px; /* Adjust spacing as needed */
  max-width: 800px; /* Limit the paragraph width */
  margin-left: auto;
  margin-right: auto; 
}

/* Text Container */
.tab-content {
  margin-top: 50px; /* Adjust spacing as needed */
  max-width: 800px; /* Limit the paragraph width */
  margin-left: auto;
  margin-right: auto; 
}

/* Button */
.button {
  display: block;
  width: 200px;
  padding: 15px;
  margin: 20px auto;
  text-align: center;
  text-decoration: none;
  background-color: #0C7489;
  color: white;
  border-radius: 5px;
}

.button:hover {
  background-color: #13505b; /* Darker green on hover */
}

/* Container Image */
.container img {
  margin: 0;
  height: auto;
  max-width: 100%;
  width: 200px;
}

#carHistoryChart {
  width: 100%; /* Full width of the parent container */
  height: 400px; /* Set a height for the chart */
  display: block; /* Ensure it's displayed */
  z-index: 10; /* Higher z-index to ensure it's on top */
  position: relative; /* Required for z-index to work */
}

#carHistoryData {
  background-color: rgba(255, 255, 255, 0.5); /* Light background for visibility */
}

/* Container Heading */
.container h2 { /* Adjust line-height for the heading */
  line-height: 1.2; 
}

/* Button Line Height */
.button {
  line-height: 1; /* Adjust line-height for the button */
}

/* My Vehicles Dropdown */
#my-vehicles-dropdown {
  width: 200px; /* Adjust width as needed */
  margin: 20px auto;
}

#vehicleSpecsList {
  list-style: none; /* Remove bullet points */
  padding-left: 0; /* Remove default left padding */
}

#vrnSelect {
  width: 100%;
  padding: 10px;
  border: 1px solid #000;
  border-radius: 5px;
  text-align: center;
  font-size: 16px;
  background-color: #f0c139; /* UK number plate yellow */
  font-family: "Charles Wright", Arial, sans-serif; /* UK number plate font */
  text-transform: uppercase;
  appearance: none; /* Customize dropdown arrow (may require additional vendor prefixes) */
}

/* VRN Dropdown Styles */
.vrn-dropdown {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

#vrnSelect {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f0c139;
  font-family: "Charles Wright", Arial, sans-serif;
  text-transform: uppercase;
}

#loadPreviousButton {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

#loadPreviousButton:hover {
  background-color: #0056b3;
}
