/* Import Premium Fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties for Design System */
:root {
  --bg-color: #08090a;
  --bg-gradient-start: #08090c;
  --bg-gradient-end: #12141c;

  --panel-bg: rgba(255, 255, 255, 0.02);
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-hover-bg: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(255, 255, 255, 0.16);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-color: #ff3b6f;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 0%, var(--bg-gradient-end), var(--bg-gradient-start) 70%);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* App Container - Full Viewport Flex Column so Footer always stays at bottom */
.app-container {
  max-width: 1200px;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.25rem 1.5rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Header & Profile Hero Section */
.profile-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-wrapper {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 0 auto 1.25rem auto;
}

.avatar-border {
  position: absolute;
  inset: -3px;
  background: var(--accent-gradient);
  border-radius: 50%;
  opacity: 0.85;
}

.avatar-image {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #0c0d12;
  object-fit: cover;
  background: #1f2937;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

/* Social Buttons */
.social-links {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-social {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
  box-shadow: none;
}

.btn-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
}

.btn-instagram:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-github {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.btn-github:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  transform: translateY(-2px);
}

.btn-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Gallery Section & Vault Gate */
.hidden {
  display: none !important;
}

.gallery-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.vault-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.5rem auto;
  width: 100%;
  text-align: center;
}

.btn-unlock-trigger {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.9rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: none;
  transition: var(--transition-normal);
}

.btn-unlock-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.lock-svg {
  width: 18px;
  height: 18px;
}

.vault-form-card {
  position: relative;
  background: rgba(16, 18, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 1.65rem 1.4rem 1.4rem 1.4rem;
  width: 100%;
  max-width: 420px;
  box-shadow: none;
  animation: vaultPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vaultPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.vault-form-card.shake {
  animation: shakeError 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: rgba(255, 59, 111, 0.5);
}

.vault-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.vault-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.vault-header-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.6rem auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.vault-header-icon svg {
  width: 20px;
  height: 20px;
}

.vault-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.vault-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

/* Modern 3-Slot Interactive Birthday Controls */
.dob-modern-slots {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.15fr;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.dob-slot {
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-fast);
}

.dob-slot:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
}

.slot-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.slot-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.2rem;
}

.step-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.step-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.slot-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.slot-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
}

.slot-month-btn {
  width: 100%;
  height: 26px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0 0.4rem;
}

#selectedMonthText:empty {
  display: none;
}

.slot-month-btn:hover,
.slot-month-btn.active {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.chevron-svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.slot-month-btn.active .chevron-svg {
  transform: rotate(180deg);
}

/* Custom 12-Month Pill Grid */
.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem;
  background: rgba(8, 9, 14, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.month-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.42rem 0.25rem;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.month-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.month-pill.selected {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.vault-error {
  color: #ff4d79;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.btn-confirm-unlock {
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

.btn-confirm-unlock:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Unlocked 5-Minute Countdown Bar */
.unlock-timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.timer-info {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  min-width: 0;
}

.timer-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.timer-text strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.btn-lock-now {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-lock-now:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

@keyframes shakeError {
  10%, 90% { transform: translateX(-4px); }
  20%, 80% { transform: translateX(6px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* Photos Masonry Grid */
.gallery-grid {
  column-count: 4;
  column-gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1200px) {
  .gallery-grid {
    column-count: 3;
    column-gap: 1.25rem;
  }
}

.photo-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.25rem;
  break-inside: avoid;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
  transform: translateY(0);
}

.photo-item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.photo-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
  background: #0f1015;
}

.photo-item:hover .photo-img {
  transform: scale(1.04);
}

.photo-overlay,
.photo-title,
.photo-category {
  display: none !important;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: 83vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  object-fit: contain;
}

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

/* Lightbox Controls */
.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  z-index: 110;
  outline: none;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.lightbox-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.btn-close {
  top: 1.5rem;
  right: 1.5rem;
}

.btn-prev {
  left: 2rem;
}

.btn-next {
  right: 2rem;
}

/* Lightbox caption and photo index */
.lightbox-info {
  margin-top: 1.25rem;
  text-align: center;
  z-index: 105;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.lightbox-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Footer Section - Always pinned to the bottom of the page */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--panel-border);
  padding: 1.25rem 0 0.5rem 0;
  text-align: center;
  width: 100%;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.footer-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Tablet & Mobile Responsiveness */
@media (max-width: 768px) {
  .app-container {
    padding: 1.25rem 1rem 1rem 1rem;
  }

  .profile-card {
    padding: 2rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 20px;
  }

  .profile-name {
    font-size: 1.7rem;
  }

  .avatar-wrapper {
    width: 110px;
    height: 110px;
    margin-bottom: 1rem;
  }

  .social-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    max-width: 300px;
    margin: 0.75rem auto 0 auto;
  }

  .btn-social {
    justify-content: center;
    padding: 0.7rem 1.25rem;
  }

  .vault-gate {
    margin: 0.5rem auto 1.25rem auto;
  }

  .btn-unlock-trigger {
    font-size: 0.98rem;
    padding: 0.9rem 1.85rem;
  }

  .vault-form-card {
    padding: 1.35rem 1.1rem;
    margin-top: 0.5rem;
  }

  .vault-title {
    font-size: 1.05rem;
  }

  .unlock-timer-bar {
    padding: 0.7rem 1rem;
    margin-bottom: 1.25rem;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 0.75rem;
  }

  .photo-item {
    margin-bottom: 0.75rem;
  }

  .footer {
    padding: 1rem 0 0.25rem 0;
  }

  .footer-text {
    font-size: 0.8rem;
  }

  .btn-prev,
  .btn-next {
    display: none;
  }

  .lightbox-btn.btn-close {
    width: 42px;
    height: 42px;
    top: 1rem;
    right: 1rem;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 1rem 0.85rem 0.85rem 0.85rem;
  }

  .profile-card {
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
  }

  .avatar-wrapper {
    width: 96px;
    height: 96px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .dob-modern-slots {
    grid-template-columns: 1fr 1.05fr 1.15fr;
    gap: 0.4rem;
  }

  .dob-slot {
    padding: 0.45rem 0.3rem;
  }

  .step-btn {
    width: 23px;
    height: 23px;
    font-size: 0.9rem;
  }

  .slot-input {
    font-size: 1rem;
  }

  .slot-month-btn {
    font-size: 0.85rem;
    height: 24px;
  }

  .month-picker-grid {
    gap: 0.35rem;
    padding: 0.45rem;
  }

  .month-pill {
    font-size: 0.75rem;
    padding: 0.38rem 0.2rem;
  }

  .unlock-timer-bar {
    padding: 0.6rem 0.75rem;
    gap: 0.4rem;
  }

  .timer-info {
    font-size: 0.78rem;
    gap: 0.4rem;
  }

  .timer-text {
    gap: 0.35rem;
  }

  .timer-text strong {
    font-size: 0.85rem;
  }

  .btn-lock-now {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 0.5rem;
  }

  .photo-item {
    margin-bottom: 0.5rem;
    border-radius: 12px;
  }
}

/* Ultra-Small Phones (<= 360px) */
@media (max-width: 360px) {
  .dob-modern-slots {
    gap: 0.3rem;
  }

  .step-btn {
    width: 20px;
    height: 20px;
    font-size: 0.82rem;
  }

  .slot-input {
    font-size: 1rem;
  }

  .slot-month-btn {
    font-size: 0.78rem;
  }
}
