@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");

/* =========================
   ROOT VARIABLES
========================= */
:root {
  --dark: #0a0f29;
  --gold: #d4af37;
  --accent: #ff6f61;
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #000;
  --muted: #666;
  --shadow: rgba(10, 15, 41, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   SECTION
========================= */
.section {
  max-width: 1400px;
  margin: auto;
  padding: 5rem 1.5rem;
}

/* =========================
   SECTION HEADER (CENTER)
========================= */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--dark);
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0.8rem auto 0;
}

.section-decoration {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
}

.section-decoration span {
  width: 50px;
  height: 2px;
  background: var(--gold);
}

.section-decoration .dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

/* =========================
   FILTER NAV
========================= */
.portfolio-filter {
  margin: 3rem 0;
}

.filter-nav {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.6rem;
  border-radius: 30px;
  background: transparent;
  border: 2px solid var(--dark);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

/* =========================
   PORTFOLIO GRID
========================= */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

/* =========================
   CARD
========================= */
.portfolio-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

.portfolio-card:hover {
  transform: translateY(-8px);
}

/* =========================
   IMAGE
========================= */
.card-image {
  position: relative;
  height: 220px;
  flex-shrink: 0;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================
   BADGE
========================= */
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.live-badge {
  background: var(--gold);
  color: var(--dark);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* =========================
   OVERLAY
========================= */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 41, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition);
  z-index: 1;
}

.portfolio-card:hover .card-overlay {
  opacity: 1;
}

.preview-btn {
  width: 52px;
  height: 52px;
  background: var(--white);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--dark);
  fill: none;
  stroke-width: 2;
}

/* =========================
   CONTENT
========================= */
.card-content {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* FIXED HEIGHT DESCRIPTION */
.card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.2rem;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================
   TAGS (OPTIONAL)
========================= */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.card-tags span {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* =========================
   LINK
========================= */
.card-link {
  margin-top: auto;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-link:hover {
  text-decoration: underline;
}

/* =========================
   VIEW MORE
========================= */
.view-more-container {
  text-align: center;
  margin-top: 3rem;
}

.view-more-btn {
  padding: 0.9rem 2.4rem;
  border-radius: 40px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}

/* =========================
   IMAGE MODAL (FIXED ✕ ISSUE)
========================= */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,15,41,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.image-modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  max-width: 900px;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.modal-image {
  width: 100%;
  height: 65vh;
  object-fit: contain;
}

.modal-info {
  padding: 1.2rem;
}

/* =========================
   MOBILE FIXES
========================= */
@media (max-width: 768px) {

  /* FILTER SLIDER */
  .filter-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
  }

  .filter-nav::-webkit-scrollbar {
    display: none;
  }

  /* 2 CARDS IN MOBILE */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .card-image {
    height: 160px;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}
/* =====================================================
   OVERLAY + PREVIEW BUTTON FINAL POLISH FIX
===================================================== */

/* Overlay ko perfect center + smooth banane ke liye */
.card-overlay {
  backdrop-filter: blur(2px);
}

/* Preview button proper circular + center */
.preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--white);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease, background 0.25s ease;
}

/* SVG fix */
.preview-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--dark);
  stroke-width: 2;
  transition: stroke 0.25s ease;
}

/* Hover effect (desktop) */
.portfolio-card:hover .preview-btn {
  background: var(--gold);
  transform: scale(1.1);
}

.portfolio-card:hover .preview-btn svg {
  stroke: var(--white);
}

/* Prevent icon jumping */
.preview-btn svg {
  pointer-events: none;
}

/* =========================
   MOBILE FIX
========================= */
@media (max-width: 768px) {
  .preview-btn {
    width: 48px;
    height: 48px;
  }

  .preview-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* =========================
   TOUCH DEVICES (NO HOVER BUG)
========================= */
@media (hover: none) {
  .card-overlay {
    opacity: 1;
  }
}
