/* --- Font Imports (จากไฟล์เดิม) --- */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100..900&display=swap');

/* ===== GLOBAL RULE TO PREVENT HORIZONTAL SCROLL ===== */
html,
body {
    overflow-x: hidden;
}

/* --- CSS Variables (Theme จากไฟล์เดิม) --- */
:root {
    --bg-primary: #1e1e1e;
    --bg-glass: rgba(28, 28, 28, 0.7);
    --bg-dropdown: #333;
    --bg-hover: #444;
    --text-primary: #eee;
    --text-secondary: #ccc;
    --text-white: #ffffff;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --border-color: rgba(68, 68, 68, 0.7);
    --border-mobile: #444;
    --font-main: 'Noto Sans Thai', sans-serif;
    --font-heading: 'Kanit', sans-serif;
}

::selection {
 background-color: #ffffff; 
 color: #474747; 
}

/* --- General Styles (จากไฟล์เดิม) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.main-content {
    flex-grow: 1;
    padding-top: 55px; /* เพิ่ม padding เท่ากับความสูงของ navbar */
}

body.no-scroll {
    overflow: hidden;
}

/* --- Navbar Styling (จากไฟล์เดิม) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-glass);
    backdrop-filter: blur(15px);
    color: var(--text-white);
    height: 55px;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
}

.nav-left .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-white);
    text-decoration: none;
}

.brand-icon {
    height: 35px;
    width: 35px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-center .nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-center .nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-center .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.language-switcher {
    position: relative;
}

.lang-button {
    font-family: var(--font-heading);
    background: none;
    border: none;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.flag-icon {
    width: 22px;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--bg-dropdown);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 150px;
    overflow: hidden;
    z-index: 1001;
}

.language-switcher.open .lang-dropdown {
    display: block;
}

.lang-option {
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.lang-option:hover {
    background-color: var(--bg-hover);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
}

.overlay.show {
    display: block;
}

.mobile-nav-links {
    position: fixed;
    background-color: var(--bg-primary);
    top: 55px;
    right: 0;
    width: 250px;
    height: calc(100% - 55px);
    z-index: 999;
    border-left: 1px solid var(--border-mobile);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.mobile-nav-links.show {
    transform: translateX(0);
}

.mobile-nav-links a {
    font-family: var(--font-heading);
    color: var(--text-primary);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-mobile);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

.mobile-nav-links a:hover {
    background-color: var(--bg-hover);
}


.site-footer {
    background-color: #161616;
    color: var(--text-secondary);
    padding: 0.8rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-copyright p {
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.footer-brand-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-brand-link:hover {
    color: var(--accent-color);
}


/* --- Responsive Styles (จากไฟล์เดิม) --- */
@media (max-width: 992px) {
    .nav-center .nav-links {
        display: none;
    }

    .nav-left {
        flex-grow: 1;
    }

    .hamburger {
        display: block;
    }
}

/* ========================================================== */
/* --- Styles for Terms of Service Content (ส่วนที่สร้างใหม่) --- */
/* ========================================================== */

.tos-container {
    max-width: 800px; /* จำกัดความกว้างให้อ่านง่าย */
    margin: 2rem auto; /* เว้นระยะห่างบนล่าง และจัดกลาง */
    padding: 2.5rem;
    background-color: rgba(44, 44, 44, 0.5); /* สีพื้นหลังเข้มแต่สว่างกว่า body เล็กน้อย */
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tos-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-mobile);
}

.tos-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.tos-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.tos-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-mobile);
}

.tos-section p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}