body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* จัดให้อยู่ด้านบน */
    min-height: 100vh;
    padding-top: 20px; /* เพิ่ม padding ด้านบน */
}

.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.2rem; /* ปรับขนาด h1 ให้ใหญ่ขึ้น */
}

.input-section button,
.input-section input[type="text"] {
    width: calc(100% - 20px);
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.input-section button {
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.input-section button:hover {
    background-color: #0056b3;
}

#getLocationBtn {
    background-color: #28a745;
}

#getLocationBtn:hover {
    background-color: #218838;
}

p {
    color: #666;
    /* font-size จะถูก override ใน #results p */
}

#loading {
    margin-top: 20px;
    color: #007bff;
}

#results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}

#results h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem !important; /* "ผลการคำนวณ" ขนาด 2rem (~32px) - เพิ่ม !important */
    text-align: center;
}

#results p {
    font-size: 25px !important; /* พิกัดของคุณ:, ระยะห่างจากชายแดน: - เพิ่มเป็น 25px !important */
    line-height: 1.6;
    text-align: left !important; /* จัดข้อความให้ชิดซ้าย */
}

#results p strong {
    font-size: 1em !important; /* ใช้ 1em เพื่อคงขนาด 25px ของ parent p - เพิ่ม !important */
}

#userLat,
#userLng,
#distanceResult {
    font-size: 20px !important; /* ตัวเลขพิกัดและระยะทาง - !important */
    font-weight: bold;
    color: #007bff; /* สีน้ำเงินสำหรับตัวเลข */
}

#safetyMessage {
    font-weight: bold;
    margin-top: 15px;
    font-size: 32px !important; /* ข้อความแจ้งเตือน - เพิ่มเป็น 32px !important */
    text-align: center;
}

.safe {
    color: #28a745; /* Green */
}

.warning {
    color: #ffc107; /* Yellow */
}

.danger {
    color: #dc3545; /* Red */
}

.hidden {
    display: none;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
}

/* Responsive adjustments for smaller screens */
/* ลบการปรับ Font size ใน media query ออก เพื่อให้ใช้ขนาด 25px/32px โดยตรง */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    .input-section button,
    .input-section input[type="text"] {
        font-size: 14px;
        padding: 10px;
    }
    /* ปล่อยให้ใช้ Font size หลักที่ตั้งไว้ด้านบน (25px/32px) */
}

#autocomplete-container {
    position: relative;
    width: calc(100% - 20px);
}

#autocomplete-container ul {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    list-style-type: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

#autocomplete-container li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

#autocomplete-container li:hover {
    background-color: #f0f0f0;
}

#adsense-bottom {
    text-align: center;
}