/* พื้นหลังของเว็บ */
body {
    font-family: Arial, sans-serif;
    background-color: #111; /* สีดำ */
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    animation: backgroundFade 5s infinite alternate;
}

/* การเคลื่อนไหวของพื้นหลัง */
@keyframes backgroundFade {
    0% {
        background-color: #111;
    }
    100% {
        background-color: #333;
    }
}

/* คอนเทนเนอร์หลัก */
.container {
    text-align: center;
    padding: 20px;
    animation: fadeIn 1s ease-out;
}

/* สไตล์ของสินค้าภายใน */
.product {
    background-color: #222;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    padding: 15px; /* ลดขนาด padding */
    width: 300px; /* ลดความกว้าง */
    margin: 20px auto;
    transform: translateY(50px);
    opacity: 0;
    animation: slideUp 1s forwards;
}

/* การเคลื่อนไหวการแสดงผล */
@keyframes slideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ชื่อสินค้า */
.product-name {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #8a2be2; /* สีม่วง */
    transition: color 0.3s ease;
}

.product-name:hover {
    color: #7a1ac2; /* สีม่วงเข้มเมื่อ hover */
}

/* รูปภาพของสินค้า */
.product-image {
    width: 90%; /* ลดขนาดรูปภาพ */
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image:hover {
    transform: scale(1.1); /* ขยายรูปภาพเมื่อ hover */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* คำอธิบายสินค้า */
.product-description {
    font-size: 16px;
    color: #eee; /* ปรับสีให้ขาวขึ้น */
    margin-top: 15px;
    margin-bottom: 20px;
    line-height: 1.5;
    opacity: 0;
    animation: fadeInText 2s forwards;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); /* เพิ่มเงาเรืองแสง */
    font-weight: bold; /* เพิ่มความหนา */
}

/* การเคลื่อนไหวของข้อความอธิบาย */
@keyframes fadeInText {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ปุ่มซื้อสินค้า */
.buy-button {
    background-color: #8a2be2;
    color: white;
    font-size: 18px;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.buy-button:hover {
    background-color: #7a1ac2;
    transform: translateY(-5px); /* ปุ่มเลื่อนไปด้านบนเล็กน้อยเมื่อ hover */
}

/* ข้อความที่แสดงหลังจากการซื้อ */
.message {
    margin-top: 20px;
    font-size: 18px;
    color: #8a2be2;
    font-weight: bold;
    opacity: 0;
    animation: fadeInMessage 2s forwards;
}

/* การเคลื่อนไหวของข้อความที่แสดง */
@keyframes fadeInMessage {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* สไตล์สำหรับกล่องยืนยัน */
.confirmation {
    background-color: #fff;
    color: #000;
    border-radius: 20px; /* ปรับขอบให้โค้งมากขึ้น */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* เพิ่มเงาให้ลึกขึ้น */
    padding: 50px; /* เพิ่มพื้นที่ภายใน */
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 500px;
    max-width: 95%;
    font-size: 20px; /* เพิ่มขนาดตัวอักษร */
    font-family: 'Arial', sans-serif; /* เปลี่ยนฟอนต์ */
    animation: popUp 0.5s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.1); /* เพิ่มเส้นขอบบางๆ */
    transition: all 0.3s ease; /* เพิ่มเอฟเฟกต์ transition */
}

/* เพิ่มเอฟเฟกต์เมื่อ hover */
.confirmation:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); /* เงาเข้มขึ้นเมื่อ hover */
    transform: translate(-50%, -50%) scale(1.02); /* ขยายกล่องเล็กน้อย */
}

/* เพิ่ม animation สำหรับ popUp */
@keyframes popUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* สไตล์สำหรับกล่องยืนยัน */
.confirmation {
    background-color: #f0f4f8; /* สีพื้นหลังใหม่ (โทนฟ้าอ่อน) */
    color: #333; /* สีข้อความเข้มขึ้นเพื่อความชัดเจน */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 50px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 500px;
    max-width: 95%;
    font-size: 20px;
    font-family: 'Arial', sans-serif;
    animation: popUp 0.5s ease-out, float 4s ease-in-out infinite;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* เพิ่มเอฟเฟกต์เมื่อ hover */
.confirmation:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%) scale(1.02);
    animation-play-state: paused;
}

/* เพิ่ม animation สำหรับ popUp */
@keyframes popUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* เพิ่ม animation ลอยตัว */
@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-10px);
    }
}


.confirmation button:active {
    transform: scale(0.95);
}

/* เพิ่มสไตล์สำหรับข้อความสำคัญ */
.confirmation .important-text {
    font-weight: bold;
    color: #e74c3c; /* สีแดงเพื่อดึงความสนใจ */
    margin: 15px 0;
    animation: pulse 1.5s infinite;
}

/* เพิ่ม animation กระพริบสำหรับข้อความสำคัญ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* เพิ่มเอฟเฟกต์พื้นหลังเมื่อกล่องแสดง */
.confirmation::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.confirmation.active::before {
    opacity: 1;
}
/* การเคลื่อนไหวของกล่องยืนยัน */
@keyframes popUp {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* สไตล์สำหรับไอคอนเครื่องหมายตกใจ */
.warning-icon {
    font-size: 50px;
    color: #ffcc00; /* สีเหลือง */
    margin-bottom: 20px;
    animation: pulse 1s infinite; /* เพิ่มเอฟเฟคการเต้น */
}

/* การเคลื่อนไหวของไอคอน */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ปุ่มยืนยัน */
.confirm-button {
    background-color: #28a745; /* สีเขียว */
    color: white;
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.confirm-button:hover {
    background-color: #218838; /* สีเขียวเข้มเมื่อ hover */
    transform: scale(1.05); /* ขยายปุ่มเล็กน้อยเมื่อ hover */
}

.confirm-button:active {
    transform: scale(0.95); /* ย่อปุ่มเล็กน้อยเมื่อคลิก */
}

/* ปุ่มยกเลิก */
.cancel-button {
    background-color: #dc3545; /* สีแดง */
    color: white;
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cancel-button:hover {
    background-color: #c82333; /* สีแดงเข้มเมื่อ hover */
    transform: scale(1.05); /* ขยายปุ่มเล็กน้อยเมื่อ hover */
}

.cancel-button:active {
    transform: scale(0.95); /* ย่อปุ่มเล็กน้อยเมื่อคลิก */
}

/* สไตล์สำหรับส่วนหัว */
header {
    background-color: #8a2be2;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 1s ease-out;
}

/* การเคลื่อนไหวของส่วนหัว */
@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* สไตล์สำหรับส่วนท้าย */
footer {
    background-color: #222;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    animation: slideUp 1s ease-out;
}

/* การเคลื่อนไหวของส่วนท้าย */
@keyframes slideUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
