.yasacode-portfolio-new {
  background: var(--dark-bg);
  color: var(--text-primary);
  overflow-x: hidden;
  direction: rtl;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.portfolio-hero {
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(93, 63, 211, 0.12);
  border: 1px solid rgba(93, 63, 211, 0.25);
  border-radius: 100px;
  padding: 8px 24px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
}

.badge-icon svg {
  color: var(--primary-color);
}

.badge-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: "Vazir", sans-serif;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.title-gradient {
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--primary-color) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-highlight {
  color: var(--primary-color);
  position: relative;
}

.title-highlight::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  opacity: 0.3;
  border-radius: 3px;
}

.hero-description {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.8;
  font-family: "Vazir", sans-serif;
}

.portfolio-grid-section {
  padding: 60px 0 80px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.project-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.project-card-inner:hover {
  transform: translateY(-8px);
  border-color: rgba(93, 63, 211, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.project-image {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-inner:hover .project-image img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85),
    rgba(93, 63, 211, 0.2),
    transparent
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 25px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-card-inner:hover .image-overlay {
  opacity: 1;
}

.overlay-content {
  text-align: center;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.project-card-inner:hover .overlay-content {
  transform: translateY(0);
}

.project-category {
  display: inline-block;
  background: rgba(93, 63, 211, 0.9);
  backdrop-filter: blur(10px);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  color: white;
  font-weight: 600;
  margin-bottom: 12px;
  font-family: "Vazir", sans-serif;
}

.view-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: none;
  border-radius: 40px;
  padding: 10px 24px;
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Vazir", sans-serif;
}

.view-project-btn:hover {
  gap: 12px;
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.project-info {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-header {
  margin-bottom: 12px;
}

.project-category-badge {
  display: inline-block;
  background: rgba(93, 63, 211, 0.12);
  border: 1px solid rgba(93, 63, 211, 0.2);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 10px;
  font-family: "Vazir", sans-serif;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  transition: color 0.3s ease;
  font-family: "Vazir", sans-serif;
}

.project-card-inner:hover .project-title {
  color: var(--primary-color);
}

.project-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 12px 0 16px;
  font-family: "Vazir", sans-serif;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tech-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  font-family: "Vazir", sans-serif;
}

.tech-tag:hover {
  background: rgba(93, 63, 211, 0.15);
  border-color: rgba(93, 63, 211, 0.3);
  color: var(--primary-color);
}

.portfolio-cta {
  padding: 80px 0;
  background: linear-gradient(
    135deg,
    rgba(93, 63, 211, 0.06),
    rgba(123, 104, 238, 0.02)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cta-content {
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(93, 63, 211, 0.12);
  border: 1px solid rgba(93, 63, 211, 0.25);
  border-radius: 50px;
  padding: 6px 20px;
  margin-bottom: 20px;
}

.cta-badge .badge-icon {
  font-size: 1rem;
}

.cta-badge .badge-text {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
}

.cta-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.cta-title .title-line {
  display: block;
}

.cta-title .title-highlight {
  color: var(--primary-color);
}

.cta-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 32px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  font-family: "Vazir", sans-serif;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: "Vazir", sans-serif;
}

.cta-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  box-shadow: 0 8px 25px rgba(93, 63, 211, 0.3);
}

.cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(93, 63, 211, 0.5);
  gap: 14px;
}

.cta-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-secondary:hover {
  background: rgba(93, 63, 211, 0.1);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  gap: 14px;
}

.portfolio-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.portfolio-modal.active {
  visibility: visible;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.96);
  backdrop-filter: blur(25px);
}

.modal-container {
  position: relative;
  max-width: 1100px;
  width: 90%;
  max-height: 85vh;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 36, 0.98),
    rgba(18, 18, 26, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.portfolio-modal.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.modal-close:hover {
  background: rgba(93, 63, 211, 0.2);
  border-color: var(--primary-color);
  transform: rotate(90deg);
}

.modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-gallery {
  background: linear-gradient(135deg, #12121a, #1a1a24);
  padding: 30px;
  position: relative;
}

.modal-main-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
}

.modal-main-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.gallery-nav:hover {
  background: var(--primary-color);
  transform: translateY(-50%) scale(1.05);
}

.gallery-nav.prev {
  left: 16px;
}

.gallery-nav.next {
  right: 16px;
}

.modal-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.modal-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.modal-thumbnails::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.thumbnail-item {
  width: 75px;
  height: 55px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.thumbnail-item.active {
  opacity: 1;
  border-color: var(--primary-color);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-item:hover {
  opacity: 0.8;
  transform: scale(1.03);
}

.modal-info {
  padding: 35px;
  overflow-y: auto;
}

.modal-info::-webkit-scrollbar {
  width: 4px;
}

.modal-info::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.modal-info::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-family: "Vazir", sans-serif;
}

.modal-category {
  display: inline-block;
  background: rgba(93, 63, 211, 0.15);
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 500;
  font-family: "Vazir", sans-serif;
}

.modal-meta {
  display: flex;
  gap: 28px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: "Vazir", sans-serif;
}

.meta-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Vazir", sans-serif;
}

.modal-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Vazir", sans-serif;
}

.modal-info h4::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 2px;
}

.modal-info p {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.9rem;
  margin-bottom: 22px;
  font-family: "Vazir", sans-serif;
}

.modal-technologies {
  margin-bottom: 22px;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-features {
  margin-bottom: 28px;
}

.modal-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-features li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
  padding-right: 22px;
  position: relative;
  line-height: 1.6;
  font-family: "Vazir", sans-serif;
}

.modal-features li::before {
  content: "✓";
  position: absolute;
  right: 0;
  color: var(--primary-color);
}

.modal-footer {
  display: flex;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-link-btn,
.contact-link-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: "Vazir", sans-serif;
}

.project-link-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
}

.project-link-btn:hover {
  gap: 14px;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(93, 63, 211, 0.4);
}

.contact-link-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.contact-link-btn:hover {
  background: rgba(93, 63, 211, 0.1);
  border-color: var(--primary-color);
  gap: 14px;
}

@media (max-width: 1024px) {
  .projects-grid {
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    grid-template-columns: 1fr;
  }

  .modal-gallery {
    max-height: 380px;
  }

  .modal-info {
    max-height: 50vh;
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .portfolio-hero {
    padding: 90px 0 50px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .project-image {
    height: 220px;
  }

  .modal-container {
    width: 95%;
    max-height: 90vh;
  }

  .modal-meta {
    flex-wrap: wrap;
    gap: 16px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .modal-gallery {
    padding: 20px;
  }

  .modal-info {
    padding: 22px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .thumbnail-item {
    width: 60px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .project-info {
    padding: 18px;
  }

  .project-title {
    font-size: 1.1rem;
  }

  .project-excerpt {
    font-size: 0.8rem;
  }

  .modal-gallery {
    padding: 16px;
  }

  .modal-info {
    padding: 18px;
  }

  .thumbnail-item {
    width: 50px;
    height: 38px;
  }

  .gallery-nav {
    width: 36px;
    height: 36px;
  }
}

@media print {
  .portfolio-hero,
  .portfolio-cta,
  .portfolio-modal,
  .hero-bg-perfect {
    display: none !important;
  }

  .projects-grid {
    display: block;
  }

  .project-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .project-card-inner {
    border: 1px solid #ddd;
    background: white;
  }

  .project-title {
    color: #000;
  }
}
