:root {
  --color-primary: #003876;
  --color-secondary: #C41E3A;
  --color-dark: #0f172a;
  --color-light: #f8fafc;
}

/* Custom Animations */
@keyframes zoom-slow {
  0% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1.15);
  }
}

.animate-zoom-slow {
  animation: zoom-slow 20s linear infinite alternate;
}

/* Video Overlay */
.video-overlay {
  background: linear-gradient(45deg, rgba(0, 56, 118, 0.85), rgba(196, 30, 58, 0.85));
}

/* Scroll Indicator Animation */
@keyframes scroll-dot {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(20px);
    opacity: 0;
  }
}

.scroll-indicator-dot {
  animation: scroll-dot 1.5s ease-in-out infinite;
}

/* Partner Logo Effects */
.partner-logo {
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
}

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

/* Stats Section Background */
.stats-section {
  background-image: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
}

/* Video Play Button */
.play-button {
  background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
  box-shadow: 0 0 0 0 rgba(0, 56, 118, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 56, 118, 0.3);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 20px rgba(0, 56, 118, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 56, 118, 0);
  }
}

/* Hover Effects */
.hover-scale {
  transition: transform 0.3s ease;
}

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

/* Underline Animation */
.underline-animation {
  position: relative;
}

.underline-animation::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
  transition: width 0.3s ease;
}

.underline-animation:hover::after {
  width: 100%;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Gradient Border */
.gradient-border {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(45deg, var(--color-primary), var(--color-secondary)) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}

@keyframes float-smooth {

  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) translateX(5px) rotate(1deg);
  }

  50% {
    transform: translateY(-5px) translateX(-5px) rotate(-1deg);
  }

  75% {
    transform: translateY(-8px) translateX(3px) rotate(0.5deg);
  }
}

.animate-float-smooth {
  animation: float-smooth 8s ease-in-out infinite;
}

.hover-scale {
  transition: transform 0.3s ease;
}

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

@keyframes float-smooth {

  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  25% {
    transform: translateY(-15px) translateX(5px) rotate(1deg);
  }

  50% {
    transform: translateY(-10px) translateX(-5px) rotate(-1deg);
  }

  75% {
    transform: translateY(-12px) translateX(3px) rotate(0.5deg);
  }
}

.animate-float-smooth {
  animation: float-smooth 6s ease-in-out infinite;
  will-change: transform;
  /* لتحسين الأداء */
}

