/* ============================================================
   The Dhillon Clan — Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold-bright:  #FFD700;
  --gold-mid:     #C9A227;
  --gold-deep:    #8B6914;
  --gold-glow:    #FFE566;
  --black:        #050505;
  --black-soft:   #0D0D0D;
  --dark-1:       #111111;
  --dark-2:       #1A1A1A;
  --dark-3:       #222222;
  --white:        #F5F0E8;
  --white-dim:    rgba(245,240,232,0.7);
  --radius-sm:    8px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --shadow-gold:  0 0 40px rgba(255,215,0,0.4), 0 0 80px rgba(255,215,0,0.15);
  --shadow-card:  0 8px 32px rgba(0,0,0,0.6);
  --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-1); }
::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-mid); }

/* ============================================================
   INTRO / SPLASH SCREEN
   ============================================================ */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#intro-screen.hidden {
  display: none;
}

/* The emblem container that scales and transforms */
#emblem-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

/* Gold glow ring behind emblem */
#emblem-wrap::before {
  content: '';
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
  opacity: 0;
}

#emblem-wrap.glowing::before {
  opacity: 1;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.15); opacity: 1; }
}

/* Lion and Khanda images */
#lion-svg,
#khanda-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.7)) drop-shadow(0 0 40px rgba(255,215,0,0.3));
  transition: opacity 0.6s ease;
}

#khanda-svg { opacity: 0; }

/* Title text below emblem */
#intro-title {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  white-space: nowrap;
}

#intro-title h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-glow) 0%, var(--gold-bright) 40%, var(--gold-mid) 70%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.06em;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.4));
}

#intro-title .subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  letter-spacing: 0.3em;
  color: var(--gold-mid);
  margin-top: 0.5rem;
  text-transform: uppercase;
}

/* ── Shimmer animation on title ───────────────────────────── */
@keyframes goldShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

#intro-title.revealed h1 {
  background: linear-gradient(
    90deg,
    var(--gold-deep) 0%,
    var(--gold-mid) 20%,
    var(--gold-glow) 40%,
    #FFF8DC 50%,
    var(--gold-glow) 60%,
    var(--gold-mid) 80%,
    var(--gold-deep) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 3s linear infinite;
}

/* Skip button */
#skip-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.3);
  color: var(--gold-mid);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}

#skip-btn.visible {
  opacity: 1;
  pointer-events: all;
}

#skip-btn:hover {
  background: rgba(255,215,0,0.12);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* Particle dust effect */
.dust-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-bright);
  pointer-events: none;
  animation: dustFloat linear forwards;
}

@keyframes dustFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0); }
}

/* ============================================================
   MAIN CONTENT (hidden during intro)
   ============================================================ */
#main-content {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Site Header ──────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5,5,5,0.85);
  border-bottom: 1px solid rgba(255,215,0,0.12);
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand .mini-emblem {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.5));
}

.header-brand .brand-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(90deg, var(--gold-glow), var(--gold-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
  color: var(--black);
  box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-glow), var(--gold-bright));
  box-shadow: 0 6px 30px rgba(255,215,0,0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,215,0,0.4);
  color: var(--gold-mid);
}

.btn-outline:hover {
  background: rgba(255,215,0,0.08);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

/* ── Hero Section ─────────────────────────────────────────── */
#hero {
  text-align: center;
  padding: 80px 2rem 60px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,215,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}

#hero h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--gold-mid);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

#hero p {
  color: var(--white-dim);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Section Divider ──────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  margin: 2rem 0;
}

.section-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.3), transparent);
}

.section-divider .divider-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--gold-mid);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Masonry Gallery ──────────────────────────────────────── */
#gallery-section {
  padding: 0 1.5rem 60px;
}

#gallery-grid {
  columns: 4;
  column-gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1200px) { #gallery-grid { columns: 3; } }
@media (max-width: 768px)  { #gallery-grid { columns: 2; } }
@media (max-width: 480px)  { #gallery-grid { columns: 1; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--dark-2);
  border: 1px solid rgba(255,215,0,0.06);
  transition: var(--transition);
  animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gallery-item:hover {
  border-color: rgba(255,215,0,0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255,215,0,0.08);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-caption {
  font-size: 0.85rem;
  color: var(--white);
  font-weight: 400;
  line-height: 1.4;
}

.gallery-item-date {
  font-size: 0.7rem;
  color: var(--gold-mid);
  margin-top: 2px;
}

/* Empty state */
#gallery-empty {
  text-align: center;
  padding: 60px 2rem;
  display: none;
}

#gallery-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

#gallery-empty p {
  color: var(--white-dim);
  font-size: 1rem;
}

/* Loading skeleton */
.gallery-skeleton {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--dark-2);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.7; }
  100% { opacity: 0.4; }
}

