/* ==========================================
   PORTFOLIO SECTION
========================================== */

.portfolio {
  padding: 40px 0;

  background: linear-gradient(180deg, #f8fbff, #eef6ff);
}

.portfolio .section-tag,
.portfolio .section-title,
.portfolio .section-subtitle {
  text-align: center;

  display: block;
}

/* ==========================================
   SEARCH
========================================== */

.portfolio-search {
  width: min(650px, 100%);

  margin: 45px auto 30px;

  position: relative;
}

.portfolio-search input {
  width: 100%;

  height: 60px;

  border-radius: 50px;

  padding: 0 60px 0 25px;

  background: var(--bg-light);

  border: 1px solid var(--border);

  font-size: 16px;

  box-shadow: var(--shadow-sm);

  transition: 0.35s;
}

.portfolio-search input:focus {
  border-color: var(--primary);

  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.portfolio-search i {
  position: absolute;

  right: 25px;

  top: 50%;

  transform: translateY(-50%);

  color: var(--primary);

  font-size: 18px;
}

/* ==========================================
   FILTER BUTTONS
========================================== */

.portfolio-filter {
  display: flex;

  justify-content: center;

  align-items: center;

  flex-wrap: wrap;

  gap: 15px;

  margin-bottom: 55px;
}

.portfolio-filter button {
  padding: 12px 22px;

  border-radius: 30px;

  border: 1px solid var(--border);

  background: var(--bg-light);

  color: var(--text);

  font-weight: 600;

  cursor: pointer;

  transition: 0.35s;

  box-shadow: var(--shadow-sm);
}

.portfolio-filter button:hover {
  transform: translateY(-3px);

  background: var(--primary);

  color: #fff;
}

.portfolio-filter button.active {
  background: var(--primary);

  color: #fff;
}

/* ==========================================
   GRID
========================================== */

.portfolio-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 35px;
}

/* ==========================================
   PROJECT CARD
========================================== */

.project-card {
  background: var(--bg-light);

  border-radius: 22px;

  overflow: hidden;

  border: 1px solid var(--border);

  box-shadow: var(--shadow-sm);

  transition: 0.35s;

  display: flex;

  flex-direction: column;

  height: 100%;
}

.project-card:hover {
  transform: translateY(-10px);

  box-shadow: var(--shadow-lg);
}

/* ==========================================
   IMAGE
========================================== */

.project-image {
  position: relative;

  height: 240px;

  overflow: hidden;
}

.project-image img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: 0.45s;
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

/* ==========================================
   FEATURED BADGE
========================================== */

.featured {
  position: absolute;

  top: 18px;

  left: 18px;

  background: linear-gradient(135deg, #2563eb, #3b82f6);

  color: #fff;

  padding: 8px 16px;

  border-radius: 30px;

  font-size: 13px;

  font-weight: 600;

  box-shadow: var(--shadow-sm);
}

/* ==========================================
   CONTENT
========================================== */

.project-content {
  padding: 28px;

  display: flex;

  flex-direction: column;

  flex: 1;
}

.project-content h3 {
  font-size: 22px;

  margin-bottom: 12px;
}

.project-content p {
  color: var(--text-light);

  margin-bottom: 22px;

  line-height: 1.7;
}

/* ==========================================
   TECH STACK
========================================== */

.stack {
  display: flex;

  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 25px;
}

.stack span {
  padding: 8px 14px;

  border-radius: 25px;

  background: #eef5ff;

  color: var(--primary);

  font-size: 13px;

  font-weight: 600;

  transition: 0.3s;
}

.stack span:hover {
  background: var(--primary);

  color: #fff;
}

/* ==========================================
   PRICE
========================================== */

.price {
  display: flex;

  align-items: center;

  gap: 14px;

  margin-top: auto;

  margin-bottom: 25px;
}

.old {
  text-decoration: line-through;

  color: #9ca3af;

  font-size: 16px;
}

.offer {
  color: var(--primary);

  font-size: 28px;

  font-weight: 700;
}

/* ==========================================
   BUTTONS
========================================== */

.project-buttons {
  display: flex;

  gap: 15px;
}

.project-buttons a,
.project-buttons button {
  flex: 1;

  height: 48px;

  display: flex;

  justify-content: center;

  align-items: center;

  border-radius: 12px;

  font-weight: 600;

  transition: 0.35s;
}

.project-buttons a {
  background: var(--primary);

  color: #fff;
}

.project-buttons a:hover {
  background: var(--primary-dark);
}

.project-buttons button {
  background: transparent;

  border: 1px solid var(--border);

  color: var(--text);
}

.project-buttons button:hover {
  background: var(--primary);

  color: #fff;

  border-color: var(--primary);
}

/* ==========================================
   PROJECT IMAGE OVERLAY
========================================== */

.project-image::after {
  content: "";

  position: absolute;

  inset: 0;

  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));

  opacity: 0;

  transition: 0.35s;
}

.project-card:hover .project-image::after {
  opacity: 1;
}

