/* ================================
   1. CSS VARIABLES
   ================================ */
:root {
  /* Primary Colors - Warna Utama (Biru Laut) */
  --primary-light: #6ec6ff; /* biru muda laut */
  --primary-base: #0288d1; /* biru laut utama */
  --primary-dark: #01579b; /* biru laut tua */

  /* Secondary Colors - Warna Pendukung (Turquoise / Teal) */
  --secondary-light: #80deea;
  --secondary-base: #26c6da;
  --secondary-dark: #0097a7;

  /* Accent Colors - Warna Aksen (Biru Toska & Hijau Laut) */
  --accent-gold: #00b8a9; /* hijau laut segar */
  --accent-copper: #4dd0e1; /* biru toska lembut */

  /* Neutral Colors - Warna Netral (Putih dan Biru Pucat) */
  --neutral-white: #ffffff;
  --neutral-cream: #f0f9ff; /* biru muda sangat pucat */
  --neutral-light: #d9f3ff; /* biru muda lembut */

  /* Text Colors - Warna Teks (Abu kebiruan & Navy) */
  --text-primary: #0d47a1; /* biru tua untuk teks utama */
  --text-secondary: #1565c0; /* biru sedang untuk teks sekunder */
  --text-light: #5e92f3; /* biru terang untuk teks ringan */
}

