/* ============================================================
   INOXAP Gallery Page — gallery.css
   ============================================================ */

:root {
  --inox-blue: #1B4FBF;
  --inox-green: #2DB84B;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 16px;
  --trans: all 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', 'Montserrat', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 100px;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.g-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.g-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.g-nav-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}
.g-nav-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.g-nav-title span:first-child {
  font-size: 15px;
  font-weight: 800;
  color: var(--inox-blue);
  line-height: 1.2;
}
.g-nav-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.g-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--inox-blue);
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--trans);
  flex-shrink: 0;
}
.g-back-btn:hover { background: #1341a0; transform: translateY(-1px); }

/* ── Hero Banner ─────────────────────────────────────────────── */
.g-hero {
  background: linear-gradient(135deg, #0d2d7a 0%, #1B4FBF 60%, #2DB84B 100%);
  padding: 60px 20px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.g-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.g-hero-content { position: relative; z-index: 1; }
.g-hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.g-hero h1 {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 10px;
}
.g-hero h1 span { color: #7effa8; }
.g-hero p { font-size: 14px; color: rgba(255,255,255,0.75); font-weight: 400; }

/* ── Main Content ─────────────────────────────────────────────── */
.g-main { padding: 40px 0; }
.g-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Loading ─────────────────────────────────────────────────── */
.g-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.g-spinner {
  width: 40px; height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--inox-blue);
  border-radius: 50%;
  animation: gSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes gSpin { to { transform: rotate(360deg); } }

/* ── Empty State ─────────────────────────────────────────────── */
.g-empty {
  text-align: center;
  padding: 80px 20px;
}
.g-empty-icon { font-size: 60px; margin-bottom: 16px; }
.g-empty h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.g-empty p { font-size: 14px; color: var(--text-muted); }

/* ── Masonry Grid ────────────────────────────────────────────── */
.g-grid {
  columns: 4 240px;
  column-gap: 16px;
}
.g-card {
  break-inside: avoid;
  margin-bottom: 16px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--trans);
  animation: gFadeIn 0.4s ease both;
}
.g-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14);
}
@keyframes gFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.g-card-img {
  width: 100%;
  display: block;
  object-fit: cover;
  background: #f1f5f9;
  transition: transform 0.3s;
}
.g-card:hover .g-card-img { transform: scale(1.03); }

.g-card-body {
  padding: 12px 14px;
}
.g-card-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 6px;
}
.g-card-uploader {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.g-card-uploader i { color: var(--inox-blue); font-size: 10px; }

/* ── FAB ─────────────────────────────────────────────────────── */
.g-fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 800;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #1B4FBF, #2DB84B);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(27,79,191,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
}
.g-fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 10px 36px rgba(27,79,191,0.55); }
.g-fab:active { transform: scale(0.95); }

/* ── Modal Overlay ───────────────────────────────────────────── */
.g-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(10,22,60,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.g-modal-overlay.open { display: flex; }

.g-modal-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: gModalIn 0.3s cubic-bezier(0.34,1.2,0.64,1) both;
}
@keyframes gModalIn { from { transform: scale(0.92) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.g-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.g-modal-header h3 { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.g-modal-close {
  background: #f1f5f9;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.g-modal-close:hover { background: #e2e8f0; }

.g-modal-body { padding: 20px; }

/* ── Drop Zone ───────────────────────────────────────────────── */
.g-dropzone {
  border: 2px dashed rgba(27,79,191,0.3);
  border-radius: 14px;
  background: rgba(27,79,191,0.03);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  margin-bottom: 16px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.g-dropzone:hover { border-color: var(--inox-blue); background: rgba(27,79,191,0.06); }
.g-dropzone.drag-over { border-color: var(--inox-blue); background: rgba(27,79,191,0.1); }
.g-dz-icon { font-size: 32px; color: var(--inox-blue); margin-bottom: 8px; }
.g-dz-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.g-dz-sub { font-size: 12px; color: var(--text-muted); }

/* Preview inside dropzone */
#gPreviewWrap {
  position: relative;
  width: 100%;
}
#gPreviewImg {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.g-remove-preview {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.g-form-group { margin-bottom: 14px; }
.g-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}
.g-textarea, .g-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
  resize: vertical;
}
.g-textarea:focus, .g-input:focus { border-color: var(--inox-blue); }

/* ── Upload Status ───────────────────────────────────────────── */
#gUploadStatus {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
#gUploadStatus.success { background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }
#gUploadStatus.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
#gUploadStatus.loading { background: #eff6ff; color: #1B4FBF; border: 1px solid #bfdbfe; }

/* ── Post Button ─────────────────────────────────────────────── */
.g-post-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1B4FBF, #1565c0);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--trans);
}
.g-post-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(27,79,191,0.35); }
.g-post-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ── Lightbox ────────────────────────────────────────────────── */
.g-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}
.g-lightbox.open { display: flex; }
.g-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.g-lb-inner {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
  cursor: default;
}
#gLbImg {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.g-lb-caption {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 14px;
}
.g-lb-meta {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .g-grid { columns: 2 160px; column-gap: 10px; }
  .g-card-body { padding: 9px 11px; }
  .g-fab { bottom: 20px; right: 16px; width: 52px; height: 52px; font-size: 20px; }
  .g-hero { padding: 40px 16px 36px; }
  .g-hero h1 { font-size: 26px; }
  .g-back-btn { padding: 7px 12px; font-size: 11px; }
}
@media (max-width: 360px) {
  .g-grid { columns: 1; }
  .g-nav-sub { display: none; }
}
