:root {
    --bg-primary: #FFFBEB;
    --bg-card: #FFFFFF;
    --bg-code: #FEF3C7;
    --text-primary: #1C1917;
    --text-secondary: #57534E;
    --text-muted: #A8A29E;
    --accent: #D97706;
    --accent-light: #FEF3C7;
    --accent-dark: #B45309;
    --border: #E7E5E4;
    --border-dark: #D6D3D1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'IBM Plex Sans Thai', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.logo-text span {
    color: var(--accent);
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.nav a:hover {
    color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 24px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .sep {
    margin: 0 8px;
}

/* Main Content */
.main {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

/* Home Hero */
.home-hero {
    text-align: center;
    padding: 48px 0;
}

.home-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 8px;
}

.hero-stats {
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 32px;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto 48px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-card);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input::placeholder {
    color: var(--text-muted);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

#search-results.active {
    display: block;
}

#search-results a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

#search-results a:hover {
    background: var(--bg-primary);
}

#search-results a:last-child {
    border-bottom: none;
}

/* Section */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Province Grid */
.province-grid h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.province-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.province-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.province-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.province-name-en {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.province-count {
    display: block;
    font-size: 12px;
    color: var(--accent);
    margin-top: 8px;
    font-weight: 500;
}

/* Location Header */
.location-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.location-badge svg {
    width: 14px;
    height: 14px;
}

.location-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.location-english {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
}

.location-english.copyable {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.location-english.copyable:hover {
    background: var(--accent-light);
}

.location-english .copy-icon {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.location-english.copyable:hover .copy-icon {
    opacity: 1;
}

.location-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.location-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Quick Copy Section */
.quick-copy-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.quick-copy-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.quick-copy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.quick-copy-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-copy:hover {
    background: var(--accent-dark);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* List Grid */
.list-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.list-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.list-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.list-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.item-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.item-name-en {
    display: block;
    font-size: 13px;
    color: var(--accent);
}

.item-count {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.item-type {
    display: inline-block;
    font-size: 11px;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
}

/* Address Card Section */
.address-card-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.address-card-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-card-section h2 svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.address-output {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    position: relative;
    white-space: pre-wrap;
}

.address-output .copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Location Info */
.location-info-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.location-info-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

.info-value a {
    color: var(--accent);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Copy Toast */
.copy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
}

.copy-toast svg {
    width: 18px;
    height: 18px;
    color: #10B981;
}

/* Footer */
.footer {
    max-width: 800px;
    margin: 48px auto 0;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* More text */
.more-text {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Districts Grid */
.districts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.district-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.district-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.district-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.district-name-en {
    display: block;
    font-size: 13px;
    color: var(--accent);
}

.district-count {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Place List */
.place-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.place-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.place-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.place-info {
    flex: 1;
}

.place-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.place-name-en {
    display: block;
    font-size: 13px;
    color: var(--accent);
}

.place-type {
    display: inline-block;
    font-size: 11px;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.empty-text {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* Location meta links */
.location-meta a {
    color: var(--accent);
    text-decoration: none;
}

.location-meta a:hover {
    text-decoration: underline;
}

/* Address Card */
.address-card {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    position: relative;
}

.address-text {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
    padding-right: 100px;
}

.address-card .copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.address-card .copy-btn:hover {
    background: var(--accent-dark);
}

.address-card .copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Quick Copy Section improvements */
.quick-copy-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Section */
.info-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.info-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Search results styling */
.search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-name {
    font-weight: 600;
}

.search-name-en {
    font-size: 13px;
    color: var(--text-muted);
}

.no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

/* Quick Copy Box */
.quick-copy-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.quick-copy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.quick-copy-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    flex: 1;
}

.btn-copy-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-copy-small:hover {
    background: var(--accent-dark);
}

.btn-copy-small svg {
    width: 14px;
    height: 14px;
}

/* Map Section */
.map-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.map-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-section h2 svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.map-container {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-code);
}

.map-iframe {
    width: 100%;
    height: 300px;
    border: none;
    display: block;
}

.map-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.map-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    background: var(--accent-light);
    border-radius: 6px;
    transition: all 0.2s;
}

.map-action-btn:hover {
    background: var(--accent);
    color: white;
}

.map-action-btn svg {
    width: 14px;
    height: 14px;
}

.map-link {
    display: block;
    text-decoration: none;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-code) 0%, var(--accent-light) 100%);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.map-placeholder:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.map-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
}

.map-placeholder span {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}

/* FAQ Section */
.faq-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.faq-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.faq-answer {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer strong {
    color: var(--accent);
}

/* Nearby Section */
.nearby-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.nearby-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.nearby-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.nearby-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.nearby-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.nearby-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.nearby-name-en {
    font-size: 12px;
    color: var(--accent);
}

.nearby-more {
    margin-top: 16px;
    text-align: center;
}

.nearby-more a {
    color: var(--accent);
    font-size: 14px;
    text-decoration: none;
}

.nearby-more a:hover {
    text-decoration: underline;
}

/* Stats Section */
.stats-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    min-width: 80px;
}

.stat-item.stat-total {
    background: var(--accent-light);
    border-color: var(--accent);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge-type {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.badge-sect {
    background: #E0F2FE;
    color: #0369A1;
}

.place-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Nearby meta */
.nearby-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    .main {
        padding: 16px;
    }

    .home-hero {
        padding: 32px 0;
    }

    .home-hero h1 {
        font-size: 24px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .list-grid {
        grid-template-columns: 1fr;
    }

    .location-header {
        padding: 24px;
    }

    .location-header h1 {
        font-size: 24px;
    }

    .location-english {
        font-size: 18px;
    }

    .location-meta {
        gap: 16px;
    }

    .quick-copy-box {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }
}
