/* ===================================================
   เทศบาลนครนครสวรรค์ — Modern Smart City Civic Portal CSS
   Design System: Modern Harmonized Purple Theme & AI Integration
   =================================================== */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
    /* Primary Modern Purple Palette (Bright, readable, never blackish) */
    --primary: #7c3aed;
    --primary-light: #9333ea;
    --primary-dark: #2e1065;
    --primary-hover: #6d28d9;
    --primary-surface: #f5f3ff;
    --primary-subtle: rgba(124, 58, 237, 0.08);
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #06b6d4 100%);
    --purple-gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    --hero-gradient: linear-gradient(135deg, #3b0764 0%, #581c87 40%, #4338ca 100%);
    --ita-gradient: linear-gradient(135deg, #2e1065 0%, #4338ca 50%, #3b0764 100%);

    /* Smart City & Accent Colors */
    --accent-cyan: #06b6d4;
    --accent-cyan-light: #e0f2fe;
    --accent-gold: #f59e0b;
    --accent-gold-light: #fef3c7;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;

    /* Neutrals & Surfaces */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #fbfbfe;
    --text: #1e1b4b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 30px rgba(124, 58, 237, 0.08);

    /* Radii & Shadows */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 9999px;

    --shadow-sm: 0 2px 8px rgba(30, 27, 75, 0.04);
    --shadow-md: 0 8px 24px rgba(30, 27, 75, 0.08);
    --shadow-lg: 0 16px 40px rgba(124, 58, 237, 0.12);
    --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.35);
    --shadow-cyan-glow: 0 0 20px rgba(6, 182, 212, 0.4);

    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --font-th: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

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

body {
    font-family: var(--font-th);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Utilities */
p, div, span, h1, h2, h3, h4, h5, h6 {
    text-align: left;
}

/* Section Header Shared */
.section {
    padding: 80px 0;
}

.section-header-modern {
    text-align: center;
    margin-bottom: 50px;
}

.section-header-modern * {
    text-align: center;
}

.section-badge-modern {
    display: inline-block;
    padding: 6px 20px;
    background: var(--primary-surface);
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.section-title-modern {
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.section-desc-modern {
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- Top Bar ---------- */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-left span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-bar-left i {
    color: var(--accent-cyan);
}

.top-bar-right {
    display: flex;
    gap: 14px;
    align-items: center;
}

.top-bar-right a {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.top-bar-right a:hover {
    color: #fff;
    background: var(--primary);
    transform: translateY(-2px);
}

/* ---------- Header / Navigation ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.98);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
}

.header .container {
    max-width: 1540px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.logo-glow {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-surface);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.logo-link:hover .logo-glow {
    transform: scale(1.06);
    box-shadow: var(--shadow-glow);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.logo-text { display: flex; flex-direction: column; }
.logo-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.25;
}

.logo-subtitle {
    font-family: var(--font-en);
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Desktop Nav */
.nav-desktop {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
}

.nav-link {
    padding: 9px 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--primary-surface);
}

.nav-link i { font-size: 0.7rem; transition: var(--transition); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:hover .nav-link i { transform: rotate(180deg); }

.dropdown-content a {
    display: block;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dropdown-content a:hover {
    background: var(--primary-surface);
    color: var(--primary);
    padding-left: 18px;
}

.school-procure-dropdown {
    min-width: 340px;
    max-height: min(70vh, 440px);
    overflow-y: auto;
}

.school-procure-dropdown a strong {
    display: inline-block;
    min-width: 34px;
    color: var(--primary);
}

.search-toggle {
    background: var(--primary-surface);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
    margin-left: 8px;
}

.search-toggle:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background: var(--primary-dark);
    border-radius: 4px;
    transition: var(--transition);
}

/* Mobile Nav */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-card);
    padding: 24px;
    transform: translateX(100%);
    transition: var(--transition);
    overflow-y: auto;
}

.mobile-nav-overlay.active .mobile-nav-panel {
    transform: translateX(0);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    float: right;
    margin-bottom: 20px;
}

.mobile-nav-links { clear: both; display: flex; flex-direction: column; gap: 6px; }
.mobile-nav-links a,
.mobile-nav-links summary {
    display: block;
    padding: 12px 16px;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.mobile-nav-links a:hover,
.mobile-nav-links summary:hover {
    background: var(--primary-surface);
    color: var(--primary);
}

.mobile-nav-links details a {
    padding-left: 28px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 45, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 100%;
    max-width: 640px;
    padding: 30px 20px;
    position: relative;
}

.search-overlay-close {
    position: absolute;
    top: -20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-overlay-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.search-overlay-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.search-overlay-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font-th);
    font-size: 1.1rem;
    color: var(--text);
    outline: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-cyan-glow);
}

/* ===================================================
   FUTURISTIC HERO SECTION (Smart City Civic Portal)
   =================================================== */
.hero-smart {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    background: var(--hero-gradient);
    overflow: hidden;
    padding: 60px 0 80px;
}

.hero-smart-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.15) 0%, transparent 40%);
    z-index: 1;
}

