:root {
    --primary-color: #007bff; /* สีน้ำเงิน */
    --secondary-color: #6c757d; /* สีเทา */
    --accent-color: #28a745; /* สีเขียว */
    --dark-color: #343a40; /* สีเทาเข้ม */
    --light-bg: #f8f9fa; /* สีพื้นหลังอ่อน */
    --white-color: #ffffff;
    --border-color: #dee2e6;
    --font-family-primary: 'Kanit', sans-serif;
    --font-family-secondary: 'Prompt', sans-serif;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-family-primary);
    margin: 0;
    padding-top: 58px; /* Adjust based on navbar height to prevent content overlap */
    background-color: var(--light-bg);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden; /* ป้องกันการเกิด scrollbar แนวนอน */
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Navbar*/
.navbar {
    background-color: var(--white-color) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    padding: 0.3rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1020;
}

.navbar-brand {
    font-family: var(--font-family-secondary);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--dark-color) !important;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-brand span {
    color: var(--primary-color);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color) !important;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%; /* Adjusted from 0 */
    transform: translateX(-50%); /* Added for centering */
    background-color: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease, transform 0.3s ease; /* Updated transition */
}

/* เกี่ยวกับ (ขีดเส้นใต้ active) */
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}
@media (max-width: 768px) {
    .nav-link:hover::after,
    .nav-link.active::after {
        width: 65%;
    }
}

