/* portal.css
   Modern responsive gallery + animations for GeoAurum marketplace portal
*/

/* Base resets and variables */
:root {
  --bg: #0f1724;
  --card-bg: #0b1220;
  --accent: #d4af37; /* gold */
  --muted: #94a3b8;
  --glass: rgba(255, 255, 255, 0.03);
  --radius: 14px;
  --easing: cubic-bezier(0.22, 0.9, 0.32, 1);
}

body.portal-page {
  background: linear-gradient(180deg, #071023 0%, #071326 100%);
  color: #e6eef8;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.portal-container {
  max-width: 1200px;
  margin: 2.25rem auto;
  padding: 1rem;
}

/* Top bar: inline search + heading */
.portal-top {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.portal-title {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.portal-title h1 {
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.2px;
}
.portal-title p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Search field override for consistent appearance */
.portal-search {
  min-width: 260px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.portal-search .search-box {
  background: var(--glass);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.45);
}
.portal-search input[type="search"] {
  background: transparent;
  border: 0;
  outline: 0;
  color: inherit;
  padding: 0.35rem 0.25rem;
  min-width: 240px;
}
.portal-search button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0.35rem;
  cursor: pointer;
  font-weight: 600;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card styles */
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border: 1px solid rgba(255, 255, 255, 0.03);
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: transform 360ms var(--easing), box-shadow 360ms var(--easing);
  cursor: pointer;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

/* image wrapper */
.gallery-card .media {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 66.666%; /* 3:2 ratio */
}
.gallery-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  transition: transform 900ms var(--easing), filter 500ms linear;
  will-change: transform;
  display: block;
  filter: brightness(0.98) saturate(1.02);
}

/* caption area */
.card-caption {
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}
.card-caption .title {
  font-weight: 600;
  font-size: 0.95rem;
}
.card-caption .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

/* hover overlay with actions */
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 40%,
    rgba(3, 7, 15, 0.6) 100%
  );
  transition: background 240ms var(--easing);
}
.card-actions {
  display: flex;
  gap: 0.5rem;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms var(--easing), opacity 280ms var(--easing);
}
.card-actions button {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}

/* hover effects */
.gallery-card:hover,
.gallery-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.6);
}
.gallery-card:hover img {
  transform: scale(1.07) translateY(-4px);
  filter: brightness(1.04) saturate(1.08);
}
.gallery-card:hover .card-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* small badge (e.g., product tag) */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.35),
    rgba(255, 255, 255, 0.03)
  );
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.12);
  backdrop-filter: blur(6px);
}

/* hidden state for filtering */
.gallery-card.hidden {
  opacity: 0;
  transform: scale(0.98);
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 280ms linear, transform 280ms var(--easing),
    height 220ms linear;
}

/* modal / lightbox */
.portal-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.7);
  z-index: 1200;
}
.portal-modal.active {
  display: flex;
}
.modal-card {
  width: min(1100px, 96vw);
  background: linear-gradient(180deg, #071426, #06101a);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.7);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  max-height: 86vh;
  overflow: auto;
}
@media (max-width: 900px) {
  .modal-card {
    grid-template-columns: 1fr;
  }
}

.modal-media {
  border-radius: 10px;
  overflow: hidden;
  min-height: 320px;
}
.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-info {
  padding: 0.6rem 0.35rem;
  color: var(--muted);
}
.modal-info h3 {
  margin: 0 0 0.5rem 0;
  color: #fff;
}
.modal-info p {
  margin: 0.25rem 0 0.75rem;
  line-height: 1.4;
}
.modal-info .meta {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.modal-info button {
  display: block;
  width: 100%;
  padding: 0.65rem;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #071422;
  font-weight: 700;
  cursor: pointer;
}

/* tiny animation for entrance */
.fade-in-stagger {
  animation: fadeUp 0.6s var(--easing) both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* no results message */
.no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- Side nav (fixed left) ---------- */
.fixed-side-nav {
  position: fixed;
  left: 0px;
  top: -190px;
  bottom: 40px;
  width: 45px;
  height: 100%;
  margin: auto;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b1220;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.fixed-side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fixed-side-nav .side-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: transform 220ms cubic-bezier(0.22, 0.9, 0.32, 1), box-shadow 220ms;
}

.fixed-side-nav .side-item i {
  font-size: 1.25rem;
}
.fixed-side-nav .side-item:hover {
  transform: translateX(6px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.55);
}
/* label that appears on hover */
.fixed-side-nav .side-label {
  position: absolute;
  left: 60px;
  white-space: nowrap;
  background: linear-gradient(
    90deg,
    rgba(3, 7, 15, 0.95),
    rgba(255, 255, 255, 0.02)
  );
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  transform-origin: left center;
  transform: translateX(-6px) scale(0.94);
  opacity: 0;
  transition: opacity 160ms, transform 160ms;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  pointer-events: none;
  font-size: 0.92rem;
}
.fixed-side-nav .side-item:hover .side-label {
  opacity: 1;
  transform: translateX(0) scale(1);
  color: #fff;
}

/* Light modal theme override (use after portal.css) */
.portal-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28); /* dim backdrop */
  z-index: 5000;
}
.portal-modal.active {
  display: flex;
}

.portal-modal .modal-card {
  width: min(980px, 94vw);
  background: #ffffff; /* light background */
  color: #102027; /* dark text */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(16, 32, 48, 0.18);
  display: block;
  max-height: 86vh;
  overflow: auto;
  border: 1px solid rgba(16, 32, 48, 0.06);
}

/* Buttons inside modals */
.portal-modal .btn-primary-custom {
  background: linear-gradient(90deg, #f0c84a, #d4af37);
  color: #071422;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 12px;
  border: none;
}
.portal-modal .btn-ghost {
  background: transparent;
  border: 1px solid rgba(16, 32, 48, 0.06);
  color: #334e5a;
}

/* modal headings */
.portal-modal h3 {
  color: #071422;
  margin: 0;
  font-size: 1.1rem;
}

/* ensure small text uses muted color on light bg */
.portal-modal .meta,
.portal-modal .form-help {
  color: #556b75;
}

/* image inside product modal */
.portal-modal img {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* responsive */
@media (max-width: 640px) {
  .portal-modal .modal-card {
    padding: 14px;
    width: 96vw;
  }
}
