:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2c3e50;
  --secondary-light: #34495e;
  --accent-color: #e74c3c;
  --light-color: #f7f9fc;
  --dark-color: #333;
  --success-color: #d4edda;
  --success-border: #c3e6cb;
  --success-text: #155724;
  --error-color: #f8d7da;
  --error-border: #f5c6cb;
  --error-text: #721c24;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.8;
}

header {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
  color: white;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.05)" d="M0,0 L100,0 L100,100 L0,100 Z" /></svg>');
  background-size: cover;
  z-index: 1;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  position: relative;
  z-index: 2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

nav {
  background-color: var(--secondary-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 15px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 5px 15px;
  padding: 10px 20px;
  transition: var(--transition);
  border-radius: 30px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

nav a i {
  margin-left: 8px;
}

nav a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

nav a.active {
  background-color: var(--primary-color);
}

section {
  max-width: 1200px;
  margin: 40px auto;
  background-color: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

section:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.about-me {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
}

.profile-img {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  object-fit: cover;
  border: 5px solid var(--primary-color);
  transition: var(--transition);
}

.profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.about-me div {
  flex: 1;
  text-align: justify;
  min-width: 300px;
}

h2 {
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 10px;
  margin-top: 40px;
  font-size: 1.8rem;
  color: var(--secondary-color);
  position: relative;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: 0;
  width: 100px;
  height: 3px;
  background-color: var(--accent-color);
}

ul {
  padding-right: 20px;
  list-style-type: none;
}

ul li {
  margin-bottom: 15px;
  position: relative;
  padding-right: 25px;
}

ul li::before {
  content: "→";
  position: absolute;
  right: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.contact-form, .contact-info {
  flex: 1;
  min-width: 300px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  position: relative;
}

input, textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

input[type="submit"] {
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 15px;
  transition: var(--transition);
}

input[type="submit"]:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.captcha-container {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.captcha-question {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.captcha-question span:first-child {
  font-weight: bold;
}

.captcha-numbers {
  font-size: 1.2rem;
}

.captcha-container input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 5px;
}

.captcha-container small {
  display: block;
  margin-top: 5px;
  color: #666;
}

.form-message {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid;
}

.form-message.success {
  background-color: var(--success-color);
  color: var(--success-text);
  border-color: var(--success-border);
}

.form-message.error {
  background-color: var(--error-color);
  color: var(--error-text);
  border-color: var(--error-border);
}

.contact-info p {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.contact-info i {
  color: var(--primary-color);
  margin-left: 10px;
  width: 20px;
}

.working-hours {
  margin-top: 30px;
}

.working-hours h4 {
  margin-bottom: 10px;
  color: var(--secondary-color);
}

footer {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
  color: white;
  text-align: center;
  padding: 30px;
  margin-top: 60px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.social-links a {
  color: white;
  font-size: 1.5rem;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--primary-color);
  transform: translateY(-5px);
}

.footer-credit {
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.skill {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.skill:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.project-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.project-content {
  padding: 20px;
}

.project-title {
  font-size: 1.2rem;
  margin: 0 0 10px;
  color: var(--secondary-color);
}

.project-desc {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.project-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.floating-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background-color: var(--primary-color);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: var(--transition);
  text-decoration: none;
}

.floating-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.1);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  right: 50%;
  margin-right: -2px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: white;
  border: 4px solid var(--primary-color);
  border-radius: 50%;
  top: 15px;
  z-index: 1;
}

.right {
  right: 0;
}

.right::after {
  left: -12px;
}

.left {
  right: 50%;
}

.left::after {
  right: -12px;
}

.timeline-content {
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.timeline-date {
  font-weight: bold;
  color: var(--primary-color);
}

.timeline-title {
  margin: 10px 0;
  color: var(--secondary-color);
}

.back-to-top {
  position: fixed;
  bottom: 100px;
  left: 30px;
  background-color: var(--secondary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  text-decoration: none;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-light);
  transform: scale(1.1);
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'),
       url('fonts/Vazirmatn-Regular.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'),
       url('fonts/Vazirmatn-Bold.woff') format('woff');
  font-weight: bold;
  font-display: swap;
}




/* انیمیشن‌ها */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

section {
  animation: fadeIn 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .about-me {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-img {
    width: 200px;
    height: 200px;
  }
  
  .timeline::after {
    right: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-right: 70px;
    padding-left: 25px;
  }
  
  .timeline-item::after {
    left: 15px;
  }
  
  .left, .right {
    right: auto;
  }
  
  .contact-container {
    gap: 20px;
  }
  
  .floating-btn, .back-to-top {
    bottom: 20px;
    left: 20px;
  }
  
  .back-to-top {
    bottom: 90px;
  }
}

@media (max-width: 480px) {
  nav a {
    margin: 3px 8px;
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  section {
    padding: 20px;
    margin: 20px auto;
  }
  
  .floating-btn, .back-to-top {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}