/* =============================
   Modern Enhancements CSS
   تحسينات حديثة للتصميم
   ============================= */

/* ===== MODERN CSS FEATURES ===== */

/* Container Queries Support */
@supports (container-type: inline-size) {
  .product-card {
    container-type: inline-size;
  }
  
  @container (min-width: 400px) {
    .product-card {
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: 1.5rem;
    }
  }
}

/* Modern Grid Layouts */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  container-type: inline-size;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Advanced CSS Grid with Masonry-like effect */
.projects-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 0;
  grid-template-rows: masonry;
  gap: 1.5rem;
}

/* ===== MODERN ANIMATIONS ===== */

/* Scroll-Driven Animations */
@keyframes slide-in-from-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-from-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Animation Classes */
.animate-slide-left {
  animation: slide-in-from-left 0.8s ease-out;
}

.animate-slide-right {
  animation: slide-in-from-right 0.8s ease-out;
}

.animate-fade-up {
  animation: fade-in-up 0.6s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.5s ease-out;
}

/* Staggered Animations */
.stagger-animation > * {
  opacity: 0;
  animation: fade-in-up 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== MODERN COMPONENTS ===== */

/* Glass Morphism Cards */
.glass-card {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Neumorphism Cards */
.neumorphism-card {
  background: #f0f0f3;
  border-radius: 20px;
  box-shadow: 
    20px 20px 60px #d1d9e6,
    -20px -20px 60px #ffffff;
  transition: all 0.3s ease;
}

.neumorphism-card:hover {
  box-shadow: 
    10px 10px 30px #d1d9e6,
    -10px -10px 30px #ffffff;
  transform: translateY(-2px);
}

/* Modern Buttons */
.btn-modern {
  position: relative;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-modern::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;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* ===== MODERN FORMS ===== */

/* Floating Labels */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control-modern {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  background: white;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 91, 161, 0.1);
}

.form-label-modern {
  position: absolute;
  top: 15px;
  left: 20px;
  color: #6c757d;
  transition: all 0.3s ease;
  pointer-events: none;
  background: white;
  padding: 0 5px;
}

.form-control-modern:focus + .form-label-modern,
.form-control-modern:not(:placeholder-shown) + .form-label-modern {
  top: -10px;
  left: 15px;
  font-size: 12px;
  color: var(--primary-blue);
  font-weight: 600;
}

/* ===== MODERN LOADING STATES ===== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-image {
  height: 200px;
  border-radius: 12px;
}

/* ===== MODERN HOVER EFFECTS ===== */

/* Tilt Effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-card:hover {
  transform: rotateX(5deg) rotateY(5deg);
}

/* Magnetic Effect */
.magnetic-card {
  transition: transform 0.3s ease;
}

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

/* ===== MODERN SCROLLBAR ===== */

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
}

/* ===== MODERN SELECTION ===== */

::selection {
  background: var(--primary-blue);
  color: white;
}

::-moz-selection {
  background: var(--primary-blue);
  color: white;
}

/* ===== MODERN FOCUS STATES ===== */

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ===== MODERN RESPONSIVE ===== */

/* Aspect Ratio Boxes */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Modern Breakpoints */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (min-width: 1024px) {
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== MODERN UTILITIES ===== */

/* Spacing Utilities */
.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-8 > * + * {
  margin-top: 2rem;
}

.space-x-4 > * + * {
  margin-left: 1rem;
}

/* Text Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== MODERN 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;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .glass-card {
    background: white;
    border: 2px solid black;
  }
  
  .btn-modern {
    border: 2px solid black;
  }
}

/* ===== MODERN PRINT STYLES ===== */

@media print {
  .btn-modern,
  .whatsapp-button,
  .back-to-top {
    display: none !important;
  }
  
  .glass-card,
  .neumorphism-card {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
} 