.hero-smart-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, transparent 100%);
}

.hero-smart-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-smart-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero-smart-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

.hero-smart-heading {
    color: #fff;
    margin-bottom: 18px;
}

.hero-smart-heading-sub {
    display: block;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    color: rgba(255,255,255,0.9);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.hero-smart-heading-main {
    display: block;
    font-size: clamp(2.2rem, 5.5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.18;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-smart-desc {
    color: rgba(255,255,255,0.85);
    font-size: clamp(1rem, 2vw, 1.15rem);
    max-width: 680px;
    margin-bottom: 36px;
    line-height: 1.8;
}

/* Hero Smart Live Search Box */
.hero-smart-search-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-xl);
    padding: 8px 10px 8px 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.8);
    max-width: 700px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.hero-smart-search-card:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 16px 50px rgba(6, 182, 212, 0.35);
    transform: translateY(-2px);
}

.hero-smart-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-th);
    font-size: 1.05rem;
    color: var(--text);
    background: transparent;
    padding: 10px 0;
}

.hero-smart-search-btn {
    background: var(--purple-gradient);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-family: var(--font-th);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.hero-smart-search-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
    transform: scale(1.02);
}

/* Hero Live Tickers & Status */
.hero-smart-tickers {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.hero-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
}

.hero-ticker-item i {
    color: var(--accent-cyan);
}

/* ===================================================
   CITIZEN QUICK SERVICES (Interactive 3D Glass Cards)
   =================================================== */
.services-smart-section {
    padding: 80px 0;
    background: var(--bg);
    position: relative;
    margin-top: -30px;
    z-index: 10;
}

.services-smart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-smart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.service-smart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--purple-gradient);
    opacity: 0;
    transition: var(--transition);
}

.service-smart-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(124, 58, 237, 0.3);
}

.service-smart-card:hover::before {
    opacity: 1;
}

.service-smart-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--primary-surface);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-smart-card:hover .service-smart-icon-wrapper {
    background: var(--purple-gradient);
    color: #fff;
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-glow);
}

.service-smart-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.service-smart-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.service-smart-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.service-smart-card:hover .service-smart-arrow {
    gap: 10px;
    color: var(--primary-hover);
}

/* ===================================================
   SMART CITY NAKHON SAWAN 4 PILLARS SHOWCASE
   =================================================== */
.smart-city-section {
    padding: 90px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f3e8ff 50%, #f8fafc 100%);
    position: relative;
}

