@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

:root {
    --accent: #c42d2d;
    --accent-soft: #fbe9e7;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #fdfdfd;
    --panel: #ffffff;
    --panel-soft: #f8f5f4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    padding-top: 60px;
    color: var(--text);
}

html { scroll-behavior: smooth; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.navbar.scrolled {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.nav-link {
    position: relative;
    padding-bottom: 4px;
    color: var(--text);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0%; height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }

/* Language Switcher */
.lang-switch {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}
.lang-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #6b7280;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
}
.lang-btn:hover {
    color: #374151;
}
.lang-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Hero */
.hero-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #fdf2f2 50%, #fef7f5 100%);
    min-height: 92vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 18px 48px rgba(0,0,0,0.06);
}
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.4px;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cta-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 30px rgba(196,45,45,0.18); }
.cta-secondary { background: #fff; color: var(--accent); border: 1px solid rgba(0,0,0,0.06); }
.cta-btn:hover { transform: translateY(-2px); }

/* Sections */
section { padding: 70px 0; }
@media (min-width: 768px) { section { padding: 96px 0; } }
.section-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 1.4rem;
}
@media (min-width: 768px) { .section-title { font-size: 3rem; } }
.section-note { color: var(--muted); }

.soft-panel {
    background: var(--panel);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}
.soft-panel-plain {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 16px;
}

/* Simple motion helpers - wait for trigger */
.fade-in-up { opacity: 0; transform: translateY(12px); }
.fade-in-up.animated { animation: fadeUp 0.8s ease forwards; }
.fade-in-left { opacity: 0; transform: translateX(-16px); }
.fade-in-left.animated { animation: fadeLeft 0.9s ease forwards; }
.flip-in { opacity: 0; transform: rotateX(-12deg) translateY(10px); transform-origin: top; }
.flip-in.animated { animation: flipIn 0.8s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeLeft { to { opacity: 1; transform: translateX(0); } }
@keyframes flipIn { 0% { opacity: 0; transform: rotateX(-16deg) translateY(12px); } 60% { opacity: 1; transform: rotateX(4deg) translateY(0); } 100% { opacity: 1; transform: rotateX(0); } }

.loading-spinner {
    border: 4px solid rgba(196, 45, 45, 0.18);
    border-radius: 50%;
    border-top: 4px solid var(--accent);
    width: 44px; height: 44px;
    animation: spin 1s linear infinite;
    margin: 12px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.scroll-indicator { 
    position: absolute; 
    bottom: 22px; 
    left: 50%; 
    transform: translateX(-50%); 
    animation: bounce 2s infinite; 
    color: var(--accent); 
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-12px); }
    60% { transform: translateX(-50%) translateY(-6px); }
}

.highcharts-container { border-radius: 12px; overflow: hidden; }

/* Gradient animation for coming soon */
@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient {
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
}

@media (max-width: 767px) {
    body { padding-top: 66px; }
    .hero-gradient { min-height: 86vh; }
}

/* Best Time Tabs */
.best-time-tab {
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
}
.best-time-tab:hover {
    color: #374151;
    background: rgba(196, 45, 45, 0.05);
}
.best-time-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(196, 45, 45, 0.25);
}

.best-time-panel {
    width: 100%;
    transition: opacity 0.3s ease;
}

.best-times-swiper-container {
    position: relative;
    touch-action: pan-y;
}

.best-times-swiper {
    position: relative;
}

/* Custom Select Input Styling */
.customInputContainer {
    width: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.customInputContainer .customInput {
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    width: 100%;
    display: flex;
    color: #1f2937;
    background: #fff;
    align-items: center;
    border-radius: 0.5rem;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}

.customInputContainer .customInput:hover {
    border-color: #9ca3af;
}

.customInputContainer .customInput i {
    transition: transform 0.3s ease-in-out;
    color: #6b7280;
}

.customInputContainer.show .customInput {
    border-color: #c42d2d;
    box-shadow: 0 0 0 3px rgba(196, 45, 45, 0.1);
}

.customInputContainer.show .customInput i {
    transform: rotate(90deg);
}

.customInputContainer .selectedData {
    font-weight: 500;
    color: #1f2937;
}

.customInputContainer .options {
    display: none;
    padding: 0.75rem;
    font-size: 0.95rem;
    justify-content: start;
    flex-direction: column;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
    width: 100%;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid #c42d2d;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
}

.customInputContainer.show .options {
    display: flex;
}

.customInputContainer .options .searchInput {
    display: flex;
    padding: 0 0.6rem;
    align-items: center;
    border-radius: 0.375rem;
    color: #6b7280;
    border: 2px solid #d1d5db;
    width: 100%;
    transition: all 0.2s ease;
}

.customInputContainer .options .searchInput.focus {
    border: 2px solid #c42d2d;
}

.customInputContainer .options .searchInput input[type="text"] {
    border: 0;
    width: 100%;
    outline: none;
    height: 2.5rem;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    border-radius: 0.375rem;
}

.customInputContainer .options .searchInput input[type="text"]::placeholder {
    font-size: 0.95rem;
    color: #9ca3af;
}

.customInputContainer .options ul {
    width: 100%;
    max-height: 15rem;
    overflow-y: auto;
    position: relative;
    margin: 0.5rem 0 0 0;
    padding: 0;
}

.customInputContainer .options ul::-webkit-scrollbar {
    width: 6px;
}

.customInputContainer .options ul::-webkit-scrollbar-track {
    border-radius: 0.2rem;
    background: rgba(0, 0, 0, 0.05);
}

.customInputContainer .options ul::-webkit-scrollbar-thumb {
    border-radius: 0.2rem;
    background: rgba(196, 45, 45, 0.3);
}

.customInputContainer .options ul::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 45, 45, 0.5);
}

.customInputContainer .options ul li {
    cursor: pointer;
    list-style: none;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
    transition: all 0.15s ease;
}

.customInputContainer .options ul li:last-child {
    border: 0;
}

.customInputContainer .options ul li:hover {
    background: rgba(196, 45, 45, 0.1);
}

.customInputContainer .options ul li.selected {
    background: rgba(196, 45, 45, 0.15);
    color: #c42d2d;
    font-weight: 600;
}

.customInputContainer .options ul li.selected:hover {
    background: rgba(196, 45, 45, 0.2);
}

/* Year Selector Styles */
#year-selector-container .customSelect {
    position: relative;
    width: 100%;
}

#year-selector-container .customInput {
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

#year-selector-container .customInput:hover {
    border-color: #c42d2d;
    box-shadow: 0 2px 8px rgba(196, 45, 45, 0.1);
}

#year-selector-container .customOptions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #c42d2d;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

#year-selector-container .customOptions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#year-selector-container .customOptions ul li {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

#year-selector-container .customOptions ul li:last-child {
    border-bottom: none;
}

#year-selector-container .customOptions ul li:hover {
    background: #f3f4f6;
}
