:root {
  --primary-color: #2C5F2D;
  --greif-primary: #2C5F2D;
  --accent-color: #FF6B35;
  --greif-accent: #FF6B35;
  --dark-color: #2D3142;
  --greif-dark: #2D3142;
  --light-color: #F7F7F7;
  --greif-light: #F7F7F7;
}

/* Greif Brand Colors */
.bg-greif-primary {
  background-color: var(--greif-primary) !important;
}

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

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

.bg-greif-gradient {
  background: linear-gradient(135deg, var(--greif-primary) 0%, #1a4d1f 100%) !important;
}

.text-greif-accent {
  color: var(--greif-accent) !important;
}

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

.btn-greif-primary:hover,
.btn-greif-primary:focus {
  background-color: #234d24;
  border-color: #234d24;
  color: #fff;
}

.btn-greif-accent {
  background-color: var(--greif-accent);
  border-color: var(--greif-accent);
  color: #fff;
}

.btn-greif-accent:hover,
.btn-greif-accent:focus {
  background-color: #e65d2e;
  border-color: #e65d2e;
  color: #fff;
}

/* Override Bootstrap primary color */
.bg-primary {
  background-color: var(--primary-color) !important;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: #234d24;
  border-color: #234d24;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

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

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

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

/* 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: 90%;
  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;
}

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

/* Testimonial Avatar Styles */
.testimonial-card ai-img.rounded-circle {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px;
  min-height: 60px;
  max-width: 60px;
  max-height: 60px;
  flex-shrink: 0;
}

/* Card Hover Effects */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Product Card Styles */
.product-card .card-title {
  font-size: 1.1rem !important;
  line-height: 1.4 !important;
  min-height: 2.8rem;
  white-space: normal !important;
  word-wrap: break-word !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .card-body {
  display: flex !important;
  flex-direction: column !important;
}

.product-card .list-unstyled {
  flex-grow: 1;
}

/* Ensure all headings display horizontally */
h1, h2, h3, h4, h5, h6,
.card-title,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
}

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

#backToTop {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Navigation Styles */
.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--dark-color);
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

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

/* Promo Bar */
.promo-bar {
  font-size: 14px;
}

/* Page Banner */
.page-banner {
  position: relative;
  overflow: hidden;
}

.page-banner ai-img {
  width: 100%;
  min-height: 400px;
}

.banner-overlay {
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.page-banner > * {
  position: relative;
  z-index: 2;
}

/* Hero Carousel */
.hero-section .carousel-item ai-img {
  width: 100%;
  min-height: 700px;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  border-radius: 10px;
}

/* Timeline Styles */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16.666%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-color);
}

@media (max-width: 767px) {
  .timeline::before {
    left: 20px;
  }
}

/* Progress Bar */
.progress-bar {
  background-color: var(--primary-color);
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(44, 95, 45, 0.25);
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545;
}

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

/* Link Styles */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #234d24;
}

/* Article Content Styles */
.article-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.article-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

.article-content p {
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content table {
  margin-bottom: 1.5rem;
}

.article-content figure {
  margin: 2rem 0;
}

/* Badge Styles */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Responsive Typography */
@media (max-width: 767px) {
  .display-4 {
    font-size: 2.5rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1.1rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #234d24;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

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