/* Main Styles */
body {
  font-family: "Cairo", ui-sans-serif, system-ui;
}

html {
  scroll-behavior: smooth;
}

.grain:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.15'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0.22;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.9);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  min-width: 320px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
  backdrop-filter: blur(10px);
}

.toast.success {
  background: rgba(16, 185, 129, 0.95);
  color: white;
}

.toast.error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.toast.info {
  background: rgba(99, 102, 241, 0.95);
  color: white;
}

.toast.warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

.toast.fade-out {
  animation: slideOut 0.3s ease-out forwards;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Validation */
.form-error {
  border-color: rgba(239, 68, 68, 0.6) !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
}

.form-success {
  border-color: rgba(16, 185, 129, 0.6) !important;
}

.error-message {
  color: rgba(239, 68, 68, 0.9);
  font-size: 0.75rem;
  margin-top: 4px;
  display: block;
}

/* Smooth transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Enhanced button ripple effect */
button, a[role="button"], .btn {
  position: relative;
  overflow: hidden;
}

button::after, a[role="button"]::after, .btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

button:active::after, a[role="button"]:active::after, .btn:active::after {
  width: 300px;
  height: 300px;
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.scroll-to-top:hover {
  background: rgba(99, 102, 241, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.visible {
  display: flex;
}

/* Filter tags */
.filter-tag {
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tag.active {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: rgba(99, 102, 241, 0.9) !important;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Org card hover effect */
.org-card {
  transition: all 0.3s ease;
}

.org-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Organization Logo Cards */
.org-logo-card {
  min-height: 180px;
  aspect-ratio: 1;
  transition: all 0.3s ease;
}

.org-logo-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.org-logo-card img {
  filter: grayscale(20%);
  transition: all 0.3s ease;
}

.org-logo-card:hover img {
  filter: grayscale(0%);
}

/* Organizations Carousel Styles */
.orgs-carousel {
  padding: 10px 60px 60px 60px !important;
  overflow: visible;
}

.orgs-carousel .swiper-slide {
  height: auto;
  display: flex;
}

.orgs-carousel .swiper-button-next,
.orgs-carousel .swiper-button-prev {
  color: #6366f1;
  background: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.orgs-carousel .swiper-button-next:after,
.orgs-carousel .swiper-button-prev:after {
  font-size: 18px;
  font-weight: bold;
}

.orgs-carousel .swiper-button-next:hover,
.orgs-carousel .swiper-button-prev:hover {
  background: #6366f1;
  color: white;
  transform: scale(1.1);
}

.dark .orgs-carousel .swiper-button-next,
.dark .orgs-carousel .swiper-button-prev {
  background: rgba(255, 255, 255, 0.1);
  color: #818cf8;
}

.dark .orgs-carousel .swiper-button-next:hover,
.dark .orgs-carousel .swiper-button-prev:hover {
  background: #6366f1;
  color: white;
}

.orgs-carousel .swiper-pagination {
  bottom: 0 !important;
}

.orgs-carousel .swiper-pagination-bullet {
  background: #6366f1;
  opacity: 0.3;
  width: 10px;
  height: 10px;
  transition: all 0.3s ease;
}

.orgs-carousel .swiper-pagination-bullet-active {
  opacity: 1;
  width: 24px;
  border-radius: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .orgs-carousel {
    padding: 10px 50px 60px 50px !important;
  }
  
  .orgs-carousel .swiper-button-next,
  .orgs-carousel .swiper-button-prev {
    width: 36px;
    height: 36px;
  }
  
  .orgs-carousel .swiper-button-next:after,
  .orgs-carousel .swiper-button-prev:after {
    font-size: 14px;
  }
  
  .org-logo-card {
    min-height: 180px;
  }
  
  .org-logo-card img {
    max-height: 32px !important;
    width: 100% !important;
  }
}

@media (max-width: 640px) {
  .orgs-carousel {
    padding: 10px 40px 60px 40px !important;
  }
  
  .org-logo-card {
    min-height: 160px;
    padding: 0 !important;
  }
  
  .org-logo-card img {
    max-height: 125px !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .org-logo-card img {
    max-height: 125px !important;
    width: 100% !important;
  }
}

/* Search input */
.search-input {
  transition: all 0.3s ease;
}

.search-input:focus {
  transform: scale(1.02);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.dark .loading-overlay {
  background: rgba(15, 23, 42, 0.9);
}

.loading-overlay.active {
  display: flex;
}

/* Testimonial Cards */
.testimonial-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
  pointer-events: none;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* FAQ Accordion */
.faq-item {
  transition: all 0.3s ease;
}

.faq-question {
  cursor: pointer;
  user-select: none;
}

.faq-icon {
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  display: block;
  padding-top: 0;
}

/* Partner Logos */
.partner-logo {
  transition: all 0.3s ease;
  cursor: pointer;
}

.partner-logo:hover {
  transform: scale(1.05);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Navigation Active State */
.nav-link {
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to left, rgba(99, 102, 241, 1), rgba(16, 185, 129, 1));
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: rgba(99, 102, 241, 1);
  font-weight: 600;
}


/* Gradient Text Animation */
@keyframes gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gradient-text {
  background: linear-gradient(-45deg, #6366f1, #10b981, #ec4899, #6366f1);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 8s ease infinite;
}

/* Card Glow Effect */
.card-glow {
  position: relative;
}

.card-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, rgba(99, 102, 241, 0.3), rgba(16, 185, 129, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-glow:hover::after {
  opacity: 1;
}

/* Smooth Scroll Indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  right: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 1), rgba(16, 185, 129, 1));
  z-index: 9999;
  transition: height 0.1s ease;
}

/* Enhanced Input Focus */
input:focus, textarea:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Pulse Animation for CTAs */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
}

.pulse-cta {
  animation: pulse-glow 2s infinite;
}

/* Section Dividers */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.3), transparent);
  margin: 4rem 0;
}

/* Logo SVG Styles */
.logo-svg {
  height: 50px;
  width: auto;
  max-width: 280px;
  display: block;
  object-fit: contain;
}

/* Responsive logo sizing */
@media (max-width: 640px) {
  .logo-svg {
    height: 40px;
    max-width: 220px;
  }
}

