/* =========================================
   THAIEASY V2 PREMIUM THEME - CSS
   Aesthetic: Light, Clean, Airy, Glassmorphism
========================================= */

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

:root {
    /* Color Palette - Premium Light & Clean */
    --premium-blue: #0ea5e9;       /* Vibrant Sky Blue */
    --premium-blue-hover: #0284c7; /* Darker Sky Blue */
    --premium-indigo: #6366f1;     /* Rich Indigo */
    --premium-dark: #0f172a;       /* Slate 900 */
    
    --bg-main: #f8fafc;            /* Slate 50 - Very light airy gray */
    --bg-surface: #ffffff;         /* Pure white */
    
    --text-main: #334155;          /* Slate 700 */
    --text-muted: #64748b;         /* Slate 500 */
    --text-heading: #0f172a;       /* Slate 900 */
    
    /* Glassmorphism & Shadows */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px -10px rgba(14, 165, 233, 0.2);
    --shadow-nav: 0 4px 30px rgba(0, 0, 0, 0.05);
    
    /* Typography */
    --font-primary: 'Outfit', 'IBM Plex Sans Thai', sans-serif;
}

/* =========================================
   DARK MODE VARIABLES (Triggered by [data-theme="dark"])
========================================= */
[data-theme="dark"] {
    --bg-main: #0b0f19;            /* Deep space black */
    --bg-surface: #111827;         /* Very dark gray */
    
    --text-main: #e2e8f0;          /* Slate 200 */
    --text-muted: #94a3b8;         /* Slate 400 */
    --text-heading: #f8fafc;       /* Slate 50 */
    
    --glass-bg: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.4);
    --shadow-hover: 0 20px 40px -10px rgba(14, 165, 233, 0.4);
    --shadow-nav: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* =========================================
   GLOBAL RESET & TYPOGRAPHY
========================================= */
body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--text-heading);
}

a {
    color: var(--premium-blue);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--premium-blue-hover);
    text-decoration: none;
}

/* =========================================
   PREMIUM BUTTONS
========================================= */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 10px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: var(--font-primary);
}

.btn-primary, .btn-success, .btn.search {
    background: linear-gradient(135deg, var(--premium-blue) 0%, var(--premium-indigo) 100%);
    color: white !important;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover, .btn-success:hover, .btn.search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, var(--premium-blue-hover) 0%, var(--premium-indigo) 100%);
}

.btn-default, .btn.transfer {
    background: var(--bg-surface);
    color: var(--text-heading);
    box-shadow: var(--shadow-soft);
}

.btn-default:hover, .btn.transfer:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--premium-blue);
}

/* =========================================
   GLASS NAVBAR (TOP)
========================================= */
#header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-nav);
    padding: 10px 0;
    transition: background 0.4s ease, border-color 0.4s ease;
}

#header .logo {
    max-height: 50px;
    transition: transform 0.3s ease;
}

#header .logo:hover {
    transform: scale(1.05);
}

#header .top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin: 0;
    padding: 0;
}

#header .top-nav > li {
    display: inline-block;
}

#header .top-nav > li > a {
    color: var(--text-main);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: transparent;
}

#header .top-nav > li > a:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--premium-blue);
}

/* Modern Language Dropdown */
.custom-lang-dropdown .dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 10px;
    min-width: 180px;
    margin-top: 15px;
}

.custom-lang-dropdown .dropdown-menu > li > a {
    color: var(--text-main);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
}

.custom-lang-dropdown .dropdown-menu > li > a:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--premium-blue);
}

/* =========================================
   APPLE-STYLE DARK MODE TOGGLE
========================================= */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    margin: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--premium-indigo);
}

input:checked + .slider:before {
    transform: translateX(28px);
    background-color: #ffffff;
}

.slider i {
    font-size: 14px;
    z-index: 1;
}

.slider i.fa-sun-o { color: #f59e0b; }
.slider i.fa-moon-o { color: #fde047; }

/* =========================================
   HERO BANNER (SEARCH DOMAIN)
========================================= */
#home-banner {
    background: var(--bg-surface);
    padding: 100px 0 120px 0 !important;
    position: relative;
    overflow: visible;
    text-align: center;
}

/* Background blob effect */
#home-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] #home-banner::before {
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(11, 15, 25, 0) 70%);
}

