:root {
  /* Color Palette */
  --primary-blue: #007bff;        /* Bootstrap primary blue */
  --secondary-gray: #6c757d;      /* Bootstrap secondary gray */
  --success-green: #28a745;       /* Bootstrap success green */
  --warning-orange: #ffc107;      /* Bootstrap warning orange */
  --danger-red: #dc3545;          /* Bootstrap danger red */
  --info-cyan: #17a2b8;          /* Bootstrap info cyan */
  --light-gray: #f8f9fa;         /* Bootstrap light gray */
  --dark-gray: #343a40;          /* Bootstrap dark gray */
  --neutral-light: #ecf0f1;      /* Light gray for backgrounds */
  --neutral-dark: #2c3e50;       /* Dark blue-gray for text */
  
  /* Typography */
  --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.5;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family-base);
  line-height: var(--line-height-base);
  color: var(--neutral-dark);
  position: relative;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
  margin-top: 0;
  padding-top: 0;
}

.hero-section .display-1 {
  opacity: 0.1;
  font-size: 8rem;
}

/* Navigation */
.navbar {
  z-index: 1030;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 0 !important;
  padding: 0 !important;
}

.navbar .container {
  margin: 0 !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.navbar-brand img {
  transition: all 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

/* Sticky Sidebar */
.sticky-top {
  top: 80px !important;
}

/* Filter Card */
.card {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius-lg);
}

.card-header {
  background-color: var(--light-gray);
  border-bottom: 1px solid var(--neutral-light);
  font-weight: 600;
}

/* Form Controls */
.form-check-input:checked {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--neutral-dark);
}

/* Table Styles */
.table {
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  border-bottom: 2px solid var(--primary-blue);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: var(--light-gray);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Product Images */
.product-img {
  width: 80px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--neutral-light);
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
  padding: 4px;
}

.product-img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.image-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.image-modal img {
  width: 100%;
  height: auto;
  max-width: 500px;
  border-radius: var(--border-radius-md);
}

.image-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

.image-modal-close:hover,
.image-modal-close:focus {
  color: #000;
  text-decoration: none;
}

.image-modal-title {
  text-align: center;
  margin-bottom: 15px;
  color: var(--neutral-dark);
  font-weight: 600;
}

/* Price Styling */
.price {
  font-weight: 700;
  color: var(--success-green);
  font-size: 1.1rem;
}

/* Feature Badges */
.feature-badge {
  display: inline-block;
  background-color: var(--info-cyan);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  margin: 0.1rem;
  font-weight: 500;
}

/* Amazon Link Button */
.amazon-btn {
  background-color: #ff9900;
  border-color: #ff9900;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.amazon-btn:hover {
  background-color: #e68900;
  border-color: #e68900;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Search and Sort Controls */
.input-group .form-control {
  border-right: none;
}

.input-group-text {
  background-color: white;
  border-left: none;
  color: var(--secondary-gray);
}

/* Accordion Styles */
.accordion-button {
  font-weight: 600;
  color: var(--neutral-dark);
}

.accordion-button:not(.collapsed) {
  background-color: var(--primary-blue);
  color: white;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.accordion-body {
  background-color: var(--light-gray);
}

/* Pagination */
.pagination .page-link {
  color: var(--primary-blue);
  border-color: var(--neutral-light);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.pagination .page-link:hover {
  color: var(--primary-blue);
  background-color: var(--light-gray);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Tooltips */
.tooltip {
  font-size: 0.8rem;
}

/* Footer */
footer {
  background-color: var(--dark-gray) !important;
}

footer a {
  transition: color 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section .display-1 {
    font-size: 4rem;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .table-responsive {
    border-radius: var(--border-radius-md);
  }
  
  .sticky-top {
    position: relative !important;
    top: auto !important;
  }
  
  .navbar-brand img {
    height: 30px;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 50vh;
    text-align: center;
  }
  
  .hero-section .display-1 {
    display: none;
  }
  
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }
  
  .feature-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .navbar-light {
    background-color: var(--dark-gray) !important;
  }
  
  .navbar-light .navbar-brand img {
    content: url('../images/logos/Logo white.png');
  }
  
  .navbar-light .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
  }
  
  .navbar-light .navbar-nav .nav-link:hover {
    color: white;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Utility Classes */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--info-cyan) 100%);
}

/* Focus States for Accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .table tbody tr:hover {
    background-color: var(--warning-orange);
    color: var(--dark-gray);
  }
  
  .feature-badge {
    border: 2px solid var(--dark-gray);
  }
}