/* ================================
   2. BASE STYLES
   ================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.hidden {
  display: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--text-primary);
}

/* Background */
.bg-patten {
  background-image: url("../assets/ornamen/bg3.png");
  background-color: var(--neutral-cream);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Optimize images loading */
img {
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Prevent layout shift */
.couple-photo,
.gallery-item img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-item img {
  aspect-ratio: 4 / 3;
}

/* Use will-change for animated elements */
.story-card,
.event-card,
.gift-card,
.gallery-item {
  will-change: transform;
}

/* GPU acceleration for smoother animations */
.hero-section,
.cover-section {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ================================
   3. COVER SECTION
   ================================ */
.cover-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("../assets/ornamen/bg3.png");
  background-color: var(--neutral-white);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.cover-section.hidden {
  opacity: 0;
  visibility: hidden;
}

.cover-content {
  text-align: center;
  color: var(--text-primary);
  padding: 2rem;
}

.cover-title {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.cover-subtitle {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cover-date {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.cover-ornament {
  font-size: 3rem;
  color: var(--accent-gold);
  margin: 1.5rem 0;
}

.btn-open {
  background: var(--primary-base);
  color: var(--neutral-white);
  border: none;
  padding: 1rem 3rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(139, 69, 19, 0.3);
}

.btn-open:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.btn-open i {
  margin-left: 0.5rem;
}

/* ================================
   4. NAVBAR (BOTTOM NAVIGATION)
   ================================ */
.navbar {
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  transition: all 0.3s ease;
  position: fixed;
  bottom: 0;
  top: auto;
  width: 100vw;
  z-index: 1000;
}

.navbar-brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-gold) !important;
  display: none;
}

.navbar-collapse {
  justify-content: center;
}

.navbar-nav {
  flex-direction: row;
  justify-content: space-around;
  width: 100%;
}

.nav-item {
  flex: 1;
  text-align: center;
}

.nav-link {
  color: var(--text-primary) !important;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  padding: 0.5rem 0.25rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.nav-link i {
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-gold) !important;
}

.nav-link:hover i {
  color: var(--accent-gold);
  transform: scale(1.1);
}

.nav-link .nav-text {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hide navbar toggle button */
.navbar-toggler {
  display: none;
}

/* Desktop navbar style */
@media (min-width: 992px) {
  .navbar {
    top: 0;
    bottom: auto;
    padding: 1rem 0;
  }

  .navbar-brand {
    display: block;
  }

  .navbar-nav {
    flex-direction: row;
    justify-content: flex-end;
    width: auto;
  }

  .nav-item {
    flex: none;
  }

  .nav-link {
    flex-direction: row;
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
  }

  .nav-link i {
    font-size: 1rem;
  }

  .nav-link .nav-text {
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: normal;
  }
}

/* ================================
   5. HERO SECTION
   ================================ */
.hero-section {
  background-image: url("../assets/ornamen/bg3.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-blend-mode: overlay;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.ornament-1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100vh;
  background-image: url("../assets/ornamen/fl3.png");
  background-size: 100%;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 2s ease-in-out;
}

.ornament-2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100vh;
  background-image: url("../assets/ornamen/fl4.png");
  background-position: bottom;
  background-size: 100%;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 2s ease-in-out;
}
.hero-content {
  text-align: center;
  z-index: 2;
  padding: 2rem;
}

.hero-title {
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-date {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Confetti Canvas */
#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ================================
   6. SECTIONS
   ================================ */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--accent-gold);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent-gold);
  margin: 1rem auto;
}

/* ================================
   7. COUNTDOWN TIMER
   ================================ */
.countdown-container {
  background: var(--neutral-white);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.countdown-item {
  text-align: center;
  padding: 1rem;
}

.countdown-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: block;
}

.countdown-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ================================
   8. COUPLE SECTION
   ================================ */
.couple-section {
  background-color: var(--neutral-white);
}

.couple-card {
  text-align: center;
  padding: 2rem;
}

.couple-photo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--accent-gold);
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.couple-name {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.couple-title {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.couple-bio {
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 400px;
  margin: 0 auto;
}

.couple-divider {
  font-size: 4rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ================================
   9. STORY SECTION
   ================================ */
.story-card {
  background: var(--neutral-white);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.story-card:hover {
  transform: translateY(-5px);
}

.story-icon {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
}

/* ================================
   10. EVENT DETAILS
   ================================ */
.event-card {
  background: var(--neutral-white);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  text-align: center;
}

.event-icon {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
}

.event-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.event-details p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.btn-map {
  background: var(--primary-base);
  color: var(--neutral-white);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.btn-map:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

/* ================================
   11. GALLERY
   ================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* ================================
   12. LOCATION SECTION
   ================================ */
.location-map {
  width: 100%;
  height: 450px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.location-map iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ================================
   13. RSVP FORM
   ================================ */
.rsvp-form {
  background: var(--neutral-white);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.form-control,
.form-select {
  border-radius: 10px;
  padding: 0.8rem;
  border: 2px solid #e0e0e0;
  margin-bottom: 1.5rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 0.2rem rgba(193, 154, 107, 0.25);
}

.btn-submit {
  background: var(--primary-base);
  color: var(--neutral-white);
  border: none;
  padding: 1rem 3rem;
  border-radius: 50px;
  font-weight: 600;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ================================
   14. WISHES SECTION
   ================================ */
.wishes-container {
  max-width: 800px;
  margin: 0 auto;
}

.wish-card {
  background: var(--neutral-white);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.wish-author {
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.wish-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ================================
   15. GIFT SECTION
   ================================ */
.gift-card {
  background: var(--neutral-white);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.gift-icon {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
}

.account-info {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1.5rem;
}

.btn-copy {
  background: var(--primary-base);
  color: var(--neutral-white);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ================================
   16. MUSIC PLAYER
   ================================ */
.music-player {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--neutral-white);
  padding: 1rem;
  border-radius: 50%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

.music-player:hover {
  transform: scale(1.1);
}

.music-player i {
  font-size: 1.5rem;
  color: var(--accent-gold);
}

/* ================================
   17. FOOTER
   ================================ */
footer {
  margin-bottom: -10px;
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--neutral-cream) 100%);
  padding: 3rem 0 1rem;
  text-align: center;
}

.social-links a {
  color: var(--accent-gold);
  font-size: 1.5rem;
  margin: 0 1rem;
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  color: var(--primary-base);
}

/* ================================
   18. RESPONSIVE DESIGN - MOBILE FIRST
   ================================ */

/* Extra small devices (portrait phones, less than 375px) */
@media (max-width: 374px) {
  .cover-title {
    font-size: 1.8rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.7rem;
  }
  .countdown-value {
    font-size: 1.5rem;
  }
  .countdown-label {
    font-size: 0.7rem;
  }
  .couple-photo {
    width: 150px;
    height: 150px;
  }
  .couple-name {
    font-size: 1.5rem;
  }
  .btn-open {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }
  .story-card,
  .event-card,
  .gift-card {
    padding: 1.2rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 576px) {
  .cover-title {
    font-size: 2.2rem;
  }
  .cover-subtitle {
    font-size: 1rem;
  }
  .cover-date {
    font-size: 1.2rem;
  }
  .cover-ornament {
    font-size: 2rem;
    margin: 1rem 0;
  }
  .btn-open {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.2rem;
  }
  .hero-date {
    font-size: 1.5rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .countdown-container {
    padding: 1rem;
  }
  .countdown-item {
    padding: 0.5rem;
  }
  .countdown-value {
    font-size: 2rem;
  }
  .countdown-label {
    font-size: 0.75rem;
  }
  .couple-photo {
    width: 180px;
    height: 180px;
  }
  .couple-name {
    font-size: 1.8rem;
  }
  .couple-title {
    font-size: 1rem;
  }
  .couple-bio {
    font-size: 0.9rem;
  }
  .couple-divider {
    font-size: 2rem;
    padding: 1rem 0;
    display: block !important;
  }
  .story-card,
  .event-card,
  .gift-card {
    padding: 1.5rem;
  }
  .story-icon,
  .event-icon,
  .gift-icon {
    font-size: 2rem;
  }
  .event-title {
    font-size: 1.5rem;
  }
  .event-details p {
    font-size: 0.9rem;
  }
  .btn-map,
  .btn-submit {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
  .gallery-item img {
    height: 200px;
  }
  .location-map {
    height: 300px;
  }
  .rsvp-form {
    padding: 1.5rem;
  }
  .form-control,
  .form-select {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
  .wish-card {
    padding: 1.5rem;
  }
  .account-info {
    padding: 1rem;
    font-size: 0.9rem;
  }
  .music-player {
    bottom: 80px;
    right: 15px;
    padding: 0.8rem;
  }
  .music-player i {
    font-size: 1.2rem;
  }
  .navbar-brand {
    font-size: 1.5rem;
  }
  section {
    padding: 3rem 0 4rem;
  }
  .social-links a {
    font-size: 1.3rem;
    margin: 0 0.7rem;
  }

  /* Bottom navigation specific adjustments */
  .nav-link {
    padding: 0.4rem 0.2rem !important;
  }
  .nav-link i {
    font-size: 1.2rem;
  }
  .nav-link .nav-text {
    font-size: 0.6rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 577px) and (max-width: 768px) {
  .cover-title {
    font-size: 3rem;
  }
  .hero-title {
    font-size: 3.5rem;
  }
  .section-title {
    font-size: 2.5rem;
  }
  .countdown-value {
    font-size: 2.5rem;
  }
  .couple-photo {
    width: 220px;
    height: 220px;
  }
  .couple-name {
    font-size: 2.2rem;
  }
  .couple-divider {
    font-size: 3rem;
    padding: 1rem 0;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .rsvp-form {
    padding: 2rem;
  }
  .location-map {
    height: 350px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 769px) and (max-width: 992px) {
  .hero-title {
    font-size: 4rem;
  }
  .couple-photo {
    width: 230px;
    height: 230px;
  }
  .location-map {
    height: 400px;
  }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section,
  .cover-section {
    min-height: auto;
    padding: 5rem 0;
  }
  .hero-title,
  .cover-title {
    font-size: 2rem;
  }
  .countdown-container {
    margin-top: 1rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-open,
  .btn-map,
  .btn-submit,
  .btn-copy {
    min-height: 44px;
    min-width: 44px;
  }
  .nav-link {
    padding: 0.7rem 0.5rem;
  }
  .gallery-item:active {
    transform: scale(0.98);
  }
  .music-player {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Navbar improvements for mobile */
@media (max-width: 991px) {
  .navbar {
    bottom: 0;
    top: auto;
    padding: 0.5rem 0;
    border-top: 2px solid var(--accent-gold);
  }

  .navbar-collapse {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    margin-top: 0;
    box-shadow: none;
  }

  .nav-item {
    text-align: center;
    flex: 1;
  }

  .nav-link {
    padding: 0.5rem 0.25rem !important;
  }

  /* Add padding bottom to body to prevent content hidden by bottom nav */
  body {
    padding-bottom: 70px;
  }
}

/* Desktop navbar */
@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

/* Container adjustments for all screen sizes */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ================================
   19. UTILITY CLASSES
   ================================ */

/* Fix overflow issues on mobile */
body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Improve touch targets */
a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* Smooth font scaling */
html {
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 14px;
  }
}

/* ================================
   20. ACCESSIBILITY & SPECIAL FEATURES
   ================================ */

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .couple-photo,
  .gallery-item img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .navbar,
  .music-player,
  .btn-map,
  .btn-submit,
  .btn-copy,
  .btn-open {
    display: none !important;
  }
  section {
    page-break-inside: avoid;
  }
}
