/* ================================
   CSS Variables - Theme Colors
================================ */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary: #fbbf24;
  --secondary-light: #fcd34d;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ================================
   Reset & Base
================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Scrollbar Styling
================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ================================
   Language Switcher
================================ */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 12px;
}

.lang-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  color: var(--gray-500);
}

.lang-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.lang-btn:hover:not(.active) {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* ================================
   Section Tabs
================================ */
.section-tab {
  color: var(--gray-500);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.section-tab:hover {
  color: var(--primary);
  background: linear-gradient(to bottom, rgba(30, 64, 175, 0.05), transparent);
}

.section-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: linear-gradient(to bottom, rgba(30, 64, 175, 0.1), transparent);
}

.section-tab.active::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* ================================
   Product Cards
================================ */
.product-card {
  position: relative;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.product-card img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover img {
  transform: scale(1.1);
}

/* ================================
   Subscribe Button
================================ */
.subscribe-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.subscribe-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.subscribe-btn:hover::before {
  left: 100%;
}

.subscribe-btn:active {
  transform: scale(0.98);
}

/* ================================
   Bell Animations
================================ */
@keyframes bellRing {
  0%,
  100% {
    transform: rotate(0deg);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: rotate(15deg);
  }
  20%,
  40%,
  60%,
  80% {
    transform: rotate(-15deg);
  }
}

.bell-ring {
  animation: bellRing 0.8s ease-in-out;
}

@keyframes bellPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* ================================
   Rating Stars
================================ */
.rating-star {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}

.rating-star:hover {
  transform: scale(1.3) !important;
}

.rating-star:active {
  transform: scale(0.9) !important;
}

/* ================================
   Modal Styling
================================ */
#ratingModal,
#reportModal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#ratingModalContent,
#reportModalContent {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   Toast Notification
================================ */
#toast {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ================================
   Bootstrap Alert Customization
================================ */
.alert {
  border-radius: 16px !important;
  padding: 1rem 1.25rem !important;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================
   Map Custom Marker
================================ */
.custom-marker {
  background: transparent !important;
  border: none !important;
}

.leaflet-container {
  font-family: inherit;
  border-radius: 16px;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 12px 16px;
}

.leaflet-popup-tip {
  display: none;
}

/* ================================
   Animations
================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseSlow {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

.animate-pulse-slow {
  animation: pulseSlow 3s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
  animation: bounce 0.5s ease-in-out;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-shimmer {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ================================
   Status Badge Animations
================================ */
@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

/* ================================
   Mobile Optimizations
================================ */
@media (max-width: 640px) {
  .section-tab {
    padding: 1rem 0.75rem !important;
  }

  .section-tab span:not(.bg-primary) {
    display: none;
  }

  .product-card:hover {
    transform: translateY(-4px);
  }
}

@media (max-width: 768px) {
  .lang-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ================================
   Section Content Transitions
================================ */
.section-content {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.section-content.hidden {
  display: none !important;
}

/* ================================
   Focus States for Accessibility
================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ================================
   Selection Colors
================================ */
::selection {
  background: var(--primary);
  color: var(--white);
}

::-moz-selection {
  background: var(--primary);
  color: var(--white);
}

/* ================================
   Print Styles
================================ */
@media print {
  header,
  .section-tab,
  #ratingModal,
  #reportModal,
  #toast,
  #alertContainer,
  button,
  .subscribe-btn {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .shadow-md,
  .shadow-lg,
  .shadow-xl,
  .shadow-2xl {
    box-shadow: none !important;
  }
}

/* ================================
   High Contrast Mode Support
================================ */
@media (prefers-contrast: high) {
  .product-card {
    border: 2px solid var(--gray-900);
  }

  .section-tab.active {
    border-bottom-width: 4px;
  }
}

/* ================================
   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;
  }
}

/* ================================
   Certificate Modal Styles
================================ */
.certificate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.certificate-modal.flex,
.certificate-modal:not(.hidden) {
  display: flex;
}

.certificate-modal.hidden {
  display: none;
}

.certificate-content {
  background: var(--white);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.certificate-content.scale-100 {
  transform: scale(1);
}

.certificate-content.opacity-100 {
  opacity: 1;
}

.certificate-content.scale-95 {
  transform: scale(0.95);
}

.certificate-content.opacity-0 {
  opacity: 0;
}

/* Certificate A6 Document */
#certificateA6 {
  border: 1px solid var(--gray-200);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ================================
   Reviews Carousel Styles
================================ */
#reviewsCarousel {
  scroll-behavior: smooth;
}

#reviewsPrev:disabled,
#reviewsNext:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Line clamp for review comments */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================================
   Certification Badge Styles
================================ */
.certification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.certification-badge .checkmark {
  width: 1rem;
  height: 1rem;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certification-badge .checkmark i {
  font-size: 0.5rem;
  color: var(--primary);
}

/* ================================
   Share Modal Styles
================================ */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.share-modal.active {
  opacity: 1;
  visibility: visible;
}

.share-modal-content {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.share-modal.active .share-modal-content {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .share-modal {
    align-items: center;
  }

  .share-modal-content {
    border-radius: 16px;
    transform: scale(0.95);
  }

  .share-modal.active .share-modal-content {
    transform: scale(1);
  }
}

/* ================================
   Print Styles for Certificate
================================ */
@media print {
  .certificate-modal {
    position: static;
    background: none;
    backdrop-filter: none;
  }

  .certificate-content {
    box-shadow: none;
    max-width: none;
    transform: none;
    opacity: 1;
  }

  #certificateA6 {
    box-shadow: none;
    border: 2px solid var(--gray-300);
  }

  .certificate-content > div:last-child {
    display: none;
  }
}
