/* ============ CSS VARIABLES ============ */
:root {
    --pink-light: #fdf2f4;
    --pink-medium: #f8d7da;
    --pink-accent: #e8a0b0;
    --beige: #f5f0e8;
    --gold: #c9a86c;
    --gold-dark: #a8894d;
    --white: #ffffff;
    --text-dark: #4a4a4a;
    --text-light: #6b6b6b;
    --nav-height: 60px;
    --bottom-nav-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    /* margin: 0;
    padding: 0; */
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    background-color: var(--pink-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Font Classes */
.font-script {
    font-family: 'Great Vibes', cursive;
}

.font-elegant {
    font-family: 'Cormorant Garamond', serif;
}

/* Floral Pattern Background */
.floral-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e8a0b0' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============ HERO SECTION ============ */
#hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../images/share_preview10.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay 1/3 dưới */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.7) 70%,
        rgba(255, 255, 255, 0.95) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    margin-top: auto;
    padding: 2rem 1rem 6rem;
    text-align: center;
}

@media (min-width: 640px) {
    .hero-content {
        padding: 3rem 2rem 8rem;
    }
}

@media (max-width: 640px) {
    .hero-content {
        margin-top: auto;
        padding-top: 6rem; 
        padding-bottom: 0rem;
    }
}

/* ============ STICKY HEADER ============ */
.sticky-header {
    position: fixed;
    top: -100%;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: top 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.sticky-header.visible {
    top: 0;
}

.sticky-header .logo {
    font-family: 'Great Vibes', cursive;
    font-size: 1.5rem;
    color: var(--pink-accent);
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 2rem;
    }
    .hamburger {
        display: none;
    }
}

.desktop-nav a {
    font-size: 0.875rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--pink-accent);
    transition: width 0.3s;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after {
    width: 100%;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-menu a:hover {
    color: var(--pink-accent);
}

/* ============ BOTTOM NAVIGATION (MOBILE) ============ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: var(--safe-area-bottom);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.65rem;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--pink-accent);
    background: rgba(232, 160, 176, 0.1);
}

.bottom-nav-item .icon {
    font-size: 1.25rem;
}

/* Mobile padding for bottom nav */
@media (max-width: 767px) {
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    }
    .hero-background {
        background-image: url('../../images/bg_main.png');
    }
}

/* ============ FLOATING ACTION BUTTONS ============ */
.fab-container {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--bottom-nav-height) + 1rem + var(--safe-area-bottom));
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .fab-container {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: none;
    font-size: 1.25rem;
}

/* ========== TOOLTIP PHI RA TỪ NÚT ========== */
.music-hint{
  position: absolute;
  right: calc(100% - 35px);   /* nằm sát bên trái của nút */
  top: 50%;
  transform: translateY(-50%) translateX(14px) scale(0.95);

  background: #ffffff;
  color: #c63b5a;
  border: 1.5px solid #f3a3b5;

  padding: 14px 14px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;

  box-shadow: 0 6px 16px rgba(248, 170, 185, 0.35);

  opacity: 0;
  pointer-events: none;
  z-index: -1;

  animation: hintSlideLeft 4s ease forwards;
}

@keyframes hintSlideLeft{
  0%{
    opacity: 0;
    transform: translateY(-50%) translateX(16px) scale(0.92);
  }
  18%{
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
  85%{
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
  100%{
    opacity: 0;
    transform: translateY(-50%) translateX(8px) scale(0.95);
  }
}

.fab-music {
    background: white;
    border: 2px solid var(--pink-medium);   
    position: relative;   /* <<< thêm dòng này */
    overflow: visible;    /* <<< thêm để tooltip không bị cắt */
}

.fab:hover {
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.95);
}

.fab-scroll-top {
    background: var(--pink-accent);
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.fab-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Music Button Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fab-music.playing .music-icon {
    animation: spin 3s linear infinite;
}

/* ============ ANIMATIONS ============ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ============ COUNTDOWN BOXES ============ */
.countdown-box {
    background: linear-gradient(135deg, var(--white) 0%, var(--pink-light) 100%);
    border: 2px solid var(--pink-accent);
    box-shadow: 0 10px 30px rgba(200, 150, 160, 0.2);
}

/* ============ EVENT CARDS ============ */
.event-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .event-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(200, 150, 160, 0.3);
    }
}

