/* Popup Styles */
.popup-container {
    max-width: 400px;
    font-family: Arial, sans-serif;
}

.popup-header {
    margin: 0 0 10px 0;
    padding: 8px;
    color: white;
    border-radius: 4px;
    text-align: center;
}

.popup-photo {
    margin-bottom: 10px;
}

.popup-photo iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 4px;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.popup-table tr {
    border-bottom: 1px solid #eee;
}

.popup-table-label {
    padding: 6px 8px;
    background-color: #f8f9fa;
    font-weight: bold;
    vertical-align: top;
    width: 30%;
    border-right: 1px solid #dee2e6;
}

.popup-table-value {
    padding: 6px 8px;
    vertical-align: top;
    max-width: 250px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.popup-table-label-wide {
    padding: 6px 8px;
    background-color: #f8f9fa;
    font-weight: bold;
    vertical-align: top;
    width: 35%;
    border-right: 1px solid #dee2e6;
}

/* Comments Section */
.comments-section {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
}

.comments-section-header {
    font-weight: bold;
    color: #f57c00;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.comment-timestamp {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 12px;
    line-height: 1.5;
    color: #333;
}

.add-comment-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: #ffc107;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.add-comment-link:hover {
    background-color: #ffb300;
    color: #333;
}

/* Map Service Buttons */
.map-service-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.map-service-button {
    flex: 1;
    padding: 6px 12px;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    display: inline-block;
}

.map-service-button.google {
    background-color: #4285f4;
}

.map-service-button.bing {
    background-color: #00897b;
}

.map-service-button:hover {
    opacity: 0.9;
    color: white !important;
}

/* Page Layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    bottom: 60px;
    left: 0;
    right: 0;
}

/* Sidebar */
#sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 350px;
    max-height: calc(100% - 80px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 2100;
    display: none;
    overflow: hidden;
}

#sidebar.active {
    display: block;
}

#sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
    background: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Mobile-specific positioning to avoid zoom control conflicts */
@media (max-width: 768px) {
    #sidebar-toggle {
        top: 10px;
        right: 10px;
        z-index: 1001;
    }

    /* Mobile bottom navigation layout */
    .navbar .row {
        justify-content: space-between !important;
    }

    .navbar .col-md-8 {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .navbar .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
        justify-content: flex-end !important;
    }
}

.sidebar-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    position: relative;
}

.sidebar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

.sidebar-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
}

.sidebar-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    color: #6c757d;
    transition: all 0.3s;
}

.sidebar-tab:hover {
    background: #e9ecef;
}

.sidebar-tab.active {
    background: white;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    margin-bottom: -2px;
}

.sidebar-content {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding: 10px;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list-item {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.data-list-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.data-list-item.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.data-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.data-list-item-title {
    font-weight: bold;
    font-size: 14px;
    flex: 1;
}

.data-list-item-timestamp {
    font-size: 10px;
    color: #6c757d;
    white-space: nowrap;
    margin-left: 8px;
    line-height: 1.2;
}

.data-list-item.active .data-list-item-timestamp {
    color: #e0e0e0 !important;
}

.data-list-item-details {
    font-size: 12px;
    color: #6c757d;
}

.data-list-item.active .data-list-item-details {
    color: #e0e0e0 !important;
}

.data-list-item-address {
    font-size: 11px;
    color: #007bff;
    margin-top: 2px;
}

.data-list-item.active .data-list-item-address {
    color: #a0c4ff !important;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.list-counter {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
}

.filter-container {
    position: relative;
    margin-bottom: 10px;
}

.filter-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.filter-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    display: none;
}

.filter-clear:hover {
    color: #dc3545;
}

.filter-input:not(:placeholder-shown) + .filter-clear {
    display: block;
}

.no-results {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-size: 14px;
}

.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(248, 249, 250, 0.9);
    z-index: 1000;
}

/* Popups */
.readme-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-width: 90%;
    max-height: 70%;
    overflow-y: auto;
    z-index: 1001;
}

.readme-closer {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

.tutorial-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.tutorial-closer {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.leaflet-popup-content {
    min-width: 250px;
    max-width: 350px;
}

.popup-image {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Markers */
.custom-marker {
    background-color: white;
    border: 2px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.village-label {
    width: auto !important;
    height: auto !important;
}

.village-label div {
    transform: translate(-50%, -50%);
}

/* Pulse animation for highlighted temporary markers */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Tutorial mode dropdown at top-center */
#tutorial-dropdown-container {
    position: absolute;
    top: 10px;
    left: 40%;
    transform: translateX(-50%);
    z-index: 1002;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

#tutorial-dropdown {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

/* Tutorial overlay for step-by-step guide */
#tutorial-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Allow clicking through to map */
    z-index: 2000;
}

#tutorial-overlay.active {
    display: block;
}

#tutorial-overlay.blocking {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: all; /* Block interactions when needed */
}

#tutorial-steps {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    pointer-events: all; /* Steps box is always clickable */
}

/* Mobile responsiveness for tutorial */
@media (max-width: 768px) {
    #tutorial-steps {
        bottom: 120px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        max-width: none;
        padding: 15px 20px;
        border-radius: 8px;
    }

    #tutorial-steps h4 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    #tutorial-steps p {
        font-size: 14px;
        margin: 8px 0;
    }

    .tutorial-button {
        padding: 10px 15px;
        font-size: 13px;
        margin: 8px 3px;
    }

    #tutorial-button-container {
        flex-wrap: wrap;
        gap: 8px !important;
    }
}

#tutorial-steps h4 {
    color: #007bff;
    margin-bottom: 10px;
}

