/* 引入字體變數 */
:root {
    --heading-font: 'Playfair Display', serif; /* 優雅的襯線體(標題用) */
    --body-font: 'Lato', sans-serif;           /* 乾淨的無襯線體(內文用) */
    --text-color: #4a4a4a;
    --bg-color: #ffffff;
    --light-bg: #fdfbf9; /* 淡淡的米白色 */
    --accent-color: #d4c19c; /* 香檳金/沙色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; /* 點擊選單時平滑捲動 */
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
}

h1, h2, h3, .logo {
    font-family: var(--heading-font);
    font-weight: normal;
}

/* 導覽列 (預設透明) */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    z-index: 100;
    transition: all 0.4s ease;
    background: transparent;
}

/* 當捲動時，透過 JS 加上這個 class 讓導覽列變白 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar.scrolled .logo,
.navbar.scrolled .nav-links a {
    color: var(--text-color);
}

.logo {
    font-size: 28px;
    color: white; /* 預設白色以配合深色照片背景 */
    transition: color 0.4s ease;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: white; /* 預設白色 */
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.4s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* 首圖視差滾動 (Parallax Hero) */
.hero {
    height: 100vh;
    /* 這裡放一張高質感的背景圖，可以直接替換網址 */
    background-image: url('background_1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 產生視差滾動的關鍵設定 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    color: white;
}

/* 讓背景圖變暗一點，確保白字能看清楚 */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content .date {
    font-size: 16px;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.hero-content .names {
    font-size: 80px;
    font-style: italic;
    margin-bottom: 10px;
}

.hero-content .subtitle {
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* 通用區塊設定 */
.section {
    padding: 120px 20px;
    text-align: center;
    scroll-margin-top: 110px; /* 避免點選導覽列錨點時，標題被固定導覽列擋住 */
}

.light-bg {
    background-color: var(--light-bg);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.section h2 {
    font-size: 40px;
    margin-bottom: 20px;
    font-style: italic;
}

/* 優雅的小分隔線 */
.divider {
    width: 60px;
    height: 1px;
    background-color: var(--accent-color);
    margin: 0 auto 40px auto;
}

.section p {
    font-size: 16px;
    color: #666;
}

/* 照片分隔視差區塊 */
.parallax-divider {
    height: 60vh;
    background-image: url('background_2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 產生視差滾動 */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
}

/* 細節網格排版 */
.details-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.detail-box {
    text-align: center;
    min-width: 250px;
}

.detail-box h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.detail-box h3:not(:first-child) {
    margin-top: 30px;
}

.info-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 淡入動畫 */
.fade-in-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================
   RSVP 區塊 (美化版)
   ========================================= */

/* 1. 加大 RSVP 標題字體與優雅設計 */
#rsvp h2 {
    font-family: 'Playfair Display', serif; /* 如果沒引入這個字體，會自動用明體 */
    font-size: 50px;
    font-weight: normal;
    color: #4a4a4a;
    letter-spacing: 2px;
    margin-bottom: 5px; /* 下方留一點點空間給分界線 */
}

/* 小分界線也美化一下 (香檳金色) */
.divider {
    width: 60px;
    height: 2px;
    background-color: var(--accent-color);
    margin: 0 auto 50px auto; /* 加上 50px 的底部間距，推開下方的文字 */
}

#rsvp p {
    font-size: 15px;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* 2. 升級表單容器 (加大內距) */
.rsvp-form {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 60px; /* 大幅增加內距，更顯大氣 */
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05); /* 輕柔的陰影 */
    text-align: left;
}

/* 3. 核心修改：大幅加大每行間距 */
.form-group {
    margin-bottom: 30px; /* 從原本的 20px 增加到 30px */
}

/* 標籤文字 (NAME, ATTENDANCE...) */
.form-group label {
    display: block;
    font-size: 13px;
    text-transform: uppercase; /* 轉大寫，看起來更專業 */
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 12px; /* 標籤和輸入框之間的間距也加大 */
}

/* 4. 美化輸入框和下拉選單 (香檳金色調) */
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    font-size: 16px;
    color: var(--text-color);
    background-color: #fafafa;
    transition: all 0.3s ease; /* 增加過度動畫 */
    font-family: inherit;
    resize: vertical;
}

/* 當滑鼠點擊(Focus)輸入框時的效果 */
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color); /* 邊框變金色 */
    background-color: white;
    box-shadow: 0 0 10px rgba(212, 193, 156, 0.2); /* 加上金色光暈 */
}

