/* BeSmart.ai Custom Styles */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Variables */
:root {
  --primary-cyan: #00BBCC;
  --secondary-navy: #1B3B5F;
  --bg-white: #FFFFFF;
  --text-dark: #0F172A;
  --text-gray: #64748B;
  --gradient-dark: linear-gradient(135deg, #1B3B5F 0%, #0F172A 100%);
  --gradient-cyan: linear-gradient(135deg, #00BBCC 0%, #00D4E8 100%);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.2);
  --shadow-glow-cyan: 0 0 20px rgba(0, 187, 204, 0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Arabic Font */
body[lang="ar"],
body[lang="ar"] * {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  color: var(--text-gray);
}

/* Utility Classes */
.container-custom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 5rem 0;
}

@media (max-width: 640px) {
  .section-padding {
    padding: 3rem 0;
  }
}

.gradient-text {
  background: var(--gradient-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.gradient-bg-dark svg.text-cyan {
  color: var(--primary-cyan) !important;
}

.gradient-bg-cyan {
  background: var(--gradient-cyan) !important;
}

.gradient-bg-cyan svg.text-white {
  color: white !important;
}

/* Override gradient-text when inside gradient backgrounds */
.gradient-bg-dark .gradient-text,
.gradient-bg-cyan .gradient-text {
  background: none !important;
  -webkit-text-fill-color: white !important;
  color: white !important;
}


/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--primary-cyan);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: #00D4E8;
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-cyan);
  border: 2px solid var(--primary-cyan);
}

.btn-secondary:hover {
  background: var(--primary-cyan);
  color: white;
  transform: translateY(-2px);
}

.btn-white {
  background: white;
  color: var(--secondary-navy);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--secondary-navy);
  z-index: 1000;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  -webkit-perspective: 1000;
  contain: layout style paint;
}

.navbar.scrolled {
  background: rgba(27, 59, 95, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.5rem 1rem;
  transition: color var(--transition-fast);
  position: relative;
}

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

.nav-link:hover {
  color: var(--primary-cyan);
}

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--secondary-navy);
  box-shadow: var(--shadow-xl);
  transition: right var(--transition-normal);
  z-index: 1001;
  padding: 5rem 2rem 2rem;
}

[dir="rtl"] .mobile-menu {
  right: auto;
  left: -100%;
}

.mobile-menu.open {
  right: 0;
}

[dir="rtl"] .mobile-menu.open {
  right: auto;
  left: 0;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 999;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Emblem Accent Decorations */
.emblem-accent {
  position: absolute;
  pointer-events: none;
  opacity: 0.08;
  z-index: 0;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: opacity, transform;
}

/* Small corner accents in hero - grey filter for better visibility */
.emblem-hero-top-right {
  width: 120px;
  height: 120px;
  top: 100px;
  right: 40px;
  filter: grayscale(100%) brightness(1.5);
  opacity: 0.1;
  animation: pulse-glow 4s ease-in-out infinite;
}

.emblem-hero-bottom-left {
  width: 80px;
  height: 80px;
  bottom: 80px;
  left: 40px;
  filter: grayscale(100%) brightness(1.5);
  opacity: 0.1;
  animation: pulse-glow 4s ease-in-out infinite 2s;
}

/* Footer accent - small corner emblem with relative positioning */
.emblem-footer-accent {
  width: 80px;
  height: 80px;
  top: 40px;
  right: 40px;
  opacity: 0.25;
  z-index: 1;
  filter: grayscale(100%) brightness(1.5);
}

/* Repeating pattern background (optional) */
.emblem-pattern {
  width: 40px;
  height: 40px;
  opacity: 0.02;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.1;
    transform: scale(1) translateZ(0);
  }
  50% {
    opacity: 0.15;
    transform: scale(1.05) translateZ(0);
  }
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--gradient-dark);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  -webkit-perspective: 1000;
  contain: layout style paint;
  isolation: isolate;
}

.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: all;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: contents;
}

.hero-content {
  position: relative;
  z-index: 1;
  transform: translateZ(0);
  pointer-events: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

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

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: visible;
  border-top: 4px solid transparent;
}

/* Industry Card Filter Animation */
.industry-card {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.industry-card.hiding {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.industry-card.hidden {
  display: none;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-top-color: var(--primary-cyan);
}

/* Case Studies Section - Prevent border clipping */
#case-studies {
  overflow: visible !important;
  -webkit-overflow-scrolling: touch;
}

/* Case Studies Swiper - Equal Height Cards */
.case-studies-swiper {
  overflow: visible !important;
  -webkit-overflow-scrolling: touch;
  padding-top: 20px !important;
  padding-bottom: 10px !important;
  clip-path: none !important; /* Prevent Chrome clipping */
  -webkit-clip-path: none !important;
}

.case-studies-swiper .swiper-wrapper {
  overflow: visible !important;
  -webkit-overflow-scrolling: touch;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

.case-studies-swiper .swiper-slide {
  height: auto;
  display: flex;
  overflow: visible !important;
  padding-top: 10px !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  contain: none !important; /* Prevent Chrome containment */
}

.case-studies-swiper .card {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-top-width: 4px !important; /* Match original design */
  contain: none !important;
}

.case-studies-swiper .card:hover {
  transform: translateY(-8px) !important; /* Match original design */
  box-shadow: var(--shadow-xl) !important;
  border-top-color: var(--primary-cyan) !important;
}

.case-studies-swiper .card > div:last-child {
  flex: 1;
}

.card-3d {
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-3d:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 1rem;
  padding: 2rem;
  background: white;
  box-shadow: var(--shadow-md);
}

.card-back {
  transform: rotateY(180deg);
  background: var(--gradient-dark);
  color: white;
}

/* Stats Counter */
.stat-card {
  text-align: center;
  padding: 2rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Trust Section - Equal Height Cards */
#trust .grid {
  display: grid;
  align-items: stretch;
}

#trust .card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 200px;
}

/* Infinite Scroll */
.infinite-scroll {
  display: flex;
  overflow: hidden;
  user-select: none;
  width: 100%;
}

.infinite-scroll-inner {
  display: flex;
  animation: scroll 30s linear infinite;
  gap: 6rem;
  align-items: center;
  white-space: nowrap;
  padding: 1rem 0;
}

.infinite-scroll:hover .infinite-scroll-inner {
  animation-play-state: paused;
}

/* Partner Logo Styling */
.partner-logo {
  height: 24px;
  width: auto;
  max-width: 100px;
  min-width: 50px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: block;
}

.partner-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

[dir="rtl"] @keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

/* Client Logo Container */
.client-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 1rem;
}

