/* 
  Premium Design System for Card Project
  Focus: Modern, High-End, User-Centric
*/

@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap");

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.4);
  --surface: #ffffff;
  --background: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-premium:
    0 20px 25px -5px rgba(0, 0, 0, 0.03), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", sans-serif;
  color: var(--text-main);
  background-color: var(--background);
  background-image:
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.03) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.03) 0, transparent 50%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-soft {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}
.animate-slide-in {
  animation: slideIn 0.8s ease-out forwards;
}

/* Custom Scrollbar - Minimalist */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* Glassmorphism Classes */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* Premium Card Style */
.premium-card {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  box-shadow: var(--shadow-premium);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.premium-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

/* Gallery Selected State & Interaction */
.template-item {
  transition: all 0.3s ease;
}
.template-item img {
  border: 3px solid transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.template-item:hover img {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.selected-image {
  border-color: var(--accent) !important;
  transform: scale(1.03) !important;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 15px 30px -10px rgba(37, 99, 235, 0.3);
}

/* Canvas Pattern */
.canvas-bg-pattern {
  background-color: var(--background);
  background-image:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0px;
}

/* Custom Range Input */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 10px;
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 4px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  transition: all 0.2s;
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.5);
}

/* Step Indicators */
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Inputs */
.premium-input {
  transition: all 0.3s ease;
  border: 1.5px solid #e2e8f0;
}
.premium-input:focus {
  border-color: var(--accent);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* RTL Support */
[dir="rtl"] .animate-slide-in {
  animation-name: slideInRTL;
}
@keyframes slideInRTL {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Cursors */
.crosshair-cursor {
  cursor: crosshair;
}
.grabbing-cursor {
  cursor: grabbing !important;
}
.grab-cursor {
  cursor: grab;
}
