/* ตั้งค่าพื้นฐานและฟอนต์ */
:root {
    --bg-color: #fff0f5;
    --text-color: #5c4a52;
    --primary-color: #ffb6c1;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(#ffc0cb 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Mali', cursive;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    z-index: 10;
}

h1 {
    font-family: 'Caveat', cursive;
    font-size: 3.5rem;
    color: #ff6b81;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

p {
    font-size: 1.2rem;
    color: #835b69;
}

/* คารูเซล (Slider) */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 550px; /* ขยายขนาดกล่องหลักขึ้นนิดหน่อย */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.carousel-track-container {
    width: 100%;
    overflow: hidden;
    padding: 30px 0;
}

.carousel-track {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    justify-content: center;
}

/* สไตล์โพลารอยด์ - ปรับสัดส่วนให้สวยงาม */
.polaroid {
    background: #fff;
    padding: 15px 15px 25px 15px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 85%;
    max-width: 380px; /* ความกว้างสูงสุดของรูป */
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.current-slide .polaroid {
    animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
    0% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
    100% { transform: translateY(0) rotate(-2deg); }
}

.polaroid img {
    width: 100%;
    height: 400px; /* ฟิกความสูงให้คงที่ ทุกรูปจะขนาดเท่ากัน */
    object-fit: cover; /* ตัดส่วนเกินออกโดยไม่ทำให้รูปเบี้ยว (จัดสัดส่วนอัตโนมัติ) */
    object-position: center; /* ให้อยู่จุดกึ่งกลางของภาพเสมอ */
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.polaroid .caption {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    text-align: center;
    margin-top: 15px;
    color: #333;
}

/* สไตล์การ์ดข้อความเซอร์ไพรส์ */
.message-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 85%;
    max-width: 380px;
    text-align: center;
    border: 3px dashed #ffb6c1;
    position: relative;
    background-image: radial-gradient(#fff0f5 1px, transparent 1px);
    background-size: 10px 10px;
}

.current-slide .message-card {
    animation: gentleFloat 4s ease-in-out infinite;
}

.message-card h2 {
    font-family: 'Caveat', cursive;
    font-size: 3.5rem;
    color: #ff6b81;
    margin-top: 0;
    margin-bottom: 20px;
}

.message-card p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #5c4a52;
}

/* ปุ่มเลื่อนซ้ายขวา */
.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    color: #ff6b81;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #ff6b81;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

#prev-btn { left: -10px; }
#next-btn { right: -10px; }

/* จุดบอกตำแหน่งภาพ */
.dots-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    z-index: 10;
}

.dot {
    width: 14px;
    height: 14px;
    background: #ffc0cb;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.dot.active {
    background: #ff6b81;
    transform: scale(1.3);
}

/* เอฟเฟกต์หัวใจลอย */
.floating-hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heart {
    position: absolute;
    bottom: -10vh;
    font-size: 20px;
    animation: floatUp 5s linear forwards;
    opacity: 0.6;
}

@keyframes floatUp {
    to {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}
