* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Neue',cursives;
}

body {
    color: #000000;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    font-size: 22px;
}

/* พื้นหลังแบบเคลื่อนไหว */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, #f093fb 0%, #f5576c 100%);
    z-index: -1;
    opacity: 0.9;
}

.background-animation::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(165, 23, 23, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    background-size: 300% 300%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* เอฟเฟกต์อนุภาคลอยอยู่บนพื้นหลัง */
.background-animation::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: float 60s linear infinite;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-1000px) translateX(1000px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    animation: fadeIn 1s ease;
}

h1 {
    color: rgb(0, 0, 0);
    margin-bottom: 10px;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: rgb(0, 0, 0);
    margin-bottom: 20px;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* หน้าแรก */
#home-page {
    text-align: center;
}

.icon-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 50px;
}

.icon-item {
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
    perspective: 1000px;
}

.icon-item:hover {
    transform: translateY(-10px);
}

.icon-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #3700ff 0%, #00f829 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    font-size: 50px;
    color: rgb(255, 255, 255);
    transition: all 0.3s ease;
}

.icon-item:hover .icon-image {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #00eeff 0%, #7b00ff 100%);
}

.icon-name {
    font-weight: bold;
    color: #000000;
    font-size: 2rem;
    margin-top: 10px;
}

/* เพิ่มขนาดตัวอักษรคำว่า "ภาพ" */
.icon-name.large-text {
    font-size: 1.8rem;  /* ขนาดใหญ่ขึ้น */
    font-weight: 800;   /* ตัวหนากว่าเดิม */
    color: #000000;     /* สีแตกต่างจากข้อความอื่น */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.icon-item:hover .icon-name.large-text {
    color: #ffffff;     /* เปลี่ยนสีเมื่อ hover */
    transform: scale(1.1);
}

/* หน้าแกลลอรี่ */
#gallery-page, #video-page, #note-page {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.back-button {
    background: linear-gradient(to right, #6c5ce7, #3498db);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    cursor: pointer;
    margin-bottom: 30px;
    font-size: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.gallery-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.gallery-slide {
    display: none;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.gallery-slide.active {
    display: block;
}

.gallery-image {
    width: 100%;
    /* เปลี่ยนจาก object-fit: cover; เป็น contain */
    object-fit: contain; /* ทำให้ภาพปรับขนาดโดยรักษาสัดส่วนและแสดงภาพทั้งหมด */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.02);
}

.gallery-nav {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.nav-button {
    background: linear-gradient(to right, #6c5ce7, #3498db);
    color: rgb(255, 255, 255);
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.slide-counter {
    font-weight: bold;
    color: #000000;
    background: rgba(108, 92, 231, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
}

/* หน้าวิดีโอ */
.video-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 30px;
}

.video-item {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-item h3 {
    margin-bottom: 15px;
    color: #6c5ce7;
    text-align: center;
}


.video-item iframe {
    width: 100%;
    height: 1000px;
    border-radius: 0px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* หน้าโน๊ต */
.note-form {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    font-size: 45px;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

textarea {
    width: 100%;
    height: 200px;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #ffffff;
    margin: 20px 0;
    font-size: 20px;
    resize: none;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}



.submit-button {
    background: linear-gradient(to right, #6c5ce7, #3498db);
    color: rgb(255, 255, 255);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
}

.submit-button:hover {
    transform: translateY(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.thank-you-message {
    display: none;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 20px;
    color: rgb(0, 0, 0);
    text-align: center;
    animation: bounceIn 1s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-animation {
    font-size: 5rem;
    margin-top: 20px;
    animation: celebrate 2s infinite;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    .container {
        padding: 20px;
    }

    .icon-item {
        width: 80px;
    }

    .icon-image {
        width: 80px;
        height: 80px;
        font-size: 30px;
    }

    .icon-name.large-text {
        font-size: 1rem;
    }

    h1 {
        font-size: 1rem;
    }
      .note-form {
        font-size: 20px;   /* ลดลงให้อ่านง่าย */
        padding: 20px;     /* ลดระยะขอบใน */
        border-radius: 20px;
    }

    textarea {
        font-size: 16px;   /* ช่องกรอกเล็กลงพอดีจอมือถือ */
        height: 150px;
    }
    .submit-button {
    font-size: 1.2rem;   /* ลดขนาดฟอนต์ */
        padding: 10px 20px;  /* ลดขนาดปุ่ม */
        border-radius: 30px;
  }
    .thank-you-message {
        padding: 20px;       /* ลดระยะขอบ */
        font-size: 1rem;     /* ลดขนาดข้อความ */
        border-radius: 15px; /* ลดมุมโค้งให้เหมาะมือถือ */
    }
    .celebration-animation {
    font-size: 3rem;
    margin-top: 20px;
    animation: celebrate 2s infinite;
  }
  .back-button {
        font-size: 1.2rem;   /* ลดขนาดตัวอักษร */
        padding: 10px 20px;  /* ลดขนาดปุ่ม */
        border-radius: 30px; /* ลดมุมโค้งให้พอดีมือถือ */
    }
    .nav-button {
        font-size: 0.6rem;   /* ลดขนาดฟอนต์ */
        padding: 8px 15px;   /* ลดขนาดปุ่ม */
        border-radius: 10px;
    }

    .slide-counter {
        font-size: 0.6rem;   /* ลดขนาดข้อความ */
        padding: 6px 10px;   /* ลด padding */
        border-radius: 10px;
    }
    
    .video-item iframe {
        width: 100%;
        height: 220px;   /* สูงประมาณ 220px พอดีมือถือ */
    }

    .video-item h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .video-item {
        padding: 10px;
    }
    
}