* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: #000; /* پس‌زمینه کاملاً مشکی و دارک */
  color: #e0e0e0;
  overflow-x: hidden;
}

/* Mouse Glow Effect - Similar to zafre.com */
.mouse-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.25) 0%, rgba(138, 43, 226, 0.1) 40%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.3s ease;
  filter: blur(40px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  top: -250px;
  right: -250px;
  animation: pulse 4s ease-in-out infinite;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(75, 0, 130, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -200px;
  left: -200px;
  animation: pulse 6s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #b794f6, #805ad5, #667eea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  animation: slideDown 0.8s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero p {
  font-size: 1.3rem;
  line-height: 2;
  color: #cbd5e0;
  margin-bottom: 2rem;
  animation: fadeIn 1s ease 0.3s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
  animation: fadeIn 1s ease 0.6s both;
}

.stat-item { text-align: center; }

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #b794f6, #805ad5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { color: #a0aec0; margin-top: 0.5rem; }

/* Portfolio Section */
.portfolio {
  padding: 5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  background: linear-gradient(135deg, #b794f6, #805ad5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* تغییر projects-grid به ستون و چینش یکی‌درمیان با flex */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 3rem;
  align-items: stretch;
}

/* کارت‌ها عرض محدود داشته باشند و بر اساس ترتیب راست/چپ قرار بگیرند */
.project-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(183, 148, 246, 0.2);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: rgba(183, 148, 246, 0.6);
  box-shadow: 0 20px 60px rgba(138, 43, 226, 0.4);
}

/* قبلاً project-image-long ارتفاع ثابت داشت؛ آن را طبیعی می‌کنیم */
.project-image-long {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  background-color: transparent;
  transition: transform 0.4s ease;
  margin: 0 auto;
}
.project-image-dandental,
.project-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  /* object-fit را حذف کردیم چون اندازه ثابت تعریف نمی‌کنیم */
  background-color: transparent;
  transition: transform 0.4s ease;
  margin: 0 auto; /* برای قرارگیری مرکزی در کارت */
}
/* حذف افکت بزرگ‌نمایی برای جلوگیری از کراپ شدن تصویر در حالت hover */
/* .project-card:hover .project-image { transform: scale(1.1); } */

.project-info { padding: 1.5rem; }

.project-title { font-size: 1.5rem; margin-bottom: 0.5rem; color: #b794f6; }

.project-description { color: #a0aec0; line-height: 1.6; }

.project-tags { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

.tag {
  background: rgba(183, 148, 246, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #b794f6;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  overflow-y: auto;
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal-content {
  max-width: 1400px;
  width: 100%;
  position: relative;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-modal {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(183, 148, 246, 0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-modal:hover { background: rgba(183, 148, 246, 0.4); transform: rotate(90deg); }

.device-showcase { display: flex; gap: 3rem; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-top: 2rem; }

/* Laptop Frame */
.laptop-frame { flex: 1; min-width: 600px; max-width: 900px; position: relative; }

.laptop-screen { background: #000; border-radius: 12px 12px 0 0; padding: 15px; border: 12px solid #2d3748; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }

.laptop-screen iframe { width: 100%; height: 500px; border: none; background: #fff; border-radius: 4px; }

.laptop-base { height: 25px; background: linear-gradient(to bottom, #4a5568, #2d3748); border-radius: 0 0 12px 12px; position: relative; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); }

.laptop-base::before { content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 150px; height: 10px; background: #1a202c; border-radius: 0 0 8px 8px; }

/* Phone Frame */
.phone-frame { width: 320px; background: #1a202c; border-radius: 40px; padding: 15px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); position: relative; }

.phone-notch { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); width: 140px; height: 30px; background: #000; border-radius: 0 0 20px 20px; z-index: 10; }

.phone-screen { background: #000; border-radius: 32px; overflow: hidden; height: 650px; position: relative; }

.phone-screen iframe { width: 100%; height: 100%; border: none; background: #fff; }

.modal-title { text-align: center; font-size: 2rem; margin-bottom: 1rem; color: #b794f6; }

.modal-url { text-align: center; margin-bottom: 2rem; }

.modal-url a { color: #667eea; text-decoration: none; font-size: 1.1rem; transition: color 0.3s ease; }

.modal-url a:hover { color: #b794f6; }

/* Responsive */
@media (max-width: 1200px) {
  .device-showcase { flex-direction: column; align-items: center; }
  .laptop-frame { min-width: auto; width: 100%; max-width: 700px; }
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  .hero p { font-size: 1.1rem; }
  .stats { gap: 1.5rem; }
  .stat-number { font-size: 2rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .laptop-frame { max-width: 100%; }
  .laptop-screen iframe { height: 350px; }
  .phone-frame { width: 280px; }
  .phone-screen { height: 550px; }
  .close-modal { top: 10px; right: 10px; }
  .projects-grid { gap: 1.5rem; align-items: center; }
  .project-card { max-width: 100%; align-self: stretch; }
}

/* Contact Section */
.contact {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}
.contact-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #b794f6, #805ad5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(183, 148, 246, 0.2);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  transition: all 0.3s ease;
}
.contact-item:hover {
  border-color: rgba(183, 148, 246, 0.6);
  transform: translateY(-4px);
}
.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.35) 0%, rgba(138, 43, 226, 0.15) 50%, transparent 80%);
  display: grid;
  place-items: center;
}
.contact-icon svg { width: 22px; height: 22px; fill: #ffffff; }
.contact-link {
  color: #cbd5e0;
  text-decoration: none;
  font-size: 1rem;
}
.contact-link:hover { color: #b794f6; }
.contact-item--action { cursor: pointer; user-select: none; }

@media (max-width: 768px) {
  .contact { padding: 3rem 1rem; }
  .contact-list { grid-template-columns: 1fr; }
}

/* Contact Form Modal styles */
.contact-actions .btn { margin: 0 auto; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(183, 148, 246, 0.3);
  color: #fff;
  background: rgba(183, 148, 246, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1rem;
}
.btn:hover {
  border-color: rgba(183, 148, 246, 0.6);
  background: rgba(183, 148, 246, 0.25);
}
.btn-primary {
  background: linear-gradient(135deg, #805ad5, #667eea);
  border: none;
}
.btn-primary:hover {
  filter: brightness(1.1);
}

.contact-form { max-width: 900px; margin: 0 auto; }
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { color: #cbd5e0; font-size: 0.95rem; }
.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(183, 148, 246, 0.2);
  border-radius: 10px;
  color: #e0e0e0;
  padding: 0.8rem 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: 'Vazirmatn', sans-serif;
}
.form-input:focus { border-color: rgba(183, 148, 246, 0.6); }
.form-actions { margin-top: 0.5rem; text-align: center; }

.form-message { margin-top: 1rem; text-align: center; font-size: 0.95rem; }
.form-message.success { color: #67e8f9; }
.form-message.error { color: #fca5a5; }

@media (max-width: 768px) {
  .form-row { flex-direction: column; }
}