:root {
  /* Just One Chesed brand colors */
  --primary: 33 75 165; /* #214ba5 */
  --primary-dark: 34 40 152; /* #222898 */
  --secondary: 156 163 175; /* Gray */
  --success: 34 197 94; /* Green */
  --warning: 255 142 0; /* #ff8e00 */
  --danger: 239 68 68; /* Red */
  --info: 24 111 174; /* #186fae */
  --light: 249 250 251; /* Light Gray */
  --dark: 17 24 39; /* Dark Gray */
  
  /* Brand accent colors */
  --accent: 255 142 0; /* #ff8e00 - Orange */
  --accent-secondary: 24 111 174; /* #186fae - Blue */
  --heart-color: 255 142 0; /* Orange for hearts */
  
  /* Background colors */
  --background: 255 255 255; /* White */
  --background-secondary: 249 250 251; /* Light gray */
  --background-tertiary: 243 244 246; /* Lighter gray */
  
  /* Text colors */
  --text-primary: 17 24 39; /* Dark gray */
  --text-secondary: 75 85 99; /* Medium gray */
  --text-muted: 156 163 175; /* Light gray */
  
  /* Border and shadow */
  --border-color: 229 231 235; /* Light border */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, rgb(var(--info)) 0%, rgb(var(--primary-dark)) 100%); /* #186fae to #222898 */
  --gradient-warm: linear-gradient(135deg, rgb(var(--accent)) 0%, rgb(var(--accent-secondary)) 100%);
}

/* Base styling */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: rgb(var(--text-primary));
  background-color: rgb(var(--background));
  line-height: 1.6;
}

/* Custom backgrounds */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

/* Floating hearts animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) rotate(5deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) rotate(-3deg);
    opacity: 0.4;
  }
  75% {
    transform: translateY(-15px) rotate(2deg);
    opacity: 0.5;
  }
}

.floating-hearts {
  pointer-events: none;
  z-index: 1;
}

/* Clickable image styling */
.clickable-image {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Thumbnail container for compact view */
.act-thumbnail {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Compact act card styling */
.card.act-card-compact {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.card.act-card-compact:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.modal-header {
  border-bottom: none;
}

.modal-body img {
  border-radius: 0;
}

/* Pulse and bounce animations for modal */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

.bounce-animation {
  animation: bounce 2s ease-in-out infinite;
}

/* Hero image responsive styling */
.hero-image {
  max-height: 280px;
  max-width: 100%;
  height: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .hero-image {
    max-height: 200px;
    margin-top: 20px;
  }
  
  .hero-section .row {
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .hero-image {
    max-height: 150px;
  }
}

.bg-gradient-warm {
  background: var(--gradient-warm);
}

/* Heart and kindness themed elements */
.text-accent {
  color: rgb(var(--accent)) !important;
}

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

.text-light-50 {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Hero section */
.hero-section {
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.min-vh-50 {
  min-height: 50vh;
}

/* Animations */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

/* Enhanced cards */
.card {
  border: none;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  border: none;
  padding: 1.5rem;
}

/* Statistics cards */
.stat-card {
  padding: 2rem;
  border-radius: 12px;
  background: rgb(var(--background));
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Timeline for kindness acts */
.timeline {
  position: relative;
}

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

.timeline-item {
  position: relative;
  padding-left: 60px;
}

.timeline-marker {
  position: absolute;
  left: 15px;
  top: 5px;
  width: 20px;
  height: 20px;
  background: rgb(var(--success));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  z-index: 2;
}

.timeline-content {
  background: rgb(var(--background-secondary));
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid rgb(var(--success));
}

/* QR Scanner styling */
#scanner-container {
  padding: 2rem;
  background: rgb(var(--background-secondary));
  border-radius: 12px;
  border: 2px dashed rgb(var(--border-color));
}

#scanner {
  border-radius: 8px;
  overflow: hidden;
}

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

.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.75rem 1.5rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

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

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

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

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

/* Navigation enhancements */
.navbar {
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

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

/* Alert enhancements */
.alert {
  border: none;
  border-radius: 8px;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(var(--success), 0.1);
  border-left-color: rgb(var(--success));
  color: rgb(var(--success));
}

.alert-danger {
  background: rgba(var(--danger), 0.1);
  border-left-color: rgb(var(--danger));
  color: rgb(var(--danger));
}

.alert-warning {
  background: rgba(var(--warning), 0.1);
  border-left-color: rgb(var(--warning));
  color: rgb(var(--text-primary));
}

.alert-info {
  background: rgba(var(--info), 0.1);
  border-left-color: rgb(var(--info));
  color: rgb(var(--info));
}

/* Badge enhancements */
.badge {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .display-4 {
    font-size: 2.5rem;
  }
  
  .stat-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .timeline-item {
    padding-left: 40px;
  }
  
  .timeline::before {
    left: 15px;
  }
  
  .timeline-marker {
    left: 5px;
  }
  
  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* Print styles for QR codes */
@media print {
  .no-print {
    display: none !important;
  }
  
  .qr-code-print {
    page-break-inside: avoid;
    margin: 1rem;
    padding: 1rem;
    border: 1px solid #ccc;
    text-align: center;
  }
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgb(var(--border-color));
  border-top-color: rgb(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Admin dashboard specific styles */
.admin-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.table-hover tbody tr:hover {
  background-color: rgba(var(--primary), 0.05);
}

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

::-webkit-scrollbar-track {
  background: rgb(var(--background-secondary));
}

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

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--text-muted));
}

/* Utility classes */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-custom {
  box-shadow: var(--shadow-lg);
}

.border-radius-lg {
  border-radius: 12px;
}

.border-radius-xl {
  border-radius: 16px;
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid rgb(var(--primary));
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: 0 0 0;
    --text-secondary: 0 0 0;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
