/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    /* Pastel Colors */
    --pastel-blue: #3559C7;
    --pastel-pink: #E297B1;
    --pastel-green: #69AF7E;
    --pastel-yellow: #F0BF3E;

    /* Main Colors */
    --primary: #3559C7;
    --secondary: #ffcad4;
    --accent: #b4e7ce;
    --highlight: #fff5ba;

    /* Text Colors */
    --text-dark: #333333;
    --text-light: #666666;
    --text-white: #ffffff;

    /* Backgrounds */
    --bg-light: #fefefe;
    --bg-cream: #faf8f5;

    /* Fonts */
    --font-thai: 'Prompt', sans-serif;
    --font-display: 'Playfair Display', serif;
    --font-script: 'Great Vibes', cursive;

    /* Spacing */
    --section-padding: 80px 20px;
    --container-max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-thai);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Loading Screen
======================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--pastel-blue) 0%, var(--pastel-pink) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: var(--text-white);
}

.hearts {
    font-size: 48px;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

.hearts i:nth-child(2) {
    animation-delay: 0.3s;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   Header
======================================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

#header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.header-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-script);
    font-size: 32px;
    color: var(--primary);
    font-weight: 700;
}

.desktop-nav {
    display: flex;
    gap: 30px;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.desktop-nav a:hover {
    color: var(--primary);
}

.desktop-nav a:hover::after {
    width: 100%;
}

/* ========================================
   Mobile Navigation
======================================== */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    transition: color 0.3s;
    padding: 5px;
}

.mobile-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.mobile-nav .nav-item.active,
.mobile-nav .nav-item:hover {
    color: var(--primary);
}

/* ========================================
   Hero Section
======================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, var(--pastel-blue) 0%, var(--pastel-pink) 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-image 0.5s ease-in-out;
}

.hero.loaded {
    background-image: url('รูปทำการ์ด_compressed/KSGALLERY-1566.jpg');
}

/* Loading skeleton for images */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(168, 216, 234, 0.7) 0%,
        rgba(255, 202, 212, 0.7) 50%,
        rgba(180, 231, 206, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--text-white);
    animation: fadeInUp 1s ease;
}

.save-date {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.names {
    font-family: var(--font-script);
    font-size: 72px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease 0.4s backwards;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.divider .line {
    width: 80px;
    height: 1px;
    background-color: currentColor;
}

.divider i {
    font-size: 20px;
}

.date {
    font-family: var(--font-display);
    font-size: 32px;
    margin-bottom: 10px;
    animation: fadeInUp 1s ease 0.6s backwards;
}

.venue-name {
    font-size: 20px;
    letter-spacing: 2px;
    animation: fadeInUp 1s ease 0.8s backwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 32px;
}

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

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* ========================================
   Section Headers
======================================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-light);
}

/* ========================================
   Couple Section
======================================== */
.couple-section {
    padding: var(--section-padding);
    background-color: var(--bg-cream);
}

.couple-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
}