#home-banner .container {
    position: relative;
    z-index: 1;
}

#home-banner h2 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--premium-blue) 0%, var(--premium-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

#home-banner form {
    max-width: 800px;
    margin: 0 auto;
}

#home-banner .input-group {
    background: var(--bg-surface);
    border-radius: 100px;
    padding: 8px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.3s ease;
}

#home-banner .input-group:focus-within {
    box-shadow: var(--shadow-hover);
    border-color: rgba(14, 165, 233, 0.3);
}

#home-banner .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    height: 60px;
    font-size: 1.25rem;
    padding-left: 30px;
    color: var(--text-main);
    flex: 1;
}

#home-banner .form-control:focus {
    outline: none;
    box-shadow: none;
}

#home-banner .input-group-btn {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

#home-banner .btn.search, #home-banner .btn.transfer {
    height: 60px;
    border-radius: 50px !important;
    padding: 0 40px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Captcha placement */
#home-banner .captcha-container, #home-banner .g-recaptcha {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

/* =========================================
   SHORTCUT CARDS (PREMIUM)
========================================= */
.home-shortcuts {
    background: transparent !important;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.home-shortcuts ul {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.home-shortcuts li {
    flex: 1;
    max-width: 250px;
}

.home-shortcuts a {
    display: block;
    background: var(--bg-surface);
    padding: 40px 20px;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-heading);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.home-shortcuts a::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(14,165,233,0.05) 0%, rgba(99,102,241,0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.home-shortcuts a:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(14, 165, 233, 0.3);
}

.home-shortcuts a:hover::before {
    opacity: 1;
}

.home-shortcuts i {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--premium-blue) 0%, var(--premium-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.home-shortcuts p {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

/* =========================================
   MAIN MENU OVERRIDES (Mobile included)
========================================= */
#main-menu .navbar-main {
    background: var(--bg-surface);
    border: none;
    box-shadow: var(--shadow-soft);
    border-radius: 16px;
    margin-top: 20px;
}

#main-menu .navbar-nav > li > a {
    color: var(--text-main);
    font-weight: 500;
    padding: 15px 20px;
}

#main-menu .navbar-nav > li > a:hover {
    color: var(--premium-blue);
    background: transparent;
}

/* Main menu underline animation */
#main-menu .navbar-nav > li > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background: linear-gradient(135deg, var(--premium-blue) 0%, var(--premium-indigo) 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
}

#main-menu .navbar-nav > li > a:hover::after,
#main-menu .navbar-nav > li.active > a::after {
    width: 80%;
}

/* Submenu Dropdowns */
#main-menu .dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 10px;
}

#main-menu .dropdown-menu > li > a {
    color: var(--text-main);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
}

#main-menu .dropdown-menu > li > a:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--premium-blue);
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */
@media (max-width: 768px) {
    #home-banner h2 { font-size: 2rem; }
    #home-banner .input-group { flex-direction: column; border-radius: 24px; padding: 15px; }
    #home-banner .form-control { width: 100%; height: 50px; margin-bottom: 15px; border-radius: 12px; border: 1px solid #e2e8f0; }
    #home-banner .input-group-btn { display: flex; flex-direction: column; width: 100%; margin-left: 0; gap: 10px; }
    #home-banner .btn.search, #home-banner .btn.transfer { width: 100%; height: 50px; border-radius: 12px !important; }
    
    .home-shortcuts ul { flex-wrap: wrap; gap: 15px; padding: 0 15px; }
    .home-shortcuts li { flex: 1 1 45%; min-width: 45%; }
    .home-shortcuts a { padding: 20px 10px; }
    .home-shortcuts i { font-size: 2rem; }
    .home-shortcuts p { font-size: 0.9rem; }
    
    #header .top-nav { flex-wrap: wrap; justify-content: center; width: 100%; float: none; padding: 10px 0; }
    #header .logo { display: block; text-align: center; margin-bottom: 10px; }
    
    /* Mobile Menu Colors */
    #main-menu .navbar-nav .open .dropdown-menu { background-color: var(--bg-main) !important; box-shadow: none; }
    #main-menu .navbar-nav .open .dropdown-menu > li > a { color: var(--text-main) !important; }
    #main-menu .navbar-nav .open .dropdown-menu > li > a:hover { background-color: rgba(14, 165, 233, 0.1) !important; color: var(--premium-blue) !important; }
    #main-menu .navbar-nav > .open > a, #main-menu .navbar-nav > .open > a:hover, #main-menu .navbar-nav > .open > a:focus { background-color: var(--premium-blue) !important; color: white !important; }
}

