/* ====================================================================
   မြစ်ကြီးနား ဒီဂျစ်တယ်မြေပုံ - CSS
   ==================================================================== */

/* ===== Google Fonts (ဖိုင်တင်စရာမလို) ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Myanmar:wght@400;500;600;700&display=swap');

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Myanmar', 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    transition: background 0.3s ease;
}

/* ----- Header Styles ----- */
.header {
    background: linear-gradient(135deg, #1e3c2c, #0a2f1f);
    color: white;
    padding: 12px 15px;
    position: relative;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.language-switch {
    display: flex;
    gap: 5px;
}

.lang-btn, .dark-btn, .map-control-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-family: inherit;
}

.lang-btn.active, .lang-btn:hover {
    background: #e67e22;
}

.map-controls {
    display: flex;
    gap: 5px;
}

.map-control-btn {
    padding: 6px 12px;
    font-size: 14px;
}

.map-control-btn:hover, .dark-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.02);
}

.header-container {
    text-align: center;
}

.header-container h1 {
    font-size: 22px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.header-container p {
    font-size: 12px;
    opacity: 0.85;
}

/* ----- Category Buttons ----- */
.category-container {
    background: white;
    padding: 12px 15px;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    z-index: 999;
    scrollbar-width: thin;
}

.category-container::-webkit-scrollbar {
    height: 4px;
}

.category-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.category-container::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 10px;
}

.cat-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.25s;
    white-space: nowrap;
    color: #333;
}

.cat-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.cat-btn.active {
    background: #e67e22;
    color: white;
    box-shadow: 0 2px 8px rgba(230,126,34,0.3);
}

/* ----- Search Section ----- */
.search-section {
    background: white;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    z-index: 998;
}

.search-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    min-width: 180px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

#searchInput {
    width: 100%;
    padding: 12px 12px 12px 38px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230,126,34,0.2);
}

#townshipSelect {
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 30px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

#townshipSelect:focus {
    outline: none;
    border-color: #e67e22;
}

.refresh-btn, .location-btn {
    background: #f0f0f0;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover, .location-btn:hover {
    background: #e67e22;
    color: white;
    transform: rotate(5deg);
}

.filter-info {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* ----- Map Container ----- */
#map {
    height: calc(100vh - 260px);
    width: 100%;
    position: relative;
    z-index: 1;
    background: #f8f9fa;
}

/* ----- Footer ----- */
footer {
    background: #1e3c2c;
    color: #ccc;
    text-align: center;
    padding: 12px;
    font-size: 12px;
    position: relative;
    z-index: 999;
}

footer p {
    margin: 3px 0;
}

footer .update-info {
    font-size: 10px;
    opacity: 0.7;
}

/* ===== Dark Mode ===== */
body.dark-mode {
    background: #1a1a1a;
}

body.dark-mode .category-container,
body.dark-mode .search-section {
    background: #2a2a2a;
}

body.dark-mode .cat-btn {
    background: #3a3a3a;
    color: #eee;
}

body.dark-mode .cat-btn.active {
    background: #e67e22;
}

body.dark-mode #searchInput,
body.dark-mode #townshipSelect {
    background: #3a3a3a;
    border-color: #555;
    color: white;
}

body.dark-mode .refresh-btn,
body.dark-mode .location-btn {
    background: #3a3a3a;
    color: #ddd;
}

body.dark-mode .refresh-btn:hover,
body.dark-mode .location-btn:hover {
    background: #e67e22;
    color: white;
}

body.dark-mode .filter-info {
    color: #aaa;
}

body.dark-mode footer {
    background: #0a2f1f;
}

/* ===== Custom Popup Styles ===== */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 10px 12px;
}

.custom-popup {
    font-family: inherit;
}

.custom-popup h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 16px;
    border-bottom: 2px solid #e67e22;
    display: inline-block;
}

.custom-popup p {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.4;
}

body.dark-mode .custom-popup h3 {
    color: #e67e22;
    border-bottom-color: #e67e22;
}

body.dark-mode .custom-popup {
    color: #eee;
}

/* ===== Loading Animation ===== */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e67e22;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-container h1 {
        font-size: 18px;
    }
    
    .cat-btn {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    .search-container {
        flex-wrap: wrap;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    #townshipSelect {
        flex: 1;
    }
    
    #map {
        height: calc(100vh - 300px);
    }
    
    .map-controls {
        gap: 3px;
    }
    
    .lang-btn, .map-control-btn, .dark-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header-top {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .category-container {
        padding: 8px 12px;
    }
    
    .cat-btn {
        padding: 5px 12px;
        font-size: 10px;
    }
    
    .header-container h1 {
        font-size: 16px;
    }
}