/* เกี่ยวกับ (ปุ่ม ลงชื่อเข้าใช้ | สมัครใช้งาน | โปรไฟล์ | ตั้งค่า | ออกจากระบบ) */
.login-btn,
.register-btn,
.dashboard-btn,
.setting-btn,
.submit-btn {
    background-color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.login-btn:hover,
.register-btn:hover,
.dashboard-btn:hover,
.setting-btn:hover,
.submit-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
.logout-btn {
    background-color: #dc3545; /* สีแดง */
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.logout-btn:hover {
    background-color: #bb2d3b;
    transform: translateY(-2px);
}

.dropdown-menu {
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    border: none;
    padding: 10px 0;
    z-index: 1021; /* Ensure dropdown is above fixed navbar */
}

.dropdown-item {
    padding: 10px 20px;
    font-weight: 400;
    color: var(--dark-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Navbar Toggler Icon */
.navbar-toggler {
    border: none;
    padding: .25rem .75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border-radius: .25rem;
    transition: box-shadow .15s ease-in-out;
    display: flex; /* For centering content */
    align-items: center; /* For centering content */
    justify-content: center; /* For centering content */
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0 .25rem;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler .fa-times {
    font-size: 1.5em; /* Match approximate size of original icon */
    line-height: 1;
    color: rgba(0, 0, 0, 0.55); /* Match default icon color */
}

/* General Button Styling */
.btn {
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 600;
    /* text-transform: uppercase; /* ทำให้ใช้ตัวพิมพ์ใหญ่ */
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* Modal Overrides for Login/Register */
.modal-content {
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(45deg, var(--primary-color), #6a11cb);
    color: var(--white-color);
    border-bottom: none;
    padding: 15px 30px;
    position: relative;
	justify-content: center !important; /* ทำให้อยู่ตรงกลาง */
}

.modal-header .modal-title {
    font-family: var(--font-family-secondary);
    font-weight: 600;
    font-size: 1.6rem;
}
@media (max-width: 768px) {
    .modal-header .modal-title {
        font-size: 1.3rem;
    }
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 12px;
}

.modal-body .form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 6px;
}

.modal-body .input-group-text {
    background-color: var(--light-bg);
    border-right: none;
    color: var(--secondary-color);
    border-radius: 8px 0 0 8px;
	border: 1px solid #007fff;
    border-color: #007fff;
}

.modal-body .input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
	border: 1px solid #007fff;
    border-color: #007fff;
}

.modal-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.modal-body .form-check-label {
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.modal-body .text-decoration-none {
    color: var(--primary-color);
    font-weight: 500;
}

.modal-body .text-decoration-none:hover {
    text-decoration: underline !important;
}

.modal-body .submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 15px;
}

.modal.fade.show {
    backdrop-filter: blur(5px); /* ทำให้พื้นหลังเบลอเมื่อเปิดหน้าต่าง */
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
    color: var(--secondary-color);
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider-text {
    background-color: var(--white-color);
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.social-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    color: var(--white-color);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.social-btn.facebook { background-color: #3b5998; }
.social-btn.google { background-color: #dd4b39; }
.social-btn.twitter { background-color: #00acee; }

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.register-link {
    text-align: center;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.register-link a {
    font-weight: 500;
}

/* Floating Line Button */
.line-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #00c300; /* Line Green */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 2.2rem;
    line-height: 60px;
    box-shadow: 0 6px 20px rgba(0, 195, 0, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.line-float:hover {
    background-color: #00a800;
    transform: translateY(-5px);
}

/* Scroll-to-top Button */
#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 100px; /* Adjust based on Line button size */
    right: 30px;
    z-index: 999; /* Lower than Line button but higher than content */
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    font-size: 1.5rem;
    line-height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#scrollToTopBtn:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* Responsive adjustments for global elements */
@media (max-width: 992px) {
    .navbar-collapse {
        overflow-y: auto;
        max-height: calc(100vh - 75px); /* Limit height of scrollable menu */
        background-color: var(--white-color); /* Ensure background for clarity */
    }
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem;
    }
    .navbar-nav {
        margin-top: 2px;
        width: 100%;
        text-align: center;
    }
    .navbar-nav .nav-item {
        width: 100%;
    }
    .navbar-nav .nav-link {
        display: block;
        margin: 3px auto;
    }
    .d-flex {
        flex-direction: column;
        align-items: center;
    }
    .d-flex .btn {
        width: 100%;
        margin-bottom: 11px;
    }
    .login-btn, .register-btn {
        margin-right: 0 !important;
    }
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .line-float {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
        line-height: 50px;
        bottom: 20px;
        right: 20px;
    }
    #scrollToTopBtn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        line-height: 45px;
        bottom: 80px; /* Adjust based on Line button size */
        right: 20px;
    }
}

/* เกี่ยวกับ (การรีวิว) */
/* Star Rating Input */
.star-star_rating {
    display: flex;
    font-size: 1.8rem;
    color: #ccc; /* Default star color */
    cursor: pointer;
}

.star-star_rating i {
    margin-right: 5px;
    transition: color 0.2s ease-in-out;
}

.star-star_rating i.fas {
    color: #ffc107; /* Filled star color (Bootstrap yellow) */
}

/* For displaying stars */
.reviews-stars {
    color: #ffc107; /* Yellow for filled stars */
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex; /* เพื่อให้ดาวเรียงกันในบรรทัดเดียว */
}

.reviews-stars .far {
    color: #ccc; /* Grey for empty stars */
}


/* เกี่ยวกับ (ฟอร์มกรอกข้อมูล) */
form {
    margin-top: 20px;
}
select.form-select {
    border: 1px solid #007fff;
}
.form-control {
    border: 1px solid #007fff;
    border-color: #007fff;
	font-size: 15px;
    height: 38px;
}
.form-control:hover {
    border: 2px solid #007fff;
	border-color: #007fff;
}
label {
    font-size: 14px;
	display: block;
	margin-top: -2px;
    margin-bottom: 5px;
}
input[type="text"] {
    width: 100%;
    padding: 7px;
    margin: auto 0 auto 0;
    display: inline-block;
    border-radius: 5px;
    box-sizing: border-box;
	border: 1px solid #007fff;
	border-color: #007fff;
}
input[type="text"]:hover {
	border: 2px solid #007fff;
	border-color: #007fff;
}
select {
    width: 100%;
    padding: 10px;
    font-size: 13.5px;
    border: 1px solid #007fff;
    border-radius: 5px;
    background-color: #f8f8f8;
	margin-top: 1px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
select:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.6);
    outline: none;
}
option {
    padding: 8px;
}
option:disabled {
    color: #ccc;
    cursor: not-allowed;
}
option[disabled]:hover {
    background-color: #f8f8f8; /* ทำให้ไม่มีการเปลี่ยนสีเมื่อ hover */
}
option:enabled:hover {
    background-color: #e9ecef;
}


/* จัดให้อยู่ตรงกลาง (เจาะจงตาม id ของ form เท่านั้น) */
#recharge_pp_qr label,
#recharge_tm_gift label,
#packageOptionsForm label {
    text-align: center;
}

#recharge_pp_qr input[type="text"],
#recharge_tm_gift input[type="text"],
#packageOptionsForm input[type="text"] {
    text-align: center;
}

#recharge_pp_qr option,
#recharge_tm_gift option,
#packageOptionsForm option {
    text-align: center;
}

#recharge_pp_qr select.form-select,
#recharge_tm_gift select.form-select,
#packageOptionsForm select.form-select {
    text-align: center;
    padding-right: 12px;
}
