/* Past Projects Page — Nueva Technologies */
.projects {
  background-color: var(--body-color);
  padding-block: 5rem 3rem;
}

.projects__section-title {
  font-size: var(--h2-font-size);
  text-align: center;
  margin-bottom: 3rem;
  color: var(--title-color);
  font-family: var(--second-font);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch; /* ensures all cards are equal height */
}

.projects__card {
  display: flex;
  flex-direction: column;
  background-color: var(--container-color);
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* ensure equal height */
}

.projects__card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 24px rgba(94, 140, 255, 0.35);
}

.projects__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.1);
  transition: transform 0.4s ease;
}

.projects__card:hover .projects__img {
  transform: scale(1.05);
}

.projects__content {
  flex: 1; /* make content stretch evenly */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* keeps button pinned at bottom */
  padding: 1.5rem;
  min-height: 220px;
}

.projects__title {
  color: var(--title-color);
  font-family: var(--second-font);
  font-weight: var(--font-semi-bold);
  margin-bottom: 0.5rem;
}

.projects__desc {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

/* Center button nicely at bottom */
.projects__content .button {
  align-self: flex-start;
  font-size: var(--small-font-size);
  padding: 0.9rem 1.5rem;
  border-radius: 0.6rem;
}

/* ===== Compact Pop-card (glass modal) ===== */
.pop{
  position: fixed; inset: 0; display: none; place-items: center; z-index: 1200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
}
.pop.is-open{ display: grid; }

.pop__card{
  width: min(860px, 92vw);
  background: rgba(15, 18, 28, .82);
  border: 1px solid rgba(140,185,255,.28);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  overflow: hidden;
  display: grid; grid-template-columns: 1fr; gap: 0;
  transform: translateY(10px) scale(.98);
  opacity: 0;
  animation: popIn .28s ease forwards;
}
@keyframes popIn{ to { transform: translateY(0) scale(1); opacity: 1; } }

.pop__close{
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid rgba(140,185,255,.28);
  background: rgba(40,80,255,.16); color: #fff; display: grid; place-items: center;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.pop__close:hover{ transform: translateY(-1px); box-shadow: 0 0 14px rgba(120,160,255,.35); }

.pop__media{ padding: 14px 14px 0; }
.pop__body{ padding: 14px 16px 18px; }
.pop__title{ font-family: var(--second-font); color: var(--title-color); margin: 4px 0 6px; font-size: 1.15rem; }
.pop__desc{ color: var(--text-color); line-height: 1.65; }

/* Slider (re-using your join slider look) */
.slider{
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: 12px; background: #000;
}
.slider__track{
  display: flex; width: 100%; height: 100%;
  transform: translateX(0); transition: transform 600ms ease;
}
.slider__slide{
  width: 100%; flex: 0 0 100%; object-fit: cover;
  user-select: none; pointer-events: none;
}

.slider__btn{
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; background: hsla(0, 0%, 100%, .15);
  padding: .4rem .6rem; cursor: pointer;
  color: var(--title-color); font-size: 1.25rem;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: .5rem; transition: opacity .2s, transform .2s; opacity: .85;
}
.slider__btn:hover{ opacity: 1; transform: translateY(-50%) scale(1.06); }
.slider__btn--prev{ left: .5rem; }
.slider__btn--next{ right: .5rem; }

.slider__dots{
  position: absolute; bottom: .55rem; left: 0; right: 0;
  display: flex; gap: .4rem; justify-content: center;
}
.slider__dots button{
  width: .5rem; height: .5rem; border-radius: 999px; border: none;
  background: hsla(0, 0%, 100%, .35); cursor: pointer;
  transition: transform .2s, background .2s;
}
.slider__dots button.is-active{ background: hsla(0, 0%, 100%, .9); transform: scale(1.15); }

@media (min-width: 920px){
  .pop__card{ grid-template-columns: 1.2fr .8fr; }
  .pop__media{ padding: 16px; }
  .pop__body{ padding: 18px 18px 22px; }
}

/* --- POPUP RESPONSIVE FIX --- */
.pop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.pop.is-open { display: flex; }

.pop__card {
  position: relative;
  background: rgba(20,20,25,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.2rem;
  max-width: 900px;
  width: 100%;
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
  color: #fff;
}

/* Always keep close button visible */
.pop__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 50%;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  z-index: 1001;
  backdrop-filter: blur(6px);
}
.pop__close:hover { background: rgba(255,255,255,0.2); }

.pop__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* --- Ensure scrollable content for long text --- */
.pop__body {
  padding: 1.5rem;
  max-height: 35vh;
  overflow-y: auto;
}
.pop__title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.pop__desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  word-wrap: break-word;
}

/* --- Mobile adjustments --- */
@media (max-width: 768px) {
  .pop {
    padding: 1rem;
    align-items: flex-start;
  }

  .pop__card {
    margin-top: 3rem;
    border-radius: 1rem;
  }

  .pop__body {
    max-height: none;
  }

  .pop__close {
    top: 0.8rem;
    right: 0.8rem;
    font-size: 1.4rem;
    padding: 0.25rem 0.35rem;
  }
}

/* Animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Back Chip (glassy, compact, no animations) ===== */
.backchip {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px)); /* below your sticky header */
  left: calc(16px + env(safe-area-inset-left, 0px));
  z-index: 1000;

  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border-radius: 999px;

  background: rgba(10, 14, 25, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(0, 180, 255, 0.6);
  box-shadow:
    inset 0 0 0.5px rgba(255,255,255,0.4),
    0 4px 18px rgba(0, 180, 255, 0.18);

  color: #e9f7ff;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1;
}

