/* 
 * Modern & Minimal Design System
 * Enhanced styling for the entire website
 */

/* ==================== ENHANCED VARIABLES ==================== */
:root {
  /* Primary Colors - Gradient Purple Theme */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-light: #8b9bff;
  --primary-dark: #5568d3;
  
  /* Secondary Colors */
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-color: #4facfe;
  
  /* Neutral Colors */
  --white: #ffffff;
  --black: #1a1a2e;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-sans: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Vazir', sans-serif;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL ENHANCEMENTS ==================== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

body {
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* ==================== SMOOTH SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #667eea transparent;
}

/* ==================== ENHANCED BUTTONS ==================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn:hover::before {
  opacity: 1;
}

.btn-blue,
.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-blue:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-black {
  background: var(--gray-900);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-black:hover {
  background: var(--gray-800);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ==================== ENHANCED CARDS ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid var(--gray-100);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
  border-color: var(--primary-light);
}

.card-gradient {
  background: var(--primary-gradient);
  color: var(--white);
}

.card-gradient:hover {
  box-shadow: var(--shadow-2xl), var(--shadow-glow);
}

/* ==================== ENHANCED INPUTS ==================== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--white);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

/* ==================== ENHANCED BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: var(--primary-dark);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* ==================== ENHANCED SECTIONS ==================== */
section {
  position: relative;
  padding: var(--space-3xl) 0;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: var(--space-2xl);
  line-height: 1.2;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 0;
  width: 60%;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

/* ==================== ENHANCED GRID ==================== */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ==================== ENHANCED ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease-out;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ==================== ENHANCED IMAGES ==================== */
img {
  max-width: 100%;
  height: auto;
}

/* فقط برای تصاویر خاص display: block */
.project-item img,
.about-col-left img,
.hero-inner img,
.modal-image img {
  display: block;
}

/* تصاویر owl carousel باید visible باشند */
.owl-carousel img,
.testmonial-slider img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.img-rounded {
  border-radius: var(--radius-xl);
}

.img-circle {
  border-radius: var(--radius-full);
}

.img-shadow {
  box-shadow: var(--shadow-lg);
}

.img-hover {
  transition: all var(--transition-base);
}

.img-hover:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

/* ==================== ENHANCED LINKS ==================== */
a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--primary-light);
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* ==================== ENHANCED ALERTS ==================== */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  border-right: 4px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--info);
  color: var(--info);
}

/* ==================== ENHANCED LOADING ==================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-dark);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== ENHANCED TOOLTIPS ==================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%) translateY(-8px);
  padding: var(--space-sm) var(--space-md);
  background: var(--gray-900);
  color: var(--white);
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: 1000;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(50%) translateY(-4px);
}

/* ==================== ENHANCED MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-lg);
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: fadeInUp 0.3s ease-out;
}

/* ==================== RESPONSIVE UTILITIES ==================== */
@media (max-width: 768px) {
  :root {
    --space-3xl: 2rem;
    --space-2xl: 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ==================== UTILITY CLASSES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-bg {
  background: var(--primary-gradient);
  color: var(--white);
}