/* ── Google Photos Section ────────────────────────────────── */
#google-photos-section {
  padding: 20px 1.5rem 60px;
}

#google-photos-input-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: var(--dark-2);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

#google-photos-input-wrap p {
  color: var(--white-dim);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.gp-input-row {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.gp-input-row input {
  flex: 1;
  background: var(--dark-3);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 40px;
  padding: 10px 18px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.gp-input-row input:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.1);
}

/* Google Photos thumbnails grid */
#gp-thumbs-grid {
  max-width: 1400px;
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gp-thumb-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--dark-2);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,215,0,0.06);
}

.gp-thumb-item:hover {
  transform: scale(1.02);
  border-color: rgba(255,215,0,0.25);
  box-shadow: var(--shadow-card);
}

.gp-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Lightbox ─────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 40px rgba(255,215,0,0.1);
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

#lightbox.open #lightbox-img {
  transform: scale(1);
}

#lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.9rem;
  color: var(--white-dim);
  font-style: italic;
  max-width: 600px;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,215,0,0.12);
  border: 1px solid rgba(255,215,0,0.3);
  color: var(--gold-bright);
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-btn:hover {
  background: rgba(255,215,0,0.25);
  border-color: var(--gold-bright);
}

#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 1.2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#lightbox-close:hover {
  background: rgba(255,255,255,0.15);
}

/* ── Upload Modal ─────────────────────────────────────────── */
#upload-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#upload-modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--dark-2);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: min(90vw, 480px);
  box-shadow: 0 25px 80px rgba(0,0,0,0.7), 0 0 40px rgba(255,215,0,0.05);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
}

#upload-modal.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.modal-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  background: linear-gradient(90deg, var(--gold-glow), var(--gold-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: none;
  border: none;
  color: var(--white-dim);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px;
}

.modal-close:hover { color: var(--white); }

/* Form fields */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--gold-mid);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  background: var(--dark-3);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.08);
}

/* Drag & drop upload area */
#drop-zone {
  border: 2px dashed rgba(255,215,0,0.25);
  border-radius: var(--radius-md);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.2rem;
}

#drop-zone.dragover {
  border-color: var(--gold-bright);
  background: rgba(255,215,0,0.05);
}

#drop-zone .dz-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

#drop-zone p {
  color: var(--white-dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

#drop-zone span {
  color: var(--gold-mid);
  font-weight: 500;
}

#file-input { display: none; }

/* Preview thumbnails in upload modal */
#upload-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}

.preview-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--dark-3);
  position: relative;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Progress bar */
#upload-progress {
  display: none;
  background: var(--dark-3);
  border-radius: 20px;
  overflow: hidden;
  height: 6px;
  margin-bottom: 1rem;
}

#upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: 20px;
  width: 0;
  transition: width 0.3s ease;
}

.upload-status {
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 1rem;
  min-height: 1.2em;
}

.upload-status.error { color: #ff6b6b; }
.upload-status.success { color: #51cf66; }

/* ── Footer ───────────────────────────────────────────────── */
#site-footer {
  text-align: center;
  padding: 40px 2rem;
  border-top: 1px solid rgba(255,215,0,0.08);
  color: var(--white-dim);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

#site-footer .footer-emblem {
  width: 28px;
  height: 28px;
  opacity: 0.4;
  margin: 0 auto 12px;
  display: block;
}

/* ── Floating upload FAB ──────────────────────────────────── */
#fab-upload {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 25px rgba(255,215,0,0.4), 0 2px 8px rgba(0,0,0,0.4);
  transition: var(--transition);
  color: var(--black);
  opacity: 0;
  pointer-events: none;
}

#fab-upload.visible {
  opacity: 1;
  pointer-events: all;
}

#fab-upload:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 35px rgba(255,215,0,0.55), 0 4px 12px rgba(0,0,0,0.5);
}

/* ── Utilities ────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
