/* --- Popup Styles --- */

/* พื้นหลังสีดำโปร่งแสง */
.popup-overlay {
    display: none; /* ซ่อนไว้ก่อนเป็นค่าเริ่มต้น */
    position: fixed; /* ตำแหน่งอยู่กับหน้าจอ */
    z-index: 1000; /* ให้แสดงทับเนื้อหาอื่น */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* สีดำโปร่งแสง */
    -webkit-animation: fadeIn 0.5s;
    animation: fadeIn 0.5s;
}

/* กล่องเนื้อหาของ Popup */
.popup-content {
    background-color: #fefefe;
    margin: 10% auto; /* จัดกึ่งกลางแนวตั้งและแนวนอน */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* ความกว้างเริ่มต้นสำหรับจอใหญ่ */
    max-width: 600px; /* กำหนดความกว้างสูงสุด */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    -webkit-animation: slideIn 0.5s;
    animation: slideIn 0.5s;
}

/* ปุ่มปิด (X) */
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* ปุ่มใน Popup */
.popup-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.popup-button:hover {
    background-color: #0056b3;
}

/* --- Responsive for Mobile --- */
@media screen and (max-width: 768px) {
    .popup-content {
        width: 90%; /* ทำให้ Popup กว้างขึ้นบนจอมือถือ */
        margin: 20% auto; /* ปรับระยะห่างจากด้านบน */
        padding: 20px;
    }

    h2 {
        font-size: 1.5em;
    }
}


/* --- Animation --- */
@-webkit-keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

@-webkit-keyframes slideIn {
  from {top: -300px; opacity: 0}
  to {top: 0; opacity: 1}
}

@keyframes slideIn {
  from {top: -300px; opacity: 0}
  to {top: 0; opacity: 1}
}