/* Ducati Universal Stylesheet */
/* White background with Ducati red accents */

:root {
  --ducati-red: #B00E0A; /* Darker Ducati red */
  --ducati-red-dark: #8A0B08; /* Even darker shade for hover states */
  --ducati-red-light: #D41A15; /* Lighter shade for accents */
  --light-gray: #F5F5F5; /* Table backgrounds */
  --medium-gray: #E0E0E0; /* Borders and dividers */
  --dark-gray: #666666; /* Secondary text */
  --white: #FFFFFF; /* Main background */
  --text-dark: #333333; /* Primary text */
  --shadow: 0 2px 8px rgba(0,0,0,0.1); /* Subtle shadows */
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--white);
  color: var(--ducati-red);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header Styles */
.header {
  background-color: var(--ducati-red);
  color: var(--white);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
}

.header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.header .subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 1rem;
  opacity: 0.9;
}

/* Navigation */
.nav {
  background-color: var(--white);
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--ducati-red);
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  color: var(--ducati-red);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.nav-link:hover {
  background-color: var(--ducati-red);
  color: var(--white);
  transform: translateY(-2px);
}

.nav-link.active {
  background-color: var(--ducati-red);
  color: var(--white);
  border-color: var(--ducati-red-dark);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.main-content {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* Category Grid */
.category-grid, .model-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.category-card, .model-card {
  background-color: var(--light-gray);
  border: 2px solid var(--ducati-red);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-image {
  width: 100%;
  height: 110px;
  background-color: var(--light-gray);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  overflow: hidden;
  padding: 0;
}

.category-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
  transform: scale(1.05);
}

.category-card:hover, .model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.2);
  border-color: var(--ducati-red-dark);
}

.category-card h3, .model-card h3 {
  margin: 0;
  padding: 0.3rem 0.5rem;
  color: var(--ducati-red);
  font-size: clamp(0.75rem, 1.2vw, 1.2rem);
  font-weight: 700;
  background-color: var(--light-gray);
}

.category-card .count, .model-card .description {
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.category-card .link, .model-card .link {
  display: inline-block;
  background-color: var(--ducati-red);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.category-card .link:hover, .model-card .link:hover {
  background-color: var(--ducati-red-dark);
  transform: translateY(-2px);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--white);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th {
  background-color: var(--ducati-red);
  color: var(--white);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--medium-gray);
  color: var(--text-dark);
}

.data-table tr:nth-child(even) {
  background-color: var(--light-gray);
}

.data-table tr:hover {
  background-color: var(--ducati-red-light);
  color: var(--white);
}

.data-table tr:hover td {
  color: var(--white);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ducati-red);
  font-weight: 600;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--medium-gray);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--ducati-red);
  box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.btn {
  background-color: var(--ducati-red);
  color: var(--white);
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background-color: var(--ducati-red-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background-color: var(--medium-gray);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background-color: var(--dark-gray);
  color: var(--white);
}

/* Status Messages */
.status {
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-weight: 500;
}

.status.success {
  background-color: #D4EDDA;
  color: #155724;
  border: 1px solid #C3E6CB;
}

.status.error {
  background-color: #F8D7DA;
  color: #721C24;
  border: 1px solid #F5C6CB;
}

.status.warning {
  background-color: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEAA7;
}

/* Footer */
.footer {
  background-color: var(--ducati-red);
  color: var(--white);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

.footer a {
  color: var(--white);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .category-grid, .model-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .data-table {
    font-size: 0.9rem;
  }
  
  .data-table th, .data-table td {
    padding: 0.5rem;
  }
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--light-gray);
  border-top: 3px solid var(--ducati-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 2rem;
  color: var(--dark-gray);
}

.breadcrumb a {
  color: var(--ducati-red);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  margin: 0 0.5rem;
  color: var(--medium-gray);
}

/* Model Details */
.model-details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-top: 2rem;
}

.model-image {
  background-color: var(--light-gray);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  min-height: 160px; /* Reduced from 200px (-20%) */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-gray);
}

.model-image img {
  max-width: 80%; /* Reduced from 100% (-20%) */
  max-height: 80%; /* Reduced from 100% (-20%) */
  object-fit: contain;
}

.model-info h2 {
  color: var(--ducati-red);
  margin-bottom: 1rem;
}

.model-info .specs {
  background-color: var(--light-gray);
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.model-info .specs dt {
  color: var(--ducati-red);
  font-weight: 600;
  margin-top: 1rem;
}

.model-info .specs dd {
  color: var(--text-dark);
  margin-left: 0;
  margin-bottom: 0.5rem;
}

/* ── Model Year Selection Page ─────────────────────────── */
.variants-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.variant-row {
  background-color: var(--white);
  border: 2px solid var(--ducati-red);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.variant-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ducati-red);
  min-width: 165px;
  line-height: 1.25;
}

.years-row {
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.year-btn {
  background-color: var(--ducati-red);
  color: var(--white);
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.year-btn:hover {
  background-color: var(--ducati-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.year-btn.unavailable {
  background-color: var(--medium-gray);
  color: var(--dark-gray);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

