/* global.css */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --primary-color: #FFD300;
    --primary-hover: #e8bf00;
    --secondary-color: #BA2027;
    --black-color: #000000;
    --background-color: #fff8cf;
    --surface-color: #ffffff;
    --text-color: #111111;
    --text-muted: #555555;
    --border-color: #ead15b;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.16);
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --font-heading: 'Prompt', sans-serif;
    --font-body: 'Sarabun', sans-serif;
    --transition-fast: all 0.2s ease-in-out;
    --transition-normal: all 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

body.splash-active {
    overflow: hidden;
}

.site-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--primary-color);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-splash-logo {
    width: min(58vw, 680px);
    line-height: 0;
    clip-path: inset(0 100% 0 0);
    animation: splashLogoWipe 1.15s cubic-bezier(0.72, 0, 0.2, 1) 1s forwards;
}

.site-splash-logo img {
    display: block;
    width: 100%;
    height: auto;
}

body.splash-done .site-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes splashLogoWipe {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

@media (max-width: 640px) {
    .site-splash-logo {
        width: min(72vw, 380px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-splash,
    .site-splash-logo {
        animation: none;
        transition: none;
    }

    .site-splash-logo {
        clip-path: inset(0 0 0 0);
    }
}

body.route-admin {
    background-color: #f5f6f8;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* App Layout Layout */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content-container {
    flex: 1 0 auto;
}

body.route-admin #content-container {
    flex: 1 0 auto;
    display: flex;
    background: #f5f6f8;
}

body.route-admin #app {
    display: flex;
    min-height: 100vh;
    background: #f5f6f8;
}

body.route-admin #app::after,
body.route-admin #content-container::after,
body.route-admin #footer-container::after {
    content: none;
    display: none;
}

#footer-container {
    flex: 0 0 auto;
}

body.route-admin #footer-container {
    display: block;
    margin: 0;
    padding: 0;
}

body.route-admin .site-footer {
    margin-bottom: 0;
}

#navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    width: 100%;
    min-height: 92px;
    padding: 0;
}

.navbar-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 18px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 92px;
}

body.route-admin .navbar-wrapper {
    padding-left: 14px;
    padding-right: 18px;
}

.navbar .logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    margin-left: 0;
}

body.route-admin .navbar .logo {
    margin-left: 0;
}

.navbar .logo img {
    display: block;
    width: 240px;
    max-width: none;
    height: auto;
}

body.route-admin .navbar .logo img {
    width: 256px;
}

.navbar .nav-links {
    flex: 1 1 auto;
    justify-content: center;
    margin-left: 20px;
}

.navbar .nav-cta {
    flex: 0 0 auto;
}

@media (max-width: 860px) {
    #navbar-container {
        top: 0;
        left: 0;
        right: 0;
    }

    .navbar-wrapper {
        min-height: 76px;
        padding: 0 14px 0 8px;
    }

    .navbar .logo {
        margin-left: 0;
    }

    .navbar .logo img {
        width: 182px;
    }

    body.route-admin .navbar-wrapper {
        padding-left: 10px;
        padding-right: 14px;
    }

    body.route-admin .navbar .logo img {
        width: 192px;
    }
}

/* Utility classes */
.container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--primary-color);
    color: var(--black-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.section {
    padding: 72px 0;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.2;
    margin-bottom: 12px;
}

.section-lead {
    color: var(--text-muted);
    max-width: 720px;
    margin-bottom: 32px;
    font-size: 1.05rem;
}

.page-hero {
    padding: 88px 0 74px;
    background: var(--black-color);
    color: #ffffff;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 12px;
}

.page-hero p:not(.hero-kicker) {
    max-width: 740px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.12rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
}

.btn-primary {
    background: var(--secondary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: #8f171d;
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--black-color);
    color: #ffffff;
}

.btn-dark:hover {
    background: #242424;
    transform: translateY(-1px);
}

.btn-outline {
    border: 2px solid var(--black-color);
    color: var(--black-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--black-color);
    color: #ffffff;
}

.status-message {
    padding: 22px;
    border-radius: var(--border-radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
