:root {
  --primary-color: #c8102e;
  --secondary-color: #003da5;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-gray: #f8f9fa;
  --dark-gray: #343a40;
}

/* AI Image Placeholder Styles */
ai-img {
  display: block;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  position: relative;
  overflow: hidden;
}

ai-img::before {
  content: attr(alt);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6c757d;
  font-size: 12px;
  text-align: center;
  padding: 1rem;
  max-width: 80%;
  word-wrap: break-word;
}

ai-img::after {
  content: '📷';
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0.5;
  font-size: 20px;
}

ai-img.rounded-circle {
  border-radius: 50%;
}

ai-img.card-img-top {
  border-radius: 8px 8px 0 0;
}

ai-img.rounded {
  border-radius: 8px;
}

/* Promo Bar Styles */
.promo-bar {
  background: linear-gradient(90deg, var(--primary-color) 0%, #a00d25 100%) !important;
  font-weight: 500;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Top Bar */
.top-bar a {
  text-decoration: none;
  transition: color 0.3s;
}

.top-bar a:hover {
  color: var(--primary-color) !important;
}

/* Navigation */
.navbar {
  transition: all 0.3s ease;
}

.navbar-brand img,
.navbar-brand ai-img {
  max-height: 45px;
  width: auto;
}

.nav-link {
  font-weight: 500;
  color: var(--dark-gray) !important;
  transition: color 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
  transition: all 0.3s;
}

.btn-primary:hover {
  background-color: #a00d25;
  border-color: #a00d25;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

/* Cards */
.card {
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

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

.product-card .card-img-top {
  transition: transform 0.5s;
}

.product-card:hover .card-img-top {
  transform: scale(1.05);
}

/* Stats Section */
.stat-card {
  background: white;
  border-radius: 12px;
  transition: all 0.3s;
}

.stat-card:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, #a00d25 100%);
  color: white;
  transform: scale(1.05);
}

.stat-card:hover i,
.stat-card:hover h3,
.stat-card:hover p {
  color: white !important;
}

/* Hero Carousel */
.carousel-item {
  height: 600px;
}

.carousel-item ai-img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.carousel-caption {
  bottom: 50px;
}

@media (max-width: 768px) {
  .carousel-item {
    height: 400px;
  }

  .carousel-caption h1,
  .carousel-caption h2 {
    font-size: 1.5rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
  }
}

/* Floating Buttons */
.floating-buttons .btn {
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.floating-buttons .btn:hover {
  transform: scale(1.1);
}

#backToTop {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

/* Author Card */
.author-card {
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s;
}

.author-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-left-width: 6px;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

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

.breadcrumb-item.active {
  color: #6c757d;
}

/* Page Banner */
.page-banner {
  border-bottom: 3px solid var(--primary-color);
}

/* Filter Section */
.filter-section select {
  border: 2px solid #dee2e6;
  transition: border-color 0.3s;
}

.filter-section select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(200, 16, 46, 0.25);
}

/* Badges */
.badge {
  font-weight: 600;
  padding: 0.4em 0.8em;
  font-size: 0.75rem;
}

/* Footer */
footer {
  background: linear-gradient(180deg, #212529 0%, var(--dark-gray) 100%);
}

footer a {
  transition: color 0.3s;
}

footer a:hover {
  color: var(--primary-color) !important;
}

/* Timeline (for About page) */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--primary-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding: 0 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: white;
  border: 4px solid var(--primary-color);
  border-radius: 50%;
  z-index: 1;
}

/* Modal */
.modal-content {
  border-radius: 12px;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(90deg, var(--primary-color) 0%, #a00d25 100%);
}

/* Form Validation */
.was-validated .form-control:invalid {
  border-color: #dc3545;
}

.was-validated .form-control:valid {
  border-color: var(--success-color);
}

/* Testimonials */
#testimonialCarousel .card {
  border: none;
  background: white;
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

/* Responsive */
@media (max-width: 992px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-item::before {
    left: 20px;
  }

  .timeline-item {
    padding-left: 3rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Print Styles */
@media print {
  .promo-bar,
  .top-bar,
  .navbar,
  .floating-buttons,
  footer,
  .modal {
    display: none !important;
  }
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
