/* =============================================
   MyGallery – Main Stylesheet
   Clean Light Theme
   ============================================= */

/* System font stack — no external network dependency */

:root {
  --bg: #f0f2f8;
  --bg2: #ffffff;
  --surface: rgba(0, 0, 0, 0.03);
  --surface2: rgba(99, 102, 241, 0.08);
  --border: #e2e5f0;
  --accent: #6c3de8;
  --accent2: #5b21b6;
  --accent3: #7c3aed;
  --text: #1e1b4b;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(99, 102, 241, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 99px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(99, 102, 241, .08);
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: .45rem .9rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent2);
  background: rgba(124, 58, 237, .15);
}

.nav-badge {
  background: var(--accent);
  color: #fff;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
}

/* ── Hero Landing Page ── */
.hero {
  position: relative;
  text-align: left;
  padding: 6rem 5% 5rem;
  background: #fffcf8;
  /* Light warm background like reference */
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.hero-text-col {
  max-width: 650px;
}

.badge-pill {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent2);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.15;
  color: #111827;
  /* Dark black like reference */
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.highlight-line {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.highlight-line::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 12px;
  background: #ffedd5;
  /* Warm orange highlight under text */
  z-index: -1;
}

.hero-subtitle {
  color: #4b5563;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  max-width: 580px;
  margin-bottom: 2rem;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.service-item {
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.service-item .check {
  color: #ea580c;
  font-weight: 800;
}

.hero-actions {
  margin-top: 1rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ea580c;
  /* Orange CTA like reference */
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 99px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.25);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-cta .arrow {
  margin-left: 10px;
  transition: transform 0.2s;
}

.btn-cta:hover {
  transform: translateY(-2px);
  background: #c2410c;
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.35);
  color: white;
}

.btn-cta:hover .arrow {
  transform: translateX(4px);
}

.btn-gallery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 99px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  box-shadow: 0 10px 25px rgba(76, 29, 149, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gallery:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(76, 29, 149, 0.4);
  color: white;
}

.btn-gallery .arrow {
  margin-left: 8px;
  transition: transform 0.2s;
}

.btn-gallery:hover .arrow {
  transform: translateX(4px);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem 1rem;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all .2s;
  text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(124, 58, 237, .2);
  border-color: var(--accent);
  color: var(--accent2);
}

/* ── Gallery Grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Media Card ── */
.media-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: pointer;
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, .3);
  border-color: rgba(124, 58, 237, .5);
}

.media-card .thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #e8eaf0;
}

.media-card .thumb-wrap img,
.media-card .thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.media-card:hover .thumb-wrap img,
.media-card:hover .thumb-wrap video {
  transform: scale(1.04);
}

/* Watermark Overlay – videos */
.watermark-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  padding: .4rem .8rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

/* Type badge */
.type-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 99px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.type-badge.video {
  background: rgba(124, 58, 237, .7);
}

.type-badge.image {
  background: rgba(15, 118, 110, .7);
}

.media-card .card-body {
  padding: .85rem 1rem 1rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

/* Play icon overlay */
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: rgba(124, 58, 237, .8);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  pointer-events: none;
  z-index: 5;
  transition: background .2s, transform .2s;
}

.media-card:hover .play-icon {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, .1);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox-close:hover {
  background: var(--danger);
}

.lightbox-content {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius);
  overflow: visible;
  /* allow watermark overlay to extend */
  box-shadow: 0 0 60px rgba(124, 58, 237, .4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  display: block;
  position: relative;
  z-index: 1;
}

/* Watermark overlays in lightbox: pointer-events none so video controls work */
.lb-wm-img,
.lb-wm-vid {
  pointer-events: none !important;
  z-index: 18 !important;
}

.lightbox-caption {
  color: rgba(255, 255, 255, .7);
  font-size: .9rem;
  margin-top: .8rem;
  text-align: center;
}


/* Watermark on lightbox image */
.lightbox-img-wrap {
  position: relative;
  display: inline-block;
}