#tutorial-steps p {
    margin: 10px 0;
    font-size: 16px;
}

.tutorial-button {
    margin: 10px 5px;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.tutorial-button.primary {
    background: #007bff;
    color: white;
}

.tutorial-button.secondary {
    background: #6c757d;
    color: white;
}

/* Enhanced highlight effect for clickable areas during tutorial */
.tutorial-highlight {
    animation: tutorialPulse 1.5s infinite;
    position: relative;
    z-index: 2001;
    border: 3px solid #ff6b6b !important;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.3)) !important;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.tutorial-highlight::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px dashed #ff6b6b;
    border-radius: 8px;
    animation: tutorialRotate 3s linear infinite;
    z-index: -1;
}

.tutorial-highlight::after {
    content: '👆';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: tutorialBounce 1s infinite;
    z-index: 2002;
}

@keyframes tutorialPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.8);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0.3);
    }
    100% {
        box-shadow: 0 0 0 25px rgba(255, 107, 107, 0);
    }
}

@keyframes tutorialRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes tutorialBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

#tutorial-marker {
    display: none;
}

/* Red border for tutorial popup */
.tutorial-highlight-popup .leaflet-popup-content-wrapper {
    border: 3px solid #ff6b6b;
    box-shadow: 0 3px 14px rgba(255, 107, 107, 0.4);
}

.tutorial-highlight-popup .leaflet-popup-tip {
    border-top: 3px solid #ff6b6b;
}

/* Additional HTML inline style replacements */
.tutorial-dropdown-label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-title {
    margin: 0;
    padding-right: 35px;
}

.targets-form-container {
    padding: 10px 10px 5px 10px;
}

.targets-form-link {
    text-decoration: none;
}

.legend-list {
    list-style: none;
    padding-left: 0;
}

.legend-item-volunteer {
    color: #007bff;
}

.legend-item-supplies {
    color: #fd7e14;
}

.legend-item-shower {
    color: #20c997;
}

.legend-item-accommodation {
    color: #6f42c1;
}

.legend-item-other {
    color: #6c757d;
}

.legend-item-meal {
    color: #198754;
}

.priority-heading {
    margin-top: 15px;
}

.priority-badge {
    color: white;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.priority-1 {
    background-color: #cf6e69;
}

.priority-3 {
    background-color: #d8964b;
}

.priority-4 {
    background-color: #e7c451;
}

.priority-5 {
    background-color: #9dc285;
}

.priority-6 {
    background-color: #7fa6d7;
}

/* Marker icon styles */
.marker-icon-base {
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.marker-icon-small {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.marker-icon-medium {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.marker-icon-highlighted {
    border: 4px solid #ffff00 !important;
    width: 32px;
    height: 32px;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(255,255,0,0.8), 0 2px 5px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.marker-icon-highlighted-target {
    border: 4px solid #ffff00 !important;
    width: 34px;
    height: 34px;
    font-size: 16px;
    box-shadow: 0 0 20px rgba(255,255,0,0.8), 0 2px 5px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

/* Village popup and shuttle bus styles */
.village-popup-container {
    max-width: 350px;
    font-family: Arial, sans-serif;
}

.village-popup-header {
    margin: 0 0 10px 0;
    padding: 8px;
    background-color: #319FD3;
    color: white;
    border-radius: 4px;
    text-align: center;
}

.village-popup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 10px;
}

.village-popup-row {
    border-bottom: 1px solid #eee;
}

.village-popup-label {
    padding: 6px 8px;
    background-color: #f8f9fa;
    font-weight: bold;
    vertical-align: top;
    width: 30%;
    border-right: 1px solid #dee2e6;
}

.village-popup-value {
    padding: 6px 8px;
    vertical-align: top;
}

.village-popup-button-container {
    text-align: center;
    margin-top: 10px;
}

.village-popup-button {
    background-color: #319FD3;
    border-color: #319FD3;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 4px;
    color: white;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.shuttle-stop-marker {
    background-color: #ff6b00;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.shuttle-stops-container {
    margin-bottom: 10px;
}

.shuttle-stops-header {
    font-size: 12px;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 5px;
}

.shuttle-stops-list {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    line-height: 1.8;
}

.shuttle-popup-container {
    max-width: 350px;
    font-family: Arial, sans-serif;
}

.shuttle-popup-header {
    margin: 0 0 10px 0;
    padding: 8px;
    background-color: #ff6b00;
    color: white;
    border-radius: 4px;
    text-align: center;
}

.shuttle-popup-content {
    padding: 8px;
    font-size: 14px;
    margin-bottom: 10px;
}

.shuttle-popup-info-box {
    padding: 8px;
    background-color: #fff3e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.shuttle-popup-info-header {
    font-size: 12px;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 5px;
}

.shuttle-popup-info-content {
    font-size: 12px;
    line-height: 1.6;
}

.shuttle-popup-info-item {
    margin-bottom: 4px;
}

/* Polygon/Line popups */
.polygon-popup-title {
    margin: 0;
}

/* Update form button */
.update-form-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.update-form-button {
    width: 100%;
    text-decoration: none;
    display: inline-block;
    padding: 8px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

/* Old comment styles that need migration */
.comments-section-old {
    margin-top: 10px;
    padding: 10px;
    background-color: #fffbea;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.comments-section-header-old {
    font-size: 12px;
    font-weight: bold;
    color: #f57c00;
    margin-bottom: 8px;
}

.comment-item-old {
    font-size: 10px;
    color: #9e9e9e;
    margin-bottom: 4px;
}

.comment-text-old {
    font-size: 12px;
    color: #424242;
    white-space: pre-wrap;
    line-height: 1.5;
}