.event-card:active {
    transform: scale(0.98);
}

/* ============ GOOGLE MAP EMBED ============ */
.map-embed {
    width: 100%;
    height: 180px;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #f3f3f3;
}

.map-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============ BUTTONS ============ */
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn-gold:hover {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(201, 168, 108, 0.4);
    }
}

.btn-gold:active {
    transform: scale(0.98);
}

/* ============ PHOTO GRID ============ */
.photo-item {
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .photo-item:hover {
        transform: scale(1.02);
    }

    .photo-item:hover img {
        transform: scale(1.1);
    }
}

.photo-item img {
    transition: transform 0.5s ease;
}

.photo-item:active {
    transform: scale(0.98);
}

/* ============ LIGHTBOX ============ */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* ============ DECORATIVE LINE ============ */
.decorative-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ============ FORM ELEMENTS ============ */
.custom-radio input:checked + span {
    background-color: var(--pink-accent);
    border-color: var(--pink-accent);
    color: white;
}

input, textarea, select {
    font-size: 16px !important; /* Prevent zoom on iOS */
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--pink-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pink-accent);
    border-radius: 4px;
}

/* Hide scrollbar on mobile */
@media (max-width: 767px) {
    ::-webkit-scrollbar {
        display: none;
    }
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ============ RESPONSIVE TYPOGRAPHY ============ */
.text-responsive-sm {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.text-responsive-base {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.text-responsive-lg {
    font-size: clamp(1rem, 3vw, 1.25rem);
}

.text-responsive-xl {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.text-responsive-2xl {
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.text-responsive-3xl {
    font-size: clamp(2rem, 6vw, 3rem);
}

.text-responsive-4xl {
    font-size: clamp(2.5rem, 8vw, 4rem);
}

.text-responsive-5xl {
    font-size: clamp(3rem, 10vw, 5rem);
}

/* ============ RESPONSIVE SPACING ============ */
.section-padding {
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.container-padding {
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
}

/* Container fallback nếu Tailwind không load */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ============ QR CODE CARDS ============ */
.qr-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--pink-light) 100%);
    border: 2px solid var(--pink-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .qr-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(200, 150, 160, 0.3);
    }
}

.qr-card:active {
    transform: scale(0.98);
}

/* ============ ORIENTATION HANDLING ============ */
@media (orientation: landscape) && (max-height: 500px) {
    #hero {
        min-height: auto;
        padding: 3rem 1rem;
    }
    
    .countdown-box {
        padding: 0.75rem !important;
    }
    
    .countdown-box span:first-child {
        font-size: 1.5rem !important;
    }
}

/* ============ WEDDING CALENDAR ============ */
.calendar-card {
    background: linear-gradient(180deg, #ffffff 0%, #fdf2f4 100%);
    border-radius: 1rem;
    border: 1px solid var(--pink-medium);
    padding: 1.5rem 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(200, 150, 160, 0.25);
    font-family: 'Cormorant Garamond', serif;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.15em;
    font-size: 1.5rem;
    text-transform: uppercase;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 0.5rem;
}

.calendar-weekdays span {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eee;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
    font-size: 1rem;
}

.calendar-day {
    width: 2rem;
    height: 2rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--text-dark);
}

.calendar-day--empty {
    background: transparent;
}

.calendar-day--muted {
    color: #c0c0c0;
}

.calendar-day--wedding {
    background: var(--pink-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(200, 150, 160, 0.35);
}

/* Hiệu ứng trái tim rơi thẳng */
.heart {
    position: fixed;
    top: -10px;
    left: 0;
    pointer-events: none;
    animation-name: heart-fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    opacity: 0.9;
    z-index: 9999;
}

@keyframes heart-fall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh);
        opacity: 0;
    }
}