.client-logo-container img {
  max-width: 100%;
  object-fit: contain;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  justify-content: center;
}

.filter-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 2px solid #e2e8f0;
  border-radius: 2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
  color: var(--text-gray);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: white;
  transform: scale(1.05);
}

/* Service Selector */
.service-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-tab {
  padding: 1.25rem 1.5rem;
  background: white;
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: 0.5rem;
}

[dir="rtl"] .service-tab {
  border-left: none;
  border-right: 4px solid transparent;
}

.service-tab:hover,
.service-tab.active {
  background: #f0fdff;
  border-left-color: var(--primary-cyan);
  transform: translateX(8px);
}

[dir="rtl"] .service-tab:hover,
[dir="rtl"] .service-tab.active {
  border-right-color: var(--primary-cyan);
  transform: translateX(-8px);
}

/* Service Content Container - needs position relative for absolute children */
.lg\:col-span-9 {
  position: relative;
}

/* Service Content Animation */
.service-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  visibility: hidden;
}

.service-content.active {
  position: relative;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  visibility: visible;
}

.service-content.hiding {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Hide non-active service content */
.service-content:not(.active):not(.hiding) {
  display: none;
}

/* Charts & Visualizations */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 2rem 0;
}

.circular-progress {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress circle {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-bg {
  stroke: #e2e8f0;
}

.progress-fill {
  stroke: var(--primary-cyan);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(0, 187, 204, 0.1);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background var(--transition-fast);
}

.form-checkbox:hover {
  background: #f8fafc;
}

.form-checkbox input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--primary-cyan);
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-cyan);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-glow-cyan);
}

.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-cyan);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  border: none;
  transition: all var(--transition-fast);
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-glow-cyan);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 1rem;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 2rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-gray);
  transition: color var(--transition-fast);
  padding: 0.5rem;
}

.modal-close:hover {
  color: var(--text-dark);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-free {
  background: #10b981;
  color: white;
}

.badge-freemium {
  background: #3b82f6;
  color: white;
}

.badge-paid {
  background: #f59e0b;
  color: white;
}

.badge-featured {
  background: var(--gradient-cyan);
  color: white;
}

.badge-trending {
  background: #ef4444;
  color: white;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Rating Stars */
.rating-stars {
  display: inline-flex;
  gap: 0.25rem;
  color: #fbbf24;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 187, 204, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-cyan);
  animation: spin 1s linear infinite;
}

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

/* Fade Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.language-switcher:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Footer */
.footer {
  background: var(--secondary-navy);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
  position: relative;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: block;
  margin-bottom: 0.75rem;
}

.footer-link:hover {
  color: var(--primary-cyan);
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-icon:hover {
  background: var(--primary-cyan);
  transform: translateY(-4px);
}

/* Responsive Grid */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #00D4E8;
}

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

.focus-visible:focus {
  outline: 2px solid var(--primary-cyan);
  outline-offset: 4px;
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .btn {
    display: none;
  }
}

/* Responsive Utilities */
@media (max-width: 1024px) {
  .container-custom {
    padding: 0 1.25rem;
  }

  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .container-custom {
    padding: 0 1rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .filter-tabs {
    gap: 0.5rem;
  }

  .filter-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Performance Optimizations */
.will-animate {
  will-change: transform, opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Prevent layout shifts and flickering */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling performance */
html {
  scroll-padding-top: 80px;
  -webkit-overflow-scrolling: touch;
}

/* Reduce repaints */
img, video, canvas {
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Logo aspect ratio protection */
.navbar img[alt*="Logo"],
.navbar img[src*="logo"],
.footer img[alt*="Logo"],
.footer img[src*="logo"] {
  object-fit: contain;
  aspect-ratio: auto;
  display: block;
  flex-shrink: 0;
  min-width: 0;
}

/* Additional flickering prevention */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* Force GPU acceleration for animated elements */
.navbar,
.hero-section,
.particle-canvas,
.hero-content,
.emblem-accent {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
  /* Disable particle canvas on mobile for better performance */
  .particle-canvas {
    display: none;
  }

  /* Simplify animations on mobile */
  .fade-in {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Reduce navbar blur effect on mobile */
  .navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(27, 59, 95, 0.98);
  }

  /* Optimize hero section for mobile */
  .hero-section {
    padding-top: 100px; /* More space on mobile for navbar */
  }

  /* Disable 3D transforms on mobile */
  .card-3d:hover .card-inner {
    transform: none;
  }

  /* Simpler card hover on mobile */
  .card:hover {
    transform: translateY(-4px);
  }

  /* Reduce animation complexity */
  * {
    animation-duration: 0.3s !important;
  }

  /* Exception: Keep infinite scroll at normal speed */
  .infinite-scroll-inner {
    animation-duration: 30s !important;
  }
}