/* 參加人數的加減按鈕（手機瀏覽器不會顯示 input type=number 的原生上下鍵，改用自訂按鈕） */
.stepper {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.stepper input {
    text-align: center;
    /* 隱藏瀏覽器原生的上下鍵，統一改用自訂的 +／− 按鈕 */
    -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-btn {
    flex: 0 0 50px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    background-color: #fafafa;
    color: var(--text-color);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stepper-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.stepper-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 5. 美化提交按鈕 (香檳金) */
.submit-btn {
    width: 100%;
    padding: 18px;
    background-color: var(--accent-color); /* 使用你設定好的金色 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease; /* 增加過度動畫 */
}

/* 當滑鼠移到按鈕上(Hover)的效果 */
.submit-btn:hover {
    background-color: #c4b08b; /* 滑鼠移過去變深一點點 */
    transform: translateY(-2px); /* 輕微上浮 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* 加強陰影 */
}

/* 當按鈕被點擊(Active)瞬間的效果 */
.submit-btn:active {
    transform: translateY(0); /* 恢復原位 */
}

/* =========================================
   響應式設計 - 平板與手機適配
   ========================================= */

/* 平板 (768px 以下) */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .navbar.scrolled {
        padding: 10px 20px;
    }

    .logo {
        font-size: 22px;
    }

    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 11px;
    }

    .hero {
        height: 60vh;
        background-attachment: scroll; /* 手機上關閉視差效果 */
    }

    .hero-content .names {
        font-size: 50px;
    }

    .hero-content .date {
        font-size: 14px;
    }

    .hero-content .subtitle {
        font-size: 16px;
    }

    .section {
        padding: 80px 15px;
    }

    .section h2 {
        font-size: 32px;
    }

    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .details-grid {
        gap: 30px;
        flex-direction: column;
    }

    .detail-box {
        min-width: 100%;
    }

    .rsvp-form {
        padding: 40px 20px;
        margin: 0 15px;
    }

    .parallax-divider {
        height: 40vh;
        background-attachment: scroll; /* 手機上關閉視差效果 */
        font-size: 24px;
    }
}

/* 手機 (480px 以下) */
@media (max-width: 480px) {
    .navbar {
        padding: 12px 10px;
    }

    .logo {
        font-size: 18px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .hero {
        height: 50vh;
    }

    .hero-content .names {
        font-size: 36px;
    }

    .hero-content .date {
        font-size: 12px;
    }

    .hero-content .subtitle {
        font-size: 14px;
    }

    .section {
        padding: 60px 10px;
    }

    .section h2 {
        font-size: 26px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input, .form-group select, .form-group textarea {
        padding: 12px;
        font-size: 14px;
    }

    .submit-btn {
        padding: 14px;
        font-size: 13px;
    }

    .detail-box h3 {
        font-size: 20px;
    }

    .detail-box {
        min-width: 90%;
    }

    .rsvp-form {
        padding: 30px 15px;
        margin: 0 10px;
    }

    .parallax-divider {
        height: 35vh;
        font-size: 20px;
    }

    /* 播放器容器在手機上的適配 */
    .music-player-container {
        padding: 15px 10px;
    }
}

/* 超小螢幕 (360px 以下) */
@media (max-width: 360px) {
    .nav-links {
        gap: 5px;
    }

    .nav-links a {
        font-size: 9px;
    }

    .section h2 {
        font-size: 22px;
    }

    .form-group label {
        font-size: 11px;
    }
}

/* =========================================
   🎵 音樂播放器 - CD 光碟
   ========================================= */

.music-player-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CD 光碟樣式 - 融入婚禮設計 */
.music-player-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 1000;
    width: 122px;
    height: 122px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideUp 0.6s ease-out;
}

/* CD 光碟 */
.cd-disc {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), transparent 28%),
        radial-gradient(circle at 60% 60%, rgba(212, 193, 156, 0.18), transparent 35%),
        conic-gradient(
            from 0deg,
            #241c1b,
            #2d2320,
            #3f2d2a,
            #2d2320,
            #241c1b
        );
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.18),
        inset 0 -8px 14px rgba(0, 0, 0, 0.45),
        0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: spinCD 8s linear infinite paused;
    position: relative;
}

.cd-disc::after {
    content: '';
    position: absolute;
    width: 66%;
    height: 66%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.08);
}

/* 微光高光 */
.cd-disc::before {
    content: '';
    position: absolute;
    width: 42px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    top: 18px;
    left: 18px;
    filter: blur(2px);
}

/* CD 旋轉動畫 */
@keyframes spinCD {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cd-disc.playing {
    animation: spinCD 7.2s linear infinite;
}

/* CD 中心 - 香檳金中心孔 */
.cd-center {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff7e5 0%, #f2d488 28%, #b18f55 56%, #7c6436 100%);
    box-shadow: 
        0 0 16px rgba(212, 193, 156, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.35),
        inset 0 -3px 6px rgba(0, 0, 0, 0.25);
    z-index: 3;
    position: relative;
}

.cd-center::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    top: 6px;
    left: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    filter: blur(0.5px);
}

.cd-disc:hover {
    transform: scale(1.08);
    box-shadow: 
        inset 0 -6px 14px rgba(0, 0, 0, 0.48),
        0 18px 40px rgba(0, 0, 0, 0.22);
}

.cd-disc:active {
    transform: scale(1.03);
}

/* 平板上的 CD 播放器調整 */
@media (max-width: 768px) {
    .music-player-container {
        bottom: 16px;
        right: 16px;
        width: 108px;
        height: 108px;
    }

    .cd-disc {
        width: 82px;
        height: 82px;
    }
}

/* 手機上的 CD 播放器調整 */
@media (max-width: 480px) {
    .music-player-container {
        bottom: 12px;
        right: 12px;
        width: 92px;
        height: 92px;
    }

    .cd-disc {
        width: 70px;
        height: 70px;
    }

    .cd-disc::after {
        width: 60%;
        height: 60%;
    }

    .cd-center {
        width: 20px;
        height: 20px;
    }
}

/* 平板上的 CD 播放器調整 */
@media (max-width: 768px) {
    .music-player-container {
        bottom: 15px;
        right: 15px;
    }

    .cd-disc {
        width: 85px;
        height: 85px;
    }
}

/* 手機上的 CD 播放器調整 */
@media (max-width: 480px) {
    .music-player-container {
        bottom: 10px;
        right: 10px;
    }

    .cd-disc {
        width: 75px;
        height: 75px;
    }

    .cd-center {
        width: 18px;
        height: 18px;
    }
}