.lightbox-img-wrap .lightbox-wm {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  padding: .6rem 1rem;
  color: rgba(255, 255, 255, .8);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #eef0fb 0%, #f5f0ff 50%, #eff6ff 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.login-card .logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card .logo span {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .4rem;
}

.form-control {
  width: 100%;
  padding: .7rem 1rem;
  font-size: .95rem;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}

.form-control::placeholder {
  color: var(--muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, .4);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(108, 61, 232, .15);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #059669;
  color: #fff;
}

.btn-success:hover {
  background: #047857;
}

.btn-sm {
  padding: .35rem .8rem;
  font-size: .8rem;
}

.btn-lg {
  padding: .9rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ── Alerts ── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
}

.alert-danger {
  background: rgba(220, 38, 38, .08);
  border: 1px solid rgba(220, 38, 38, .25);
  color: #991b1b;
}

.alert-success {
  background: rgba(22, 163, 74, .08);
  border: 1px solid rgba(22, 163, 74, .25);
  color: #166534;
}

.alert-info {
  background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(99, 102, 241, .25);
  color: #3730a3;
}

.alert-warning {
  background: rgba(217, 119, 6, .08);
  border: 1px solid rgba(217, 119, 6, .25);
  color: #92400e;
}

/* ── Admin Layout ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  display: block;
  text-decoration: none;
}

.sidebar-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 1.2rem 0 .5rem .8rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .9rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: .15rem;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.sidebar-link.active {
  color: var(--accent2);
  background: rgba(124, 58, 237, .18);
}

.sidebar-link .icon {
  font-size: 1.1rem;
  width: 1.3rem;
  text-align: center;
}

.admin-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: .3rem;
}

.page-header p {
  color: var(--muted);
}

/* ── Stat Cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.stat-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead th {
  background: rgba(124, 58, 237, .12);
  color: var(--muted);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(124, 58, 237, .08);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: .8rem;
}

/* ── Vault Cards ── */
.vault-card {
  border: 1px solid rgba(245, 158, 11, .2);
}

.vault-card:hover {
  border-color: rgba(245, 158, 11, .5);
  box-shadow: 0 12px 40px rgba(245, 158, 11, .15);
}

.vault-badge {
  position: absolute;
  top: .6rem;
  right: .6rem;
  background: rgba(245, 158, 11, .8);
  color: #000;
  font-size: .65rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: 99px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem 2.5rem;
  }

  .hero-container {
    flex-direction: column;
    text-align: left;
  }

  .hero h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-actions {
    margin-top: 2rem;
  }

  .btn-cta {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    width: 100%;
  }

  .services-list {
    margin-bottom: 1rem;
    gap: 0.8rem;
  }

  .service-item {
    font-size: 0.9rem;
  }

  .badge-pill {
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
    margin-bottom: 1.5rem;
  }

  .gallery-grid {
    padding: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
  }

  .admin-content {
    padding: 1rem;
  }

  .navbar {
    padding: .75rem 1rem;
  }
}

/* ── Animations ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp .4s ease forwards;
}

.fade-up-delay-1 {
  animation-delay: .1s;
  opacity: 0;
}

.fade-up-delay-2 {
  animation-delay: .2s;
  opacity: 0;
}

.fade-up-delay-3 {
  animation-delay: .3s;
  opacity: 0;
}

/* Progress bar (upload) */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: .5rem;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .3s;
}

/* ── Thumbnail in table ── */
.thumb-sm {
  width: 60px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}

.pill {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}

.pill-image {
  background: rgba(15, 118, 110, .2);
  color: #34d399;
}

.pill-video {
  background: rgba(124, 58, 237, .2);
  color: var(--accent2);
}

.pill-vault {
  background: rgba(245, 158, 11, .2);
  color: #fbbf24;
}

.pill-public {
  background: rgba(34, 197, 94, .15);
  color: #86efac;
}

/* ── Group / Album Sections (public gallery) ─────────────────────── */
.group-section {
  margin-bottom: 2.5rem;
}

.group-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem 0 .7rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: .2rem;
}

.group-section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.group-meta {
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface2);
  border-radius: 20px;
  padding: .2rem .8rem;
}