.backchip i {
  font-size: 1.05rem;
  transform: translateY(1px);
}

.backchip:hover {
  border-color: rgba(0, 200, 255, 0.85);
  box-shadow:
    inset 0 0 0.5px rgba(255,255,255,0.5),
    0 6px 22px rgba(0, 200, 255, 0.22);
}

@media (max-width: 768px) {
  .backchip {
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    padding: .45rem .7rem;
    font-size: .88rem;
  }
}


/*==================== FILTER BAR ====================*/
.projects__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.5rem 0 3rem;
}

/*==================== PURE GLASS BUTTON ====================*/
.filter-btn {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0.45rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 174, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: #e8f8ff;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
  box-shadow: none;
}

/* Hover and active states – no glow, just slight clarity */
.filter-btn:hover {
  background: rgba(0, 174, 255, 0.12);
  border-color: rgba(0, 174, 255, 0.45);
}

.filter-btn.is-active,
.filter-btn[aria-pressed="true"] {
  background: rgba(0, 174, 255, 0.18);
  border-color: rgba(0, 174, 255, 0.55);
  color: #fff;
}

/* Remove any inherited animation or transform */
.filter-btn:active,
.filter-btn:focus {
  transform: none !important;
  box-shadow: none !important;
  outline: none;
}

/* Filtered-out cards: keep layout tidy without affecting your grid look */
.projects__card.is-filtered {
  display: none;
}

/* ====== Status tables layout ====== */
.status .section__title { text-align:center; margin-bottom: 1.2rem; }

.status__tabs {
  display:flex; gap:.6rem; justify-content:center; margin-bottom:1.4rem;
}

/* reuse your iOS-glass chip look (separate from .button) */
.filter-btn {
  font-size:.9rem; font-weight:600; letter-spacing:.3px;
  padding:.45rem 1.1rem; border-radius:.75rem;
  border:1px solid rgba(0,174,255,.25);
  background:rgba(255,255,255,.05);
  color:#e8f8ff; cursor:pointer;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
  box-shadow:none;
}
.filter-btn:hover { background:rgba(0,174,255,.12); border-color:rgba(0,174,255,.45); }
.filter-btn.is-active,[aria-selected="true"] { background:rgba(0,174,255,.18); border-color:rgba(0,174,255,.55); color:#fff; }

/* Panels */
.status__panel { margin-top:.4rem; }
.status__panel.is-visible { display:block; }
.status__panel[hidden] { display:none !important; }

.status__panel {
  display: none;
}
.status__panel.is-visible {
  display: block;
}


/* Responsive table wrapper */
.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:1rem; }

/* Glass table */
.table-glass {
  width:100%; border-collapse:separate; border-spacing:0;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border:1px solid rgba(0,174,255,.28);
  border-radius:1rem; overflow:hidden;
  color:var(--title-color, #fff);
  font-size:0.95rem;
}
.table-glass thead th {
  text-align:left; font-weight:700; padding:.9rem 1rem; font-size:.9rem;
  background: rgba(255,255,255,0.12);
  border-bottom:1px solid rgba(0,174,255,.35);
}
.table-glass tbody td {
  padding:.75rem 1rem;
  border-bottom:1px solid rgba(255,255,255,0.06);
}
.table-glass tbody tr:last-child td { border-bottom:0; }

/* compact on small screens */
@media (max-width: 640px) {
  .filter-btn { padding:.38rem .9rem; font-size:.85rem; }
  .table-glass { font-size:.9rem; }
  .table-glass thead th, .table-glass tbody td { padding:.6rem .75rem; }
}

