/* =====================================================
   PROJECTS — Minimal Bento Grid & Expandable Modal
   ===================================================== */

.projects {
  padding: 2rem 1.5rem 5rem;
  background-color: var(--primary-bg-color);
}

/* ── Filter Tabs ── */
.project-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 1rem 2rem;
  flex-wrap: wrap;
  max-width: 1040px;
  margin: 0 auto;
}

.filter-tab {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--secondry-bg-color);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-tab .tab-count {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
}

.filter-tab:hover {
  border-color: var(--orange-border);
  color: var(--main-color);
  background: var(--main-color-light);
}

.filter-tab.active {
  background: var(--main-color-light);
  border-color: var(--main-color);
  color: var(--main-color);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--orange-glow);
}

.filter-tab.active .tab-count {
  background: var(--main-color);
  color: #ffffff;
}

/* ── Projects Container ── */
#projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1040px;
  margin: 0 auto;
}

/* Base Project Card */
.project-card {
  background: var(--secondry-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: default;
}

.project-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--orange-border);
}

/* Image / Thumbnail Area */
.project-image {
  position: relative;
  overflow: hidden;
  height: 180px;
  background: radial-gradient(circle at center, rgba(249, 115, 22, 0.035) 0%, rgba(244, 240, 234, 0.55) 100%), #fdfcfb;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
}

.project-img {
  max-height: 124px;
  max-width: 85%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-img {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.12), 0 4px 10px rgba(28, 25, 23, 0.06);
}

/* Quick hover overlay buttons */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
  padding: 1rem;
}

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

.overlay-btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-play {
  background: #059669;
  color: #fff !important;
}

.btn-web {
  background: var(--main-color);
  color: #fff !important;
}

.btn-gh {
  background: #18181b;
  color: #fff !important;
}

.overlay-btn:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

/* Project Card Content */
.project-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 0.65rem;
}

.badge-client {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.badge-personal {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-mini {
  background: #f4f4f5;
  color: #52525b;
  border: 1px solid #e4e4e7;
}

.badge-demo {
  background: #faf5ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.project-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-color);
  margin-bottom: 0.4rem;
}

.project-result {
  font-size: 0.78rem;
  font-weight: 600;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.project-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* View Details Action Button */
.details-btn {
  margin-top: auto;
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--orange-border);
  background: var(--main-color-light);
  color: var(--main-color);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.details-btn:hover {
  background: var(--main-color);
  color: #ffffff;
  border-color: var(--main-color);
  transform: translateY(-1px);
}

/* =====================================================
   PROJECT DETAIL MODAL — Apple & Linear-Grade Polish
   ===================================================== */

.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-content {
  background: var(--secondry-bg-color);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  border-radius: var(--radius-ios);
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.16);
  overflow-y: auto;
  position: relative;
  padding: 2.25rem;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-modal.active .project-modal-content {
  transform: scale(1) translateY(0);
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: var(--main-color-light);
  border-color: var(--orange-border);
  color: var(--main-color);
  transform: scale(1.05);
}

/* Header Hero with Icon & Title */
.modal-header-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.modal-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #fcfbf9;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.06);
  overflow: hidden;
}

.modal-app-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.modal-title-meta {
  flex: 1;
  min-width: 0;
}

.modal-tag-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.modal-result-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-color);
  line-height: 1.25;
}

/* Prominent Action Links Bar */
.modal-action-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.modal-btn.btn-playstore {
  background: #059669;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.modal-btn.btn-weblink {
  background: var(--main-color);
  color: #ffffff !important;
  box-shadow: 0 2px 8px var(--main-color-alpha50);
}

.modal-btn.btn-github {
  background: #18181b;
  color: #ffffff !important;
}

.modal-btn:hover {
  transform: translateY(-2px);
  opacity: 0.94;
}

/* Modal Sections */
.modal-section {
  margin-top: 1.25rem;
}

.modal-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.modal-section-title i {
  color: var(--main-color);
  font-size: 0.85rem;
}

.modal-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Tech Stack Pills */
.modal-tech-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-tech-pill img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}

.modal-tech-pill:hover {
  background: var(--main-color-light);
  border-color: var(--orange-border);
  color: var(--main-color);
}

/* Responsive Grid */
@media (max-width: 900px) {
  #projects-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #projects-container {
    grid-template-columns: 1fr;
  }
  .project-modal-content {
    padding: 1.5rem;
  }
  .modal-title {
    font-size: 1.25rem;
  }
}
