/* ==========================================================
   app.css — Global Styles (ทุกหน้าใช้ร่วมกัน)
   ========================================================== */

/* ---------- Google Sans Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700;800&family=Google+Sans+Display:wght@400;700;800&display=swap');

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Base ---------- */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #303033;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Navbar ---------- */
.navbar {
    background-color: #374780;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    color: white;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    gap: 16px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-divider {
    display: none;
}

.brand-sub {
    font-size: 22px;
    color: #ffffff;
    white-space: nowrap;
}

/* ---------- Navbar Tabs ---------- */
.navbar-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    cursor: pointer;
    border: 1.5px solid transparent;
}

.navbar-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.navbar-tab.active {
    color: #ffffff;
    background: transparent;
    border-radius: 0;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 5px;
}

/* ---------- Navbar Right ---------- */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navbar-right-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    font-weight: 300;
    user-select: none;
    margin: 0 4px;
}


/* ---------- Language Selector ---------- */
.lang-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: background 0.18s;
}

.lang-wrapper:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-current {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
}

.fa-globe {
    font-size: 15px;
}

.lang-arrow {
    color: #ffffff;
    font-size: 16px;
    transition: transform 0.2s;
}

.lang-wrapper.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 6px;
    min-width: 130px;
    z-index: 200;
    overflow: hidden;
}

.lang-wrapper.open .lang-options {
    display: block;
}

.lang-options li {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #303033;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.lang-options li:hover {
    background: #f0f2fa;
}


/* ---------- Mobile Menu Toggle Button ---------- */
.navbar-mobile-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    z-index: 150;
}

.navbar-mobile-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}


/* ---------- Mobile Menu Dropdown ---------- */
.navbar-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #374780;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 140;
}

.navbar-mobile-menu.open {
    max-height: 500px;
}

.navbar-mobile-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.navbar-mobile-item {
    display: block;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}



.navbar-mobile-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.navbar-mobile-lang-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    cursor: pointer;
    position: relative;
}

.navbar-mobile-lang-wrapper .fa-globe {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.navbar-mobile-lang-current {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    font-size: 14px;
}

.navbar-mobile-lang-arrow {
    color: rgba(255, 255, 255, 0.75);
    font-size: 22px;
    transition: transform 0.2s;
}

.navbar-mobile-lang-wrapper.open .navbar-mobile-lang-arrow {
    transform: rotate(180deg);
}

.navbar-mobile-lang-options {
    display: none;
    position: fixed;
    background: #374780;
    border-radius: 0;
    box-shadow: none;
    list-style: none;
    padding: 8px 0;
    min-width: 100%;
    z-index: 250;
    left: 0;
    right: 0;
}

.navbar-mobile-lang-wrapper.open .navbar-mobile-lang-options {
    display: block;
}

.navbar-mobile-lang-options li {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.navbar-mobile-lang-options li:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}


/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .brand-sub {
        font-size: 16px;
    }

    .navbar-right {
        display: none;
    }

    .navbar-mobile-toggle {
        display: flex;
    }

    .navbar-mobile-menu {
        display: block;
    }
}


/* ---------- Shared Typography ---------- */
.hero-title {
    font-size: 46px;
    font-weight: 800;
    color: #374780;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    color: #bdc3c7;
    margin-top: 8px;

}

.hero-note {
    font-size: 16px;
    color: #303033;
    margin-top: -10px;
    padding: 12px 5px;
    line-height: 1.7;
}

/* ---------- Shared Search Input ---------- */
.search-input {
    border: 2px solid #374780;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
    color: #303033;
}

.search-input:focus {
    border-color: #374780;
    box-shadow: 0 0 0 3px rgba(55, 71, 128, 0.1);
}

.search-input::placeholder {
    color: #bdc3c7;
}

/* ---------- Shared Search Row ---------- */
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-row .search-input {
    flex: 1;
    min-width: 0;
}

/* ---------- Primary Button ---------- */
.btn-primary {
    background-color: #374780;
    color: #f5f5f5;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 16px;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #2c3a6e;
}

/* ---------- Browse Link ---------- */
.browse-link {
    display: inline-block;
    margin-top: 20px;
    color: #374780;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s;
}

.browse-link:hover {
    color: #374780;
    text-decoration: underline;
}