/* ========================================
   Responsive Design Enhancements
   ======================================== */

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Container responsive padding */
.container {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Responsive text sizes */
@media (max-width: 640px) {
  h1 {
    font-size: 1.875rem !important; /* 30px */
    line-height: 2.25rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important; /* 24px */
    line-height: 2rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important; /* 20px */
    line-height: 1.75rem !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  h1 {
    font-size: 2.25rem !important; /* 36px */
    line-height: 2.5rem !important;
  }
  
  h2 {
    font-size: 1.875rem !important; /* 30px */
    line-height: 2.25rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important; /* 24px */
    line-height: 2rem !important;
  }
}

/* Button responsive adjustments */
@media (max-width: 640px) {
  button, .btn {
    padding: 0.625rem 1.25rem !important; /* 10px 20px */
    font-size: 0.875rem !important; /* 14px */
  }
}

/* Card responsive spacing */
@media (max-width: 768px) {
  .card, .card-container {
    margin-bottom: 1rem;
  }
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

/* Responsive grid improvements */
@media (max-width: 640px) {
  .grid {
    gap: 1rem !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid {
    gap: 1.5rem !important;
  }
}

/* Touch target size for mobile */
@media (max-width: 768px) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1279px) {
  /* Adjust nav spacing for tablet */
  nav a {
    font-size: 0.875rem;
    padding: 0.5rem;
  }
}

/* Fix video/iframe responsiveness */
video, iframe {
  max-width: 100%;
  height: auto;
}

/* Responsive table */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ========================================
   Advanced Responsive Design
   ======================================== */

/* Ensure all sections have proper padding */
section {
  padding-left: clamp(1rem, 5vw, 3rem);
  padding-right: clamp(1rem, 5vw, 3rem);
}

/* Responsive Hero Section */
.hero-section {
  min-height: 100vh;
}

@media (max-width: 640px) {
  .hero-section {
    min-height: 80vh;
  }
}

/* Responsive Grid System Enhancement */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  .sm\:grid-cols-2,
  .sm\:grid-cols-3,
  .sm\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Responsive Typography Fine-tuning */
@media (max-width: 640px) {
  p {
    font-size: 0.9375rem; /* 15px */
    line-height: 1.6;
  }
  
  .text-xl {
    font-size: 1.125rem !important; /* 18px */
  }
  
  .text-2xl {
    font-size: 1.375rem !important; /* 22px */
  }
  
  .text-3xl {
    font-size: 1.625rem !important; /* 26px */
  }
  
  .text-4xl {
    font-size: 1.875rem !important; /* 30px */
  }
  
  .text-5xl {
    font-size: 2.25rem !important; /* 36px */
  }
}

/* Responsive Spacing */
@media (max-width: 640px) {
  .py-20, .py-24 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .py-16 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  
  .py-12 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .gap-12, .gap-16 {
    gap: 2rem !important;
  }
  
  .gap-8 {
    gap: 1.5rem !important;
  }
}

/* Form Elements Responsive */
@media (max-width: 640px) {
  input, textarea, select {
    font-size: 16px !important; /* Prevent zoom on iOS */
  }
}

/* Card Component Responsive */
@media (max-width: 640px) {
  .card {
    padding: 1.25rem !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .card {
    padding: 1.5rem !important;
  }
}

/* Flex Direction Mobile First */
@media (max-width: 768px) {
  .flex-row {
    flex-direction: column !important;
  }
  
  .lg\:flex-row {
    flex-direction: column !important;
  }
}

/* Image Containers */
.img-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.img-container img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Aspect Ratio Responsive */
@media (max-width: 640px) {
  .aspect-video {
    aspect-ratio: 16 / 9;
  }
  
  .aspect-square {
    aspect-ratio: 1 / 1;
  }
}

/* Max Width Constraints */
.max-w-7xl {
  max-width: min(80rem, 90vw);
}

.max-w-6xl {
  max-width: min(72rem, 90vw);
}

.max-w-5xl {
  max-width: min(64rem, 90vw);
}

/* Overflow Prevention */
* {
  max-width: 100%;
}

html, body {
  overflow-x: hidden;
  position: relative;
}

/* Text Overflow */
.truncate-2-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3-lines {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Modal/Dialog */
@media (max-width: 640px) {
  .modal, .dialog {
    width: 95vw !important;
    max-height: 90vh !important;
    margin: 1rem !important;
  }
}

/* Footer Responsive */
@media (max-width: 768px) {
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* Partner Logos Responsive */
@media (max-width: 640px) {
  .partner-logo {
    max-width: 120px;
    height: auto;
  }
}

/* Stats Section Responsive */
@media (max-width: 640px) {
  .stats-section .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
}

/* Event Cards Responsive */
@media (max-width: 640px) {
  .event-card {
    flex-direction: column !important;
  }
  
  .event-card img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover;
  }
}

/* Board Members Grid */
@media (max-width: 640px) {
  .board-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .board-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Print Styles */
@media print {
  header, footer, .no-print {
    display: none !important;
  }
  
  body {
    color: #000;
    background: #fff;
  }
}

/* High Resolution Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
  }
  
  section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

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

/* Dark Mode Support (Future Ready) */
@media (prefers-color-scheme: dark) {
  /* Reserved for future dark mode implementation */
}

/* Ultra Wide Screens */
@media (min-width: 2560px) {
  .container, .max-w-7xl {
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
  }
}