.smart-city-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.smart-city-tab-btn {
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border);
    font-family: var(--font-th);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.smart-city-tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.smart-city-tab-btn.active {
    background: var(--purple-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.smart-city-tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.smart-city-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.smart-city-showcase-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.smart-pillar-tag {
    display: inline-block;
    padding: 4px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.smart-pillar-tag.living { background: rgba(6, 182, 212, 0.12); color: #0891b2; }
.smart-pillar-tag.env { background: rgba(16, 185, 129, 0.12); color: #059669; }
.smart-pillar-tag.gov { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.smart-pillar-tag.energy { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.smart-pillar-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.3;
}

.smart-pillar-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

.smart-pillar-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.smart-feature-box {
    background: var(--primary-surface);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.smart-feature-box h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.smart-feature-box p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.smart-pillar-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.smart-stat-card {
    background: linear-gradient(135deg, #faf8ff 0%, #f3e8ff 100%);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(124, 58, 237, 0.15);
    text-align: center;
    transition: var(--transition);
}

.smart-stat-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.smart-stat-num {
    font-family: var(--font-en);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    line-height: 1;
}

.smart-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================================================
   LATEST PR NEWS & DIGITAL NOTICEBOARD
   =================================================== */
.news-smart-section {
    padding: 90px 0;
    background: #fff;
}

.news-smart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.news-smart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-smart-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(124, 58, 237, 0.3);
}

.news-smart-thumb {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #e2e8f0;
}

.news-smart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-smart-card:hover .news-smart-thumb img {
    transform: scale(1.06);
}

.news-smart-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 14px;
    background: var(--purple-gradient);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.news-smart-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-smart-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.news-smart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: balance;
}

.news-smart-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    text-wrap: pretty;
}

.news-smart-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.news-smart-card:hover .news-smart-link {
    gap: 10px;
}

/* ===================================================
   ITA & TRANSPARENCY SECTION (Solid Dark Violet Gradient)
   =================================================== */
.ita-section {
    background: linear-gradient(135deg, #2e1065 0%, #4338ca 50%, #3b0764 100%) !important;
    color: #ffffff !important;
    padding: 85px 0 !important;
    position: relative;
    overflow: hidden;
}

.ita-section .section-title-modern {
    color: #ffffff !important;
}

.ita-section .section-desc-modern {
    color: rgba(255, 255, 255, 0.88) !important;
}

.ita-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 30px;
}

.ita-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: var(--radius-lg, 24px) !important;
    padding: 32px 18px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.ita-card:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: translateY(-6px) !important;
    border-color: var(--accent-gold, #f59e0b) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25) !important;
}

.ita-card i {
    font-size: 2.2rem !important;
    color: var(--accent-gold, #f59e0b) !important;
    margin-bottom: 14px !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.ita-card:hover i {
    transform: scale(1.15) !important;
}

.ita-card h3 {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    color: #ffffff !important;
    text-align: center !important;
    margin: 0 !important;
}

/* ===================================================
   LIVE STATS SECTION
   =================================================== */
.stats-section {
    background: #ffffff !important;
    padding: 75px 0 !important;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 24px !important;
    text-align: center !important;
}

.stat-item {
    background: #f5f3ff !important;
    border-radius: var(--radius-lg, 24px) !important;
    padding: 32px 20px !important;
    border: 1px solid rgba(124, 58, 237, 0.12) !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.stat-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.12) !important;
    border-color: #9333ea !important;
}

.stat-number {
    font-family: var(--font-en, 'Inter', sans-serif) !important;
    font-size: clamp(2.4rem, 5vw, 3.2rem) !important;
    font-weight: 800 !important;
    color: #7c3aed !important;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin-bottom: 8px !important;
    line-height: 1.1 !important;
    text-align: center !important;
}

.stat-label {
    font-size: 0.95rem !important;
    color: #475569 !important;
    font-weight: 500 !important;
    text-align: center !important;
    line-height: 1.5 !important;
}

/* ===================================================
   FLOATING MASCOT "NONG MANGKEE" (Golden-Red Dragon)
   =================================================== */
.nong-mangkee-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Teaser Greeting Bubble */
.mangkee-teaser {
    background: #fff;
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 12px;
    max-width: 260px;
    position: relative;
    animation: bounceTeaser 4s infinite;
    cursor: pointer;
    transition: var(--transition);
}

.mangkee-teaser::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 32px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

@keyframes bounceTeaser {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Floating Avatar Button (Gold-Red Dragon Ring) */
.mangkee-trigger-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
    border: 3px solid #fff;
    box-shadow: 0 8px 28px rgba(220, 38, 38, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    overflow: hidden;
}

.mangkee-trigger-btn:hover {
    transform: scale(1.14) rotate(-5deg);
    box-shadow: 0 12px 35px rgba(220, 38, 38, 0.65);
}

.mangkee-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.mangkee-online-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* Chatbot Modal Drawer */
.mangkee-chat-modal {
    position: fixed;
    bottom: 105px;
    right: 28px;
    width: 420px;
    max-width: calc(100vw - 36px);
    height: 620px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(30, 27, 75, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.2);
    z-index: 1501;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mangkee-chat-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.mangkee-chat-header {
    background: linear-gradient(135deg, #7c3aed 0%, #dc2626 100%);
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mangkee-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mangkee-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #fff;
    padding: 2px;
}

.mangkee-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.mangkee-header-status {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 5px;
}

.mangkee-header-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.mangkee-header-actions button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.mangkee-header-actions button:hover {
    background: rgba(255,255,255,0.3);
}

/* Chat Messages Container */
.mangkee-messages-body {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.mangkee-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    align-items: flex-start;
    animation: msgFade 0.3s ease;
}

@keyframes msgFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mangkee-msg.bot {
    width: 100%;
    max-width: 100%;
    align-self: flex-start;
}

.mangkee-msg.user {
    width: fit-content;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.mangkee-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.mangkee-msg-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 42px);
}

.mangkee-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: normal;
}

.mangkee-msg.bot .mangkee-bubble {
    width: 100%;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.mangkee-msg.user .mangkee-bubble {
    background: var(--purple-gradient);
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Quick Prompt Chips */
.mangkee-quick-chips {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--border-light);
    white-space: nowrap;
}

.mangkee-chip {
    padding: 6px 14px;
    background: var(--primary-surface);
    color: var(--primary);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-pill);
    font-family: var(--font-th);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.mangkee-chip:hover {
    background: var(--primary);
    color: #fff;
}

/* Chat Input Bar */
.mangkee-input-bar {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mangkee-input-text {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    font-family: var(--font-th);
    font-size: 0.92rem;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.mangkee-input-text:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.mangkee-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--purple-gradient);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.mangkee-send-btn:hover {
    transform: scale(1.08);
}

/* Typing Indicator */
.mangkee-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: fit-content;
}

.mangkee-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.2s infinite ease-in-out;
}

.mangkee-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.mangkee-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* ===================================================
   AI DOCUMENT & PAGE SUMMARIZER COMPONENT
   =================================================== */
.mangkee-source-slot { width: 100%; max-width: 100%; margin: 0; }
.mangkee-sources { width: 100%; margin-top: 9px; padding: 10px; border: 1px solid #ddd6fe; border-radius: 12px; background: #faf8ff; }
.mangkee-sources-title { margin-bottom: 7px; color: #5b21b6; font-size: .74rem; font-weight: 600; }
.mangkee-source-link { display: block; min-width: 0; padding: 8px 9px; border-radius: 8px; color: #4c1d95; text-decoration: none; overflow-wrap: anywhere; }
.mangkee-source-link:hover { background: #ede9fe; }
.mangkee-source-link strong, .mangkee-source-link small { display: block; }
.mangkee-source-link strong { font-size: .78rem; line-height: 1.5; }
.mangkee-source-link small { margin-top: 3px; color: #75658c; font-size: .69rem; line-height: 1.45; }
.mangkee-scope-note { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid #e9e2f5; color: #75658c; font-size: .68rem; line-height: 1.45; }

.ai-summarize-card {
    background: linear-gradient(135deg, #faf8ff 0%, #f3e8ff 100%);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 28px 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.ai-summarize-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-summarize-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-summarize-title i {
    color: var(--primary);
}

.ai-summarize-btn {
    background: var(--purple-gradient);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-family: var(--font-th);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.ai-summarize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.ai-summary-content {
    background: #fff;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
}

.ai-summary-content p {
    margin-bottom: 8px;
}

.ai-summary-content p:last-child {
    margin-bottom: 0;
}

/* ===================================================
   FOOTER & BACK TO TOP
   =================================================== */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 70px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.footer-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.footer-logo strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
}

.footer-logo small {
    font-family: var(--font-en);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}

.footer-about p {
    font-size: 0.88rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 2px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: #fff;
    padding-left: 6px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
}

.footer-contact li i {
    color: var(--accent-cyan);
    margin-top: 4px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

.staff-login-link {
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.staff-login-link:hover {
    color: #fff;
}

.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 105px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 1400;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-4px);
}

/* ===================================================
   RESPONSIVE BREAKPOINTS
   =================================================== */
@media (max-width: 1024px) {
    .nav-desktop { display: none; }
    .hamburger { display: flex; }
    .smart-city-showcase-card { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hero-smart { min-height: auto; padding: 50px 0 70px; }
    .smart-pillar-features { grid-template-columns: 1fr; }
    .smart-pillar-stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .nong-mangkee-widget { bottom: 20px; right: 20px; }
    .mangkee-chat-modal {
        right: 12px;
        bottom: 85px;
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
    }
    .mangkee-chat-header { padding: 13px 14px; }
    .mangkee-header-left { min-width: 0; gap: 9px; }
    .mangkee-header-title { font-size: .96rem; }
    .mangkee-header-status { font-size: .66rem; }
    .mangkee-messages-body { padding: 14px 12px; gap: 16px; }
    .mangkee-msg { max-width: 90%; }
    .mangkee-msg.bot { width: 100%; max-width: 100%; }
    .mangkee-msg-avatar { width: 30px; height: 30px; }
    .mangkee-msg-content { max-width: calc(100% - 40px); }
    .mangkee-bubble { padding: 11px 13px; font-size: .88rem; line-height: 1.7; }
    .mangkee-input-bar { padding: 10px 12px; }
    .back-to-top { right: 90px; bottom: 20px; width: 42px; height: 42px; }
}