/* ---------- Main ---------- */
.main-content {
    min-height: calc(100vh - 96px - 60px);
    display: flex;
    flex-direction: column;
}

/* ---------- Footer ---------- */
.footer {
    background-color: #303033;
    color: #ffffff;
    padding: 20px 16px;
    text-align: left;
    margin-top: auto;
}

.footer-text {
    margin: 0;
    font-size: 12.25px;
    font-weight: 500;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    color: #777777;
    margin-left: 58px;
    text-align: left;
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .navbar-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 4px;
    }

    .navbar-tab {
        padding: 6px 14px;
        font-size: 13px;
    }

    .navbar-search-input {
        width: 120px;
    }

    .navbar-right {
        font-size: 12px;
        position: relative;
    }

    .brand-sub {
        font-size: 22px;
        position: relative;
    }

    .footer {
        padding: 16px 12px;
    }

    .footer-text {
        font-size: 12px;
    }
}

/* ==========================================================
   Policy Modal Styles
   ========================================================== */

/* Modal Overlay */
.policy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.policy-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease-in;
}

/* Modal Content — ✅ เพิ่ม flex เพื่อให้ footer ดันลงล่างสุด */
.policy-modal__content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    max-height: 85vh;
    width: 90%;
    overflow: hidden;
    /* ✅ เปลี่ยนจาก auto → hidden */
    animation: slideUp 0.3s ease-out;
    position: relative;
    display: flex;
    /* ✅ เพิ่ม */
    flex-direction: column;
    /* ✅ เพิ่ม */
}

/* Close Button */
.policy-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #f5f5f5;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 10;
}

.policy-modal__close:hover {
    background: #777777;
}

/* Modal Header */
.policy-modal__header {
    background: linear-gradient(135deg, #374780 0%, #2c3a6e 100%);
    color: #ffffff;
    padding: 32px 32px 24px;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
    /* ✅ เพิ่ม ไม่ให้ header หดตัว */
}

.policy-modal__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* Modal Body — ✅ เพิ่ม flex: 1 และ overflow-y: auto เพื่อให้ scroll ได้ */
.policy-modal__body {
    padding: 32px;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    flex: 1;
    /* ✅ เพิ่ม */
    overflow-y: auto;
    /* ✅ เพิ่ม */
}

/* Tabs */
.policy-modal__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.policy-modal__tab-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-bottom: 3px solid transparent;
}

.policy-modal__tab-btn.active {
    color: #374780;
    border-bottom-color: #374780;
}

.policy-modal__tab-btn:hover:not(.active) {
    color: #303033;
}

/* Tab Content */
.policy-modal__tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in;
}

.policy-modal__tab-content.active {
    display: block;
}

/* Section */
.policy-modal__section {
    color: #303033;
    line-height: 1.8;
}

.policy-modal__section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #374780;
    margin-bottom: 16px;
    margin-top: 0;
}

.policy-modal__section ol {
    padding-left: 24px;
    margin: 0;
}

.policy-modal__section li {
    margin-bottom: 12px;
    font-size: 14px;
}

.policy-modal__section ol ol {
    margin-top: 8px;
    margin-bottom: 0;
    padding-left: 24px;
}

.policy-modal__section ol ol li {
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .policy-modal__content {
        width: 95%;
        max-height: 90vh;
    }

    .policy-modal__header {
        padding: 24px 24px 16px;
    }

    .policy-modal__title {
        font-size: 20px;
    }

    .policy-modal__body {
        padding: 24px;
    }

    .policy-modal__close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

/* Modal Footer — ✅ เพิ่ม flex-shrink: 0 ให้ footer ไม่หดตัว */
.policy-modal__footer {
    padding: 20px 32px 32px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    /* ✅ ชิดขวา */
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    /* ✅ เพิ่ม */
}

.policy-modal__btn-primary {
    background: #374780;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.policy-modal__btn-primary:hover {
    background: #03bd70;
}

/* Footer Info */
.policy-modal__footer-info {
    margin-bottom: 16px;
}

.policy-modal__footer-info p {
    margin: 0;
    font-size: 14px;
    text-align: right;
}

.policy-modal__link {
    color: #374780;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.policy-modal__link:hover {
    color: #2c3a6e;
    text-decoration: underline;
}