.couple-card {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.couple-image {
    margin-bottom: 30px;
}

.image-frame {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.groom-card .image-frame {
    border-color: var(--pastel-blue);
}

.bride-card .image-frame {
    border-color: var(--pastel-pink);
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.couple-info h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.couple-name {
    font-family: var(--font-thai);
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.english-name {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.nickname {
    font-family: var(--font-script);
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 20px;
}

.parents {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.8;
}

.parents strong {
    color: var(--text-dark);
}

.couple-divider {
    font-size: 48px;
    color: var(--primary);
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ========================================
   Countdown Section
======================================== */
.countdown-section {
    padding: var(--section-padding);
    background-image: url('รูปทำการ์ด_compressed/KSGALLERY-1097.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    color: var(--text-white);
    text-align: center;
}

.countdown-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(53, 89, 199, 0.85) 0%,
        rgba(226, 151, 177, 0.85) 100%);
    z-index: 1;
}

.countdown-section > .container {
    position: relative;
    z-index: 2;
}

.countdown-section h2 {
    font-family: var(--font-display);
    font-size: 42px;
    margin-bottom: 40px;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.countdown-item {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px 40px;
    min-width: 140px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.countdown-value {
    display: block;
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 10px;
}

.countdown-label {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ========================================
   Color Theme Section
======================================== */
.theme-colors-venue {
    margin: 60px 0 40px;
}

.theme-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto 40px;
}

.color-card {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.color-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.color-card:hover .color-circle {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.color-circle.blue {
    background: var(--pastel-blue);
}

.color-circle.pink {
    background: var(--pastel-pink);
}

.color-circle.green {
    background: var(--pastel-green);
}

.color-circle.yellow {
    background: var(--pastel-yellow);
}

.color-card h3 {
    font-family: var(--font-thai);
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 0;
    font-weight: 600;
}

.theme-subtitle {
    text-align: center;
    font-size: 24px;
    color: var(--text-light);
    margin-top: 20px;
    font-style: italic;
}

/* ========================================
   Schedule Section
======================================== */
.schedule-section {
    padding: var(--section-padding);
    background-color: var(--bg-light);
}

.event-date {
    font-size: 20px !important;
    color: var(--primary) !important;
    font-weight: 600;
    margin-top: 10px;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--pastel-blue), var(--pastel-pink), var(--pastel-green));
    transform: translateX(-50%);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:nth-child(even) .timeline-content {
    grid-column: 1;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-icon {
    grid-column: 2;
}

.timeline-item:nth-child(odd) .timeline-content {
    grid-column: 3;
    text-align: left;
}

.timeline-item:nth-child(odd) .timeline-icon {
    grid-column: 2;
}

.timeline-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pastel-pink);
    border: 2px solid var(--pastel-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.timeline-content {
    background-color: var(--bg-cream);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.timeline-time {
    display: inline-block;
    background: var(--pastel-pink);
    border: 2px solid var(--pastel-blue);
    color: var(--text-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.timeline-content p {
    color: var(--text-light);
    font-size: 16px;
}

.calendar-btn-container {
    text-align: center;
    margin-top: 50px;
}

.btn-calendar {
    background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink));
    color: var(--text-white);
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-family: var(--font-thai);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-calendar:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-calendar i {
    margin-right: 10px;
}

/* ========================================
   Gallery Section
======================================== */
.gallery-section {
    padding: var(--section-padding);
    background-color: var(--bg-cream);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.btn-load-more {
    display: block;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--pastel-green), var(--pastel-yellow));
    color: var(--text-dark);
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-family: var(--font-thai);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-load-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-load-more i {
    margin-right: 10px;
}

/* ========================================
   Venue Section
======================================== */
.venue-section {
    padding: var(--section-padding);
    background-color: var(--bg-light);
}

.venue-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.venue-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.venue-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.venue-image:hover img {
    transform: scale(1.05);
}

.venue-info h3 {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.venue-description {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.venue-details {
    margin-bottom: 30px;
}

.venue-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.venue-detail-item i {
    font-size: 24px;
    color: var(--primary);
    margin-top: 5px;
}

.venue-detail-item strong {
    display: block;
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.venue-detail-item p {
    color: var(--text-light);
    font-size: 16px;
}

.venue-buttons {
    display: flex;
    gap: 15px;
}

.btn-venue {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink));
    color: var(--text-white);
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-venue:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.map-container {
    margin-top: 40px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.map-container iframe {
    display: block;
    width: 100%;
}

/* ========================================
   Footer
======================================== */
.footer {
    background-image: url('รูปทำการ์ด_compressed/KSGALLERY-1169.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    color: var(--text-white);
    padding: 60px 20px;
    text-align: center;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(53, 89, 199, 0.85) 0%,
        rgba(226, 151, 177, 0.7) 50%,
        rgba(105, 175, 126, 0.85) 100%);
    z-index: 1;
}

.footer > * {
    position: relative;
    z-index: 2;
}

.footer-hearts {
    font-size: 48px;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

.footer-text {
    font-size: 18px;
    margin-bottom: 15px;
    font-style: italic;
}

.footer-names {
    font-family: var(--font-script);
    font-size: 42px;
    margin-bottom: 10px;
}

.footer-date {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 3px;
}

/* ========================================
   Modal
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--text-white);
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--pastel-pink);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-white);
    font-size: 32px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-white);
    font-size: 18px;
    text-align: center;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 968px) {
    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }

    .couple-container {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .couple-divider {
        transform: rotate(90deg);
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: 20px;
    }

    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        grid-column: 2;
        text-align: left;
    }

    .timeline-item:nth-child(even) .timeline-icon,
    .timeline-item:nth-child(odd) .timeline-icon {
        grid-column: 1;
    }

    .venue-content {
        grid-template-columns: 1fr;
    }

    .names {
        font-size: 48px;
    }

    .section-header h2 {
        font-size: 36px;
    }
}

@media (max-width: 576px) {
    :root {
        --section-padding: 60px 15px;
    }

    .names {
        font-size: 36px;
    }

    .date {
        font-size: 24px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .countdown-item {
        padding: 20px 25px;
        min-width: 100px;
    }

    .countdown-value {
        font-size: 40px;
    }

    .countdown-label {
        font-size: 14px;
    }

    .image-frame {
        width: 220px;
        height: 220px;
    }

    .couple-name {
        font-size: 18px;
    }

    .timeline-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .modal-nav {
        padding: 15px;
        font-size: 24px;
    }

    .close {
        right: 20px;
        font-size: 36px;
    }

    .theme-colors {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .color-circle {
        width: 100px;
        height: 100px;
    }

    .color-card h3 {
        font-size: 18px;
    }

    .theme-subtitle {
        font-size: 20px;
    }
}
