/* ════════════════════════════════════════════════════════
   gallery.css  –  Senior 2027 Gallery page styles
   ════════════════════════════════════════════════════════ */

/* ── Page base ─────────────────────────────────────────── */
.gallery-body {
  background: #060a12;
  color: #e8eaf0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────── */
.g-header {
  background: #0a0f1e;
  border-bottom: 1px solid #1a2540;
  position: sticky;
  top: 0;
  z-index: 100;
}
.g-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.g-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid #1a2f50;
  background: #0d1a30;
  color: #5a7aaa;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.g-back-btn:hover { border-color: #4d8edb; color: #4d8edb; }
.g-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4d8edb;
  flex: 1;
}
.g-logo-icon { font-size: 20px; }
.g-count-badge {
  background: rgba(77,142,219,0.12);
  border: 1px solid rgba(77,142,219,0.25);
  color: #4d8edb;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ══ View Toggle ══════════════════════════════════════════ */
.g-toggle-wrap {
  max-width: 1300px;
  margin: 20px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
.g-toggle {
  display: inline-flex;
  background: #0a1020;
  border: 1px solid #1a2f50;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.g-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: 9px;
  border: none;
  background: none;
  color: #4a6a9a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.g-toggle-btn:hover:not(.active) {
  background: rgba(77,142,219,0.08);
  color: #7aa8d8;
}
.g-toggle-btn.active {
  background: linear-gradient(135deg, #1a3a7a, #2a5aaa);
  color: #fff;
  box-shadow: 0 2px 12px rgba(77,142,219,0.3);
}
.g-toggle-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.g-toggle-btn:not(.active) .g-toggle-count {
  background: rgba(77,142,219,0.2);
  color: #4d8edb;
}

/* ══ Controls bar (search + per-page) ══════════════════════ */
.g-controls-wrap {
  max-width: 1300px;
  margin: 24px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Search */
.g-search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.g-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #3a5a80;
  pointer-events: none;
}
#searchInput {
  width: 100%;
  background: #0d1a30;
  border: 1px solid #1a2f50;
  border-radius: 12px;
  padding: 11px 40px 11px 40px;
  color: #e8eaf0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#searchInput:focus {
  border-color: #4d8edb;
  box-shadow: 0 0 0 3px rgba(77,142,219,0.12);
}
.g-search-clear {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #3a5a80;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.2s;
  line-height: 1;
}
.g-search-clear:hover { color: #e8eaf0; }

/* Per-page selector */
.g-perpage-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.g-perpage-label {
  font-size: 11px;
  font-weight: 600;
  color: #4a6a9a;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.g-perpage-select {
  background: #0d1a30;
  border: 1px solid #1a2f50;
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 60px;
}
.g-perpage-select:focus { border-color: #4d8edb; }
.g-perpage-select option { background: #0a0f1e; }

/* ══ Department chips ════════════════════════════════════ */
.g-dept-wrap {
  max-width: 1300px;
  margin: 14px auto 0;
  padding: 0 20px;
}
.g-dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.g-dept-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #1a2f50;
  background: #0d1a30;
  color: #5a7aaa;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}
.g-dept-chip:hover {
  border-color: #4d8edb;
  color: #4d8edb;
}
.g-dept-chip.active {
  background: linear-gradient(135deg, #1a4aaa, #4d8edb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(77,142,219,0.35);
}
.g-dept-chip .g-chip-count {
  margin-left: 5px;
  opacity: 0.7;
  font-weight: 400;
}

/* Result / filter info bar */
.g-result-bar {
  max-width: 1300px;
  margin: 10px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
}
#resultInfo {
  font-size: 11px;
  color: #4a6a9a;
  letter-spacing: 0.03em;
  flex: 1;
}
.g-clear-filters {
  background: none;
  border: 1px solid #1a2f50;
  border-radius: 6px;
  color: #4a6a9a;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}
.g-clear-filters:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ══ Grid ════════════════════════════════════════════════ */
.g-main {
  max-width: 1300px;
  margin: 18px auto 0;
  padding: 0 20px 40px;
  width: 100%;
  flex: 1;
}
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ══ Poster Card ══════════════════════════════════════════ */
.g-card {
  background: #0d1625;
  border: 1px solid #1a2540;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.g-card:hover {
  transform: translateY(-3px);
  border-color: rgba(77,142,219,0.35);
  box-shadow: 0 10px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(77,142,219,0.12);
}

/* Image wrap */
.g-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #080e1c;
  overflow: hidden;
}
.g-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.g-card:hover .g-card-img { transform: scale(1.04); }
.g-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 38px;
  color: #2a4060;
  background: radial-gradient(circle at center, #101c30 0%, #080e1c 100%);
  user-select: none;
}
.g-dummy-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(77, 142, 219, 0.08);
  border: 1px dashed rgba(77, 142, 219, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}
.g-dummy-avatar {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.g-dummy-label {
  font-size: 10px;
  font-weight: 700;
  color: #4a6a9a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(13, 22, 37, 0.7);
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(77, 142, 219, 0.15);
}

/* Done badge */
.g-done-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(16,185,129,0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}
.g-done-badge::before { content: "✓"; font-size: 9px; }

/* Instagram Added Badge on Image */
.g-insta-badge-pill {
  position: absolute;
  top: 10px; right: 10px;
  background: linear-gradient(135deg, #833ab4, #c13584);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(193,53,132,0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Status box inside card body */
.g-card-status-box {
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.4;
  display: flex;
  gap: 8px;
  align-items: center;
}
.g-card-status-box.insta-added {
  background: rgba(193,53,132,0.08);
  border: 1px solid rgba(193,53,132,0.25);
  color: #f472b6;
}
.g-card-status-box.verified-ok {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  color: #34d399;
}
.g-card-status-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.g-card-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.g-card-status-text strong {
  color: #e2e8f0;
  font-size: 11px;
}
.g-card-status-text span {
  color: #94a3b8;
  font-size: 9.5px;
}

/* Card body */
.g-card-body {
  padding: 13px 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.g-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaf0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-card-dept {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4d8edb;
  margin-bottom: 6px;
}

/* ── Warning notice inside card ── */
.g-card-warning {
  margin-top: 4px;
  padding: 7px 9px;
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: 8px;
  font-size: 10px;
  color: #a17c00;
  line-height: 1.5;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.g-card-warning-icon { flex-shrink: 0; font-size: 11px; margin-top: 1px; }

/* Add Username button */
.g-add-btn {
  margin-top: auto;
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid rgba(77,142,219,0.35);
  background: rgba(77,142,219,0.08);
  color: #4d8edb;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.g-add-btn:hover:not(:disabled) {
  background: rgba(77,142,219,0.18);
  border-color: #4d8edb;
  box-shadow: 0 0 12px rgba(77,142,219,0.2);
}
.g-add-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Card exit animation */
@keyframes card-exit {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.92); }
}
.g-card.removing {
  animation: card-exit 0.3s ease forwards;
  pointer-events: none;
}

/* ══ Skeleton loader ══════════════════════════════════════ */
.g-skeleton {
  background: #0d1625;
  border: 1px solid #111b2e;
  border-radius: 14px;
  aspect-ratio: 1.2 / 1;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

/* ══ Empty / Error ════════════════════════════════════════ */
.g-empty, .g-error {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.g-empty-icon { font-size: 48px; }
.g-empty p, .g-error p { font-size: 14px; color: #4a6a9a; max-width: 320px; }
.g-retry-btn {
  margin-top: 6px;
  padding: 10px 24px;
  background: linear-gradient(135deg,#1a4aaa,#4d8edb);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.g-retry-btn:hover { transform: translateY(-1px); }

/* ══ Pagination ══════════════════════════════════════════ */
.g-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px 36px;
  flex-wrap: wrap;
}
.g-page-btn {
  padding: 8px 18px;
  border: 1px solid #1a2f50;
  background: #0d1a30;
  color: #5a7aaa;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.g-page-btn:hover:not(:disabled) { border-color: #4d8edb; color: #4d8edb; }
.g-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.g-page-nums { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.g-page-num {
  width: 34px; height: 34px;
  border-radius: 7px;
  border: 1px solid #1a2f50;
  background: #0d1a30;
  color: #5a7aaa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.g-page-num:hover { border-color: #4d8edb; color: #4d8edb; }
.g-page-num.active {
  background: linear-gradient(135deg,#1a4aaa,#4d8edb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(77,142,219,0.35);
}

/* ══ Modal ════════════════════════════════════════════════ */
.g-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,10,18,0.78);
  backdrop-filter: blur(10px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.g-modal-overlay.open { opacity: 1; pointer-events: auto; }
.g-modal {
  background: radial-gradient(circle at top left, #12192a, #0b0f19);
  border: 1px solid rgba(77,142,219,0.2);
  border-radius: 20px;
  padding: 36px 30px 28px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.25s;
  text-align: center;
}
.g-modal-overlay.open .g-modal { transform: translateY(0) scale(1); }
.g-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none; border: none;
  color: #4a6a9a; font-size: 20px;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.g-modal-close:hover { color: #e8eaf0; background: rgba(255,255,255,0.07); }
.g-modal-icon { font-size: 38px; margin-bottom: 10px; }
.g-modal-title { font-size: 18px; font-weight: 700; color: #e8eaf0; margin-bottom: 6px; }
.g-modal-sub { font-size: 12px; color: #4a6a9a; margin-bottom: 20px; line-height: 1.6; }

/* Privacy + lock warning box inside modal */
.g-modal-warning {
  background: rgba(234,179,8,0.07);
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.g-modal-warning-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #b8960a;
  line-height: 1.5;
}
.g-modal-warning-row span:first-child { flex-shrink: 0; font-size: 12px; }

.g-modal-field {
  display: flex;
  align-items: center;
  background: #0d1a30;
  border: 1px solid #1a2f50;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.g-modal-field:focus-within {
  border-color: #4d8edb;
  box-shadow: 0 0 0 3px rgba(77,142,219,0.12);
}
.g-modal-at {
  padding: 0 10px 0 14px;
  color: #4d8edb;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}
#instaInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e8eaf0;
  font-size: 14px;
  padding: 12px 14px 12px 0;
}
.g-modal-hint {
  font-size: 11px;
  color: #3a5a80;
  min-height: 16px;
  margin-bottom: 16px;
  text-align: left;
}
.g-modal-hint.error { color: #ef4444; }
.g-modal-hint.ok    { color: #10b981; }
.g-modal-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #1a4aaa, #4d8edb);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
.g-modal-submit:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(77,142,219,0.4);
  transform: translateY(-1px);
}
.g-modal-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ══ Toast ════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(10,15,30,0.96);
  border: 1px solid rgba(16,185,129,0.3);
  border-left: 4px solid #10b981;
  border-radius: 12px;
  padding: 14px 18px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  min-width: 280px; max-width: 380px;
  display: flex; align-items: center; gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.3s;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}
.toast.show    { transform: translateX(0); opacity: 1; }
.toast.error   { border-color: rgba(239,68,68,0.3); border-left-color: #ef4444; }
.toast-icon    {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(16,185,129,0.15); color: #10b981;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: bold; flex-shrink: 0;
}
.toast.error .toast-icon { background: rgba(239,68,68,0.15); color: #ef4444; }
.toast-content { flex: 1; line-height: 1.4; }
.toast-progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px; background: #10b981;
  width: 100%;
  animation: tp 4s linear forwards;
  transform-origin: left;
}
.toast.error .toast-progress { background: #ef4444; }
@keyframes tp { to { transform: scaleX(0); } }

/* ══ Responsive ══════════════════════════════════════════ */
@media (max-width: 640px) {
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
  .g-header-inner { padding: 12px 14px; }
  .g-main, .g-controls-wrap, .g-dept-wrap, .g-result-bar { padding-left: 12px; padding-right: 12px; }
  .g-modal { padding: 26px 18px 22px; }
  .g-controls-wrap { flex-direction: column; align-items: stretch; }
  .g-perpage-wrap { justify-content: center; }
}