/* LAYOUT FIXES FOR TOP NAV AND HERO */
#header .container { display: flex; justify-content: space-between; align-items: center; }
#header .top-nav { order: 2; display: flex; align-items: center; gap: 15px; margin: 0; padding: 0; list-style: none; }
#header .logo { order: 1; }
#home-banner { background-color: var(--bg-surface) !important; background: var(--bg-surface) !important; padding: 100px 0 120px 0 !important; }
#main-menu .navbar-main { background-color: var(--bg-surface) !important; border: 1px solid var(--glass-border) !important; }

.home-shortcuts a { color: var(--text-heading) !important; }
.home-shortcuts i { font-size: 3rem !important; }
.home-shortcuts p { color: var(--text-main) !important; }

/* LAYOUT BUG FIXES */
section#main-menu { background: transparent !important; }
#home-banner { overflow: hidden !important; }
#header .top-nav > li > a { font-size: 15px !important; }
#main-menu .navbar-nav > li > a { font-size: 16px !important; }
section#footer { background: var(--bg-surface) !important; padding: 30px 0 !important; text-align: center; border-top: 1px solid var(--glass-border); margin-top: 60px; }
.home-shortcuts a { border: 1px solid rgba(14, 165, 233, 0.2) !important; }

/* SEARCH BAR OVERLAP FIX */
#home-banner .input-group { display: flex !important; flex-wrap: nowrap !important; width: 100% !important; }
#home-banner .form-control { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; }
#home-banner .input-group-btn { display: flex !important; flex: 0 0 auto !important; width: auto !important; position: static !important; align-items: center !important; margin-left: 10px !important; }
#home-banner .input-group-btn { display: flex !important; flex: 0 0 auto !important; width: auto !important; position: static !important; align-items: center !important; margin-left: 10px !important; }

/* GLOBAL FONT OVERRIDE */
body, p, h1, h2, h3, h4, h5, h6, input, button, select, textarea, .nav > li > a, .btn, .lead, table, th, td { font-family: var(--font-primary) !important; }

/* MAIN MENU ACTIVE/OPEN STATE OVERRIDE */
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus,
#main-menu .navbar-nav > li.active > a, #main-menu .navbar-nav > li.open > a, #main-menu .navbar-nav > li.active > a:hover, #main-menu .navbar-nav > li.open > a:hover, #main-menu .navbar-nav > li.active > a:focus, #main-menu .navbar-nav > li.open > a:focus { background-color: rgba(14, 165, 233, 0.1) !important; color: var(--primary-color) !important; border-radius: 8px; }

/* AGGRESSIVE MAIN MENU OVERRIDES */
#main-menu .navbar-nav,
#main-menu .navbar-nav > li,
#main-menu .navbar-nav > li > a { background-color: transparent !important; background: transparent !important; }
#main-menu .navbar-nav > li.active > a, #main-menu .navbar-nav > li.open > a, #main-menu .navbar-nav > li > a:hover, #main-menu .navbar-nav > li > a:focus, #main-menu .navbar-nav > li.open { background-color: rgba(14, 165, 233, 0.1) !important; color: var(--primary-color) !important; border-radius: 8px; }

/* FIX CENTERED LOGO AND NAV */
#header .container::before, #header .container::after { display: none !important; }
#header .container { display: flex !important; justify-content: space-between !important; align-items: center !important; max-width: 1170px !important; margin: 0 auto !important; }
#header .logo { margin-right: auto !important; }
#header .top-nav { margin-left: auto !important; }

/* FIX HOME SHORTCUTS SEAM LINES */
.home-shortcuts { background-color: var(--bg-surface) !important; border-top: none !important; border-bottom: none !important; box-shadow: none !important; margin-top: -20px !important; position: relative; z-index: 10; padding-bottom: 40px !important; }

.home-shortcuts a { border: none !important; box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; }

/* REMOVE VERTICAL SEPARATOR LINES FROM LIST ITEMS */
.home-shortcuts li { border: none !important; outline: none !important; box-shadow: none !important; background: transparent !important; }
