/* ====================================================== */
/* GLOBAL & UTILITY STYLES                              */
/* ====================================================== */

/* Define Color Variables for consistency */
:root {
  --primary-color: #FF4E00;       /* Bobcat Orange */
  --primary-dark: #b00020;
  --secondary-color: #666;
  --background-color: #fff;
  --text-color: #333;
  --header-bg: #111;
  --border-color: #222;
}

/* Reset and Base Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', 'Helvetica Neue', sans-serif;
  color: var(--text-color);
  line-height: 1.5;
}

/* ====================================================== */
/* NAVIGATION                                           */
/* ====================================================== */

.main-nav {
  background-color: var(--header-bg);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.brand-link {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links a {
  color: #fff;
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
}

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

/* Mobile Navigation Toggle (if needed) */
.mobile-menu-toggle {
  display: inline-block;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hide nav links on mobile by default */
.nav-links {
  display: none;
  flex-direction: column;
}

.nav-links.open {
  display: flex;
}

/* On wider screens, show nav links in horizontal layout */
@media (min-width: 768px) {
  .nav-links {
    display: flex !important;
    flex-direction: row;
  }
  .mobile-menu-toggle {
    display: none;
  }
}

/* ====================================================== */
/* HERO SECTION                                         */
/* ====================================================== */

.hero {
  background: linear-gradient(to right, #1a1a1a, #2a2a2a);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
}

.hero .hero-content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero .hero-content p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 2rem;
  }
  .hero .hero-content h1 {
    font-size: 2.5rem;
  }
  .hero .hero-content p {
    font-size: 1.25rem;
  }
}

/* ====================================================== */
/* UNIT GRID & CARD STYLING                             */
/* ====================================================== */

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

/* Card container */
.unit-card {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease-in-out;
}

.unit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ====================================================== */
/* Card Image with Aspect Ratio Container               */
/* ====================================================== */

/* Wrapping the image to enforce a 16:9 ratio */
.image-container {
  width: 100%;
  aspect-ratio: 16 / 9; /* Adjust the ratio as needed */
  overflow: hidden;
}

.image-container .unit-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Image fills container without distortion */
  object-position: center;
}

/* ====================================================== */
/* UNIT DETAILS (Inside Cards)                          */
/* ====================================================== */

.unit-details {
  padding: 1rem;
}

.unit-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* ====================================================== */
/* UNIT DETAIL (SHOW) PAGE                              */
/* ====================================================== */

.unit-show {
  max-width: 900px;
  margin: 3rem auto;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Updated styling for the detailed image */
.unit-show-image {
  width: 100%;
  height: auto;
  max-height: 400px;  /* Prevents the image from taking over the layout */
  object-fit: contain; /* Shows the full image while preserving its aspect ratio */
  object-position: center;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.unit-show-details {
  padding: 1rem 0;
}

.unit-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #111;
}

.unit-description {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.unit-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ====================================================== */
/* FORM STYLING                                         */
/* ====================================================== */

.unit-form {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem;
  border: 2px solid var(--border-color);
  background: var(--background-color);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-input,
.form-textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.form-textarea {
  min-height: 150px;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 78, 0, 0.2);
}

.form-actions {
  text-align: right;
}

/* ====================================================== */
/* BUTTON STYLES                                        */
/* ====================================================== */

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

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

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

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

/* ====================================================== */
/* UTILITY CLASSES                                    */
/* ====================================================== */

.logout-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}

