/* ============================================================
   Gallery, Analytics & Search Styles — AlumniConnect
   ============================================================ */

/* ── Album Grid ──────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.album-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.album-cover {
  width: 100%;
  height: 175px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
  overflow: hidden;
}

.album-cover img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  display: block;
}

.album-card-body {
  padding: 14px 16px;
}

.album-title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.album-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.album-count {
  background: var(--gray-100);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Image Grid ──────────────────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.image-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--gray-100);
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.image-tile:hover img {
  transform: scale(1.06);
}

.image-tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-tile:hover .image-tile-overlay {
  opacity: 1;
}

.image-tile-overlay button {
  font-size: .72rem;
  padding: 5px 11px;
  background: rgba(255,255,255,0.92);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}

.image-tile-overlay button:hover {
  background: white;
}

.image-tile-overlay button.danger {
  background: rgba(239,68,68,0.85);
  color: white;
}

.image-tile-overlay button.danger:hover {
  background: #ef4444;
}

/* ── Upload Zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--gray-50);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}

.upload-zone-icon {
  font-size: 2.4rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.upload-zone-text {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upload-zone-sub {
  font-size: .78rem;
  color: var(--text-muted);
}

.upload-progress {
  margin-top: 14px;
  display: none;
}

.upload-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.lightbox-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(255,255,255,0.8);
  font-size: 1.7rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}

.lightbox-close:hover { color: white; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  color: white;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.9);
  font-size: .83rem;
  background: rgba(0,0,0,0.55);
  padding: 6px 18px;
  border-radius: 20px;
  max-width: 75%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: .78rem;
  letter-spacing: .04em;
}

/* ── Album view header ───────────────────────────────────────── */
.gallery-back-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.gallery-back-bar h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* ── Published badge ─────────────────────────────────────────── */
.badge-published   { background: #dcfce7; color: #16a34a; }
.badge-unpublished { background: #fef9c3; color: #a16207; }

/* ── Profile Completeness ────────────────────────────────────── */
.completeness-bar-wrap {
  background: var(--gray-100);
  border-radius: 99px;
  height: 7px;
  overflow: hidden;
  flex: 1;
}

.completeness-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width 0.8s ease;
}

.completeness-bar-fill.good   { background: #10b981; }
.completeness-bar-fill.medium { background: #f59e0b; }
.completeness-bar-fill.low    { background: #ef4444; }

/* ── Analytics ───────────────────────────────────────────────── */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.chart-card-title {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-title i {
  color: var(--primary);
  font-size: .85rem;
}

.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 940px) {
  .chart-grid-2 { grid-template-columns: 1fr; }
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-delta {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.kpi-delta.up   { background: #dcfce7; color: #16a34a; }
.kpi-delta.down { background: #fee2e2; color: #dc2626; }

/* ── Global Search Dropdown ──────────────────────────────────── */
.navbar-search {
  position: relative;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  max-height: 440px;
  overflow-y: auto;
  display: none;
  min-width: 360px;
}

.search-results-dropdown.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

.search-result-group {
  padding: 6px 0;
}

.search-result-group + .search-result-group {
  border-top: 1px solid var(--border);
}

.search-result-group-label {
  padding: 8px 16px 4px;
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.1s;
}

.search-result-item:hover {
  background: var(--gray-50);
  color: var(--text-primary);
}

.search-result-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}

.search-result-text { flex: 1; min-width: 0; }

.search-result-title {
  font-size: .82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-sub {
  font-size: .72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

.search-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
}
