* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    min-height: 100vh;
    background-color: #0d0d11;
    color: #f1f1f3;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Container chính căn giữa nội dung */
.app-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 16px;
    justify-content: flex-start;
}

/* Header & Filter Bar */
.top-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #181820;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.red-dot-logo {
    width: 14px;
    height: 14px;
    background-color: #ff2a4b;
    border-radius: 50%;
    box-shadow: 0 0 12px #ff2a4b;
}

.brand h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.spot-counter {
    font-size: 12px;
    background: rgba(255, 42, 75, 0.15);
    color: #ff5c77;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid rgba(255, 42, 75, 0.3);
}

/* Category Filter Pills */
.category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    white-space: nowrap;
    background: #181820;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cat-pill:hover, .cat-pill.active {
    background: #ff2a4b;
    color: #fff;
    border-color: #ff2a4b;
}

/* Map Box Hình Chữ Nhật Ở Giữa */
.map-box-wrapper {
    width: 100%;
    /* Chiều cao bản đồ linh hoạt nhưng giới hạn không full màn hình */
    height: 60vh; 
    min-height: 400px;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

#map {
    width: 100%;
    height: 100%;
    background: #121216;
}

/* Chuyển bản đồ OpenStreetMap sang Dark Mode bằng CSS Filter */
.leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Nút bấm nổi bên trong Map Box */
.map-fab-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.btn-locate {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1f1f28;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-spot {
    background: linear-gradient(135deg, #ff2a4b, #d91436);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 42, 75, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Footer Copyright & Liên hệ */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 24px 0;
    font-size: 13px;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer strong {
    color: #ff5c77;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}

.contact-links a {
    color: #d1d5db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-links a:hover {
    color: #fff;
}

/* Modal chung */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #181820;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
    max-width: 440px;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0 6px;
}

.gps-box {
    background: #111116;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gps-status.ok { color: #34d399; font-weight: 600; }
.gps-status.wait { color: #fbbf24; }
.gps-status.err { color: #f87171; }

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    color: #d1d5db;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #111116;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13.5px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #ff2a4b;
}

.camera-box {
    border: 2px dashed rgba(255, 42, 75, 0.4);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 42, 75, 0.04);
}

#previewImg {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
}

.btn-submit {
    width: 100%;
    background: #ff2a4b;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
}

.btn-submit:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Leaflet Dark Popup */
.leaflet-popup-content-wrapper {
    background: #181820 !important;
    color: #f3f4f6 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    padding: 4px !important;
}

.leaflet-popup-tip {
    background: #181820 !important;
}

.spot-popup {
    width: 250px;
}

.spot-popup img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: zoom-in;
}

.popup-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.spot-badge {
    display: inline-block;
    background: rgba(255, 42, 75, 0.2);
    color: #ff5c77;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
}

.rating-pill {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
}

.spot-popup h3 {
    font-size: 15px;
    margin-bottom: 4px;
    color: #fff;
}

.uploader-tag {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.uploader-note-box {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #ff2a4b;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #d1d5db;
    margin-bottom: 10px;
    line-height: 1.4;
}

.popup-actions {
    display: flex;
    gap: 8px;
}

.btn-rate-open {
    flex: 1;
    background: #fbbf24;
    color: #111827;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-gmaps {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.star-picker {
    display: flex;
    gap: 8px;
    font-size: 28px;
    cursor: pointer;
    margin: 6px 0 12px;
    user-select: none;
}

.star-picker span {
    color: #4b5563;
    transition: color 0.1s;
}

.star-picker span.selected {
    color: #fbbf24;
}

.review-list {
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.review-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12.5px;
}

.review-item-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-weight: 700;
    color: #f3f4f6;
}

.review-item-stars {
    color: #fbbf24;
}