/* ==========================================
   CARD GLOW
========================================== */

.project-card {
  position: relative;
}
.project-card {
  position: relative;

  overflow: hidden;
}

.project-card:hover {
  border-color: var(--primary);

  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.18);
}
/* ==========================================
   BUTTON ANIMATION
========================================== */

.project-buttons a,
.project-buttons button {
  overflow: hidden;

  position: relative;
}

.project-buttons a::before,
.project-buttons button::before {
  content: "";

  position: absolute;

  top: 0;

  left: -120%;

  width: 100%;

  height: 100%;

  background: rgba(255, 255, 255, 0.18);

  transform: skewX(-25deg);

  transition: 0.55s;
}

.project-buttons a:hover::before,
.project-buttons button:hover::before {
  left: 120%;
}

/* ==========================================
   SEARCH PLACEHOLDER
========================================== */

.portfolio-search input::placeholder {
  color: #94a3b8;
}

/* ==========================================
   SMOOTH CARD ENTRY
========================================== */

.project-card {
  animation: portfolioFade 0.6s ease;
}

@keyframes portfolioFade {
  from {
    opacity: 0;

    transform: translateY(25px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 1200px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .portfolio {
    padding: 80px 0;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;

    gap: 25px;
  }

  .project-image {
    height: 220px;
  }

  .project-content {
    padding: 22px;
  }

  .project-content h3 {
    font-size: 20px;
  }

  .project-buttons {
    flex-direction: column;
  }

  .portfolio-filter {
    gap: 10px;
  }

  .portfolio-filter button {
    padding: 10px 18px;

    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .portfolio-search input {
    height: 54px;

    font-size: 15px;
  }

  .project-image {
    height: 190px;
  }

  .offer {
    font-size: 24px;
  }
}

/* ==========================================
   DARK MODE
========================================== */

body.dark .portfolio {
  background: linear-gradient(180deg, #08101f, #101c31);
}

body.dark .project-card {
  background: var(--bg-light);

  border-color: #223048;
}

body.dark .stack span {
  background: #162338;
}

body.dark .portfolio-filter button {
  background: #162338;

  border-color: #223048;
}

body.dark .portfolio-search input {
  background: #162338;

  color: #fff;

  border-color: #223048;
}

/* ==========================================
   ACCESSIBILITY
========================================== */

.project-buttons a:focus,
.project-buttons button:focus,
.portfolio-filter button:focus,
.portfolio-search input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.25);

  outline-offset: 3px;
}
/* =======================================
MODAL
======================================= */

.portfolio-modal {
  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.65);

  display: none;

  justify-content: center;

  align-items: center;

  padding: 30px;

  z-index: 99999;
}

.portfolio-modal.active {
  display: flex;
}

.portfolio-modal-box {
  width: min(1100px, 100%);

  background: var(--bg-light);

  border-radius: 20px;

  overflow: hidden;

  display: grid;

  grid-template-columns: 1fr 1fr;

  position: relative;

  animation: modalOpen 0.35s ease;
}

@keyframes modalOpen {
  from {
    opacity: 0;

    transform: scale(0.9);
  }

  to {
    opacity: 1;

    transform: scale(1);
  }
}

.modal-image img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  display: block;
}

.modal-content {
  padding: 40px;

  display: flex;

  flex-direction: column;
}

.modal-content h2 {
  margin-bottom: 18px;
}

.modal-content p {
  color: var(--text-light);

  margin-bottom: 25px;

  line-height: 1.8;
}

.modal-tech {
  display: flex;

  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 30px;
}

.modal-tech span {
  padding: 10px 18px;

  background: #eef5ff;

  border-radius: 30px;

  font-size: 14px;

  font-weight: 600;
}

.modal-price {
  display: flex;

  gap: 18px;

  align-items: center;

  margin-bottom: 30px;
}

.modal-price span:first-child {
  text-decoration: line-through;

  color: #888;
}

.modal-price span:last-child {
  font-size: 32px;

  font-weight: 700;

  color: var(--primary);
}

.modal-buttons {
  display: flex;

  gap: 15px;

  margin-top: auto;
}

.modal-buttons a,
.modal-buttons button {
  flex: 1;

  height: 52px;

  display: flex;

  justify-content: center;

  align-items: center;

  border-radius: 12px;

  font-weight: 600;

  cursor: pointer;
}

.modal-buttons a {
  background: var(--primary);

  color: #fff;
}

.modal-buttons button {
  border: 1px solid var(--border);

  background: none;
}

.modal-close {
  position: absolute;

  top: 18px;

  right: 18px;

  width: 42px;

  height: 42px;

  border-radius: 50%;

  background: white;

  box-shadow: var(--shadow-md);

  cursor: pointer;
}

@media (max-width: 900px) {
  .portfolio-modal-box {
    grid-template-columns: 1fr;
  }

  .modal-image {
    height: 260px;
  }
}

@media (max-width: 600px) {
  .modal-content {
    padding: 25px;
  }

  .modal-buttons {
    flex-direction: column;
  }
}
