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

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    height: 100vh;
    color: #333;
    /* Prevent both horizontal and vertical scroll */
    overflow: hidden;
    /* Improve text rendering on mobile */
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

main {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
}

.control-panel {
    background: transparent;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
}

.logo-container {
    flex-shrink: 0;
}

.app-logo {
    width: 50px;
    height: 50px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.app-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #218838;
}

.user-admin-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007bff;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    margin-left: 10px;
}

.user-admin-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #007bff;
    color: white;
}

.master-admin-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    margin-left: 10px;
}

.master-admin-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #ffd700;
    color: white;
}

.search-box {
    flex: 1;
    max-width: 600px;
}

.search-container {
    position: relative;
    display: flex;
    box-shadow: rgba(0, 0, 0, 0.15) 0px 2px 8px;
    background: white;
    border-radius: 8px;
    overflow: visible;
    z-index: 2000;
}

.search-container input {
    font-size: 16px;
    color: rgb(51, 51, 51);
    flex: 1 1 0%;
    padding: 16px 20px;
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
    outline: none;
    background: transparent;
    border-radius: 8px 0 0 8px;
}

.search-btn {
    cursor: pointer;
    color: rgb(102, 102, 102);
    background: none;
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
    padding: 16px 20px;
    transition: color 0.2s;
    border-radius: 0 8px 8px 0;
}

.search-btn:hover {
    color: rgb(51, 51, 51);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-danger {
    color: white;
}

.btn-info {
    background-color: #17a2b8;
}

.map-container {
    position: relative;
    height: 100vh;
    margin: 0;
    min-height: 300px;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.legend {
    position: absolute;
    top: 80px;
    /* Position below Leaflet zoom controls */
    left: 10px;
    /* Align with Leaflet zoom controls */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    /* Below Leaflet controls but above map */
    max-width: 250px;
}

/* Ensure Leaflet zoom controls are properly layered */
.leaflet-control-zoom {
    z-index: 1000 !important;
}

.leaflet-top.leaflet-left {
    z-index: 1000 !important;
}

/* Hide Leaflet attribution control */
.leaflet-control-attribution {
    display: none !important;
}


.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.legend h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.legend-toggle-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

.legend-toggle-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.legend-content {
    transition: all 0.3s ease;
}

.legend.collapsed .legend-content {
    display: none;
}

.legend.collapsed {
    padding: 0.75rem;
}

.legend.collapsed .legend-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.legend-section {
    margin-bottom: 1rem;
}

.legend-section:last-child {
    margin-bottom: 0;
}

.legend-section h4 {
    margin: 0 0 0.5rem 0;
    color: #34495e;
    font-size: 0.9rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.3;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-icon {
    font-size: 1rem;
    min-width: 16px;
}

.legend-icon.user-reported {
    color: #e74c3c;
}

.legend-urgency-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    min-width: 12px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-urgency-marker.critical {
    background-color: #dc3545;
}

.legend-urgency-marker.urgent {
    background-color: #fd7e14;
}

.legend-urgency-marker.moderate {
    background-color: #ffc107;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {

    /* Hide zoom controls on tablets and mobile devices */
    .leaflet-control-zoom,
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out,
    .leaflet-control-zoom.leaflet-bar.leaflet-control {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .control-panel {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    .app-logo {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .user-admin-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-left: 8px;
    }
    
    .master-admin-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-left: 8px;
    }

    .search-box {
        flex: 1;
        max-width: none;
    }

    .search-container {
        width: 100%;
    }

    .search-container input {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px 16px;
    }

    .search-btn {
        padding: 12px 16px;
        min-width: 50px;
    }

    .legend {
        position: absolute;
        top: auto;
        bottom: 95px;
        /* Just above the green report button with safe spacing */
        left: 10px;
        right: auto;
        max-width: 280px;
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .legend-section {
        margin-bottom: 0.75rem;
    }

    .legend-section h4 {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .legend-item {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
        gap: 0.4rem;
    }

    .legend-urgency-marker {
        width: 10px;
        height: 10px;
        min-width: 10px;
    }

    .legend-toggle-btn {
        min-width: 20px;
        min-height: 20px;
        font-size: 0.8rem;
    }

    .report-location-btn {
        right: 15px;
        bottom: 15px;
    }

    .btn-floating {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        /* Better touch target */
    }

    .sync-status {
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 85vh;
    }
    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 100vh;
        min-height: 300px;
        overflow: hidden;
    }

    .directions-panel {
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        width: auto;
    }

    /* Mobile pinned locations dropdown */
    .pinned-list {
        position: fixed;
        top: auto;
        left: 18px;
        right: 18px;
        bottom: 10px;
        min-width: 390px !important;
        max-width: auto;
        max-height: 60vh;
        margin-top: 0;
    }

    .pinned-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .search-container input {
        font-size: 16px;
        padding: 10px 14px;
    }

    .search-btn {
        padding: 10px 14px;
        min-width: 44px;
    }

    .legend {
        bottom: 85px;
        /* Just above the green report button on small screens with safe spacing */
        left: 10px;
        right: auto;
        max-width: 250px;
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .legend h3 {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .legend-section {
        margin-bottom: 0.6rem;
    }

    .legend-section h4 {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .legend-item {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
        gap: 0.3rem;
    }

    .legend-urgency-marker {
        width: 8px;
        height: 8px;
        min-width: 8px;
    }

    .map-container {
        height: calc(100vh - 100px);
        /* Adjusted for smaller mobile without footer */
        min-height: 250px;
        overflow: hidden;
    }

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

    /* Hide zoom controls on mobile devices - Leaflet zoom control classes */
    .leaflet-control-zoom,
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out,
    .leaflet-control-zoom.leaflet-bar.leaflet-control {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* Ensure attribution is hidden on mobile */
    .leaflet-control-attribution {
        display: none !important;
    }
}

.info-panel {
    position: absolute;
    bottom: 140px;
    left: 10px;
    width: 350px;
    max-height: 450px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #333;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 5000;
    display: block;
    font-size: 0.9rem;
}

.info-content {
    max-height: 450px;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}

.info-content::-webkit-scrollbar {
    width: 6px;
}

.info-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile info panel adjustments */
@media (max-width: 768px) {
    .info-panel {
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 60vh;
        font-size: 0.85rem;
    }

    .info-content {
        padding: 1rem;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .info-panel {
        bottom: 5px;
        left: 5px;
        right: 5px;
        max-height: 50vh;
    }

    .info-content {
        padding: 0.75rem;
        max-height: 50vh;
    }
}

.info-panel h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.info-panel ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-panel li {
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .info-panel {
        bottom: 5px;
        left: 5px;
        right: 5px;
        padding: 0.75rem;
        max-height: 50vh;
    }
}

.info-panel h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.info-panel ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-panel li {
    margin-bottom: 0.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.emergency-contacts {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.emergency-contacts h4 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.emergency-contacts p {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.directions-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 350px;
    max-height: 300px;
    display: none;
}

.directions-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.directions-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.directions-header .close-btn {
    color: white;
    opacity: 0.8;
}

.directions-header .close-btn:hover {
    opacity: 1;
    color: white;
}

.directions-content {
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.no-route {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

.direction-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.direction-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-icon {
    margin-right: 0.75rem;
    margin-top: 0.2rem;
    color: #3498db;
    font-size: 0.9rem;
    min-width: 16px;
}

.step-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.step-distance {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

.route-summary {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #dee2e6;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c3e50;
}
.summary-item i {
    color: #3498db;
}


/* Hide default routing control */
.leaflet-routing-contain.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 300px;
    flex-wrap: nowrap !important;
}

.search-input-container {
    position: relative;
    flex: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.popup-content {
    min-width: 200px;
}

.popup-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.3rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 0.3rem 0;
}

.status-passable {
    background-color: #d4edda;
    color: #155724;
}

.status-blocked {
    background-color: #f8d7da;
    color: #721c24;
}

.status-repair {
    background-color: #fff3cd;
    color: #856404;
}

/* Relief status badges */
.relief-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 0.3rem 0;
}

.relief-needs-help {
    background-color: #f8d7da;
    color: #721c24;
}

.relief-assistance-ongoing {
    background-color: #fff3cd;
    color: #856404;
}

.relief-help-received {
    background-color: #d4edda;
    color: #155724;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 100001;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.location-info-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.3;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-info-display strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.modal-header .close-btn {
    color: white;
    opacity: 0.8;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    position: static;
}

.modal-header .close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #28a745 transparent;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 0 12px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
}

.modal-body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #28a745;
    background: white;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #eee;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Remove button in popups */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
}

.btn-danger.btn-sm {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger.btn-sm:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* User reported marker styles */
.user-reported-marker {
    position: relative;
}

.user-reported-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #17a2b8;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Search result marker styles */
.search-result-marker {
    animation: searchPulse 2s infinite;
}

@keyframes searchPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Click to mark instruction - repositioned to top-right */
.click-to-mark-instruction {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #2c3e50;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    z-index: 1500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 2px solid #28a745;
    max-width: 320px;
    animation: slideInFromRight 0.3s ease-out;
}

.click-to-mark-instruction h4 {
    margin: 0 0 0.5rem 0;
    color: #28a745;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.click-to-mark-instruction p {
    margin: 0 0 1rem 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

.click-to-mark-instruction .instruction-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.click-to-mark-instruction .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.click-to-mark-instruction .esc-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced cursor for reporting mode */
body.reporting-mode {
    cursor: crosshair !important;
}

body.reporting-mode * {
    cursor: crosshair !important;
}

body.reporting-mode #map {
    cursor: crosshair !important;
}

/* Mobile responsive adjustments for instruction */
@media (max-width: 768px) {
    .click-to-mark-instruction {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 1rem;
    }

    .click-to-mark-instruction h4 {
        font-size: 1rem;
    }

    .click-to-mark-instruction p {
        font-size: 0.85rem;
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Search suggestions responsive */
.search-suggestions,
#searchSuggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 1px;
    right: 0;
    background: #ffffff !important;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 12px;
    max-height: 300px;
    z-index: 1999 !important;
    overflow-y: auto;
    display: none !important;
    /* Hidden by default */
    width: 100%;
}

.search-suggestions,
#searchSuggestions {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}

.search-suggestions::-webkit-scrollbar,
#searchSuggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-thumb,
#searchSuggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover,
#searchSuggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Show suggestions when active */
.search-suggestions.show,
#searchSuggestions.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Additional suggestion styling */
.suggestion-main {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-main i {
    color: #007bff;
    width: 16px;
    text-align: center;
}

.suggestion-address {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.suggestion-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.suggestion-type {
    background: #e9ecef;
    color: #495057;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.suggestion-distance {
    color: #28a745;
    font-weight: 500;
}

.no-suggestions {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-suggestion-item,
.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-suggestion-item:hover,
.search-suggestion-item.highlighted,
.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #f8f9fa;
}

.search-suggestion-item:last-child,
.suggestion-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {

    .search-suggestions,
    #searchSuggestions {
        max-height: 50vh;
        border-radius: 0 0 12px 12px;
        box-shadow: rgba(0, 0, 0, 0.2) 0px 6px 20px;
        margin-top: 2px;
    }

    .search-suggestion-item,
    .suggestion-item {
        padding: 1.25rem 1rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
        line-height: 1.5;
        min-height: 60px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .suggestion-main {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
        font-weight: 600;
        color: #2c3e50;
    }

    .suggestion-address {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
        color: #6c757d;
        line-height: 1.4;
    }

    .suggestion-details {
        font-size: 0.85rem;
        color: #28a745;
        font-weight: 500;
    }

    .search-suggestion-item:active,
    .suggestion-item:active {
        transform: scale(0.98);
        background-color: #e8f5e8;
    }

    .search-suggestion-item:hover,
    .suggestion-item:hover {
        background-color: transparent;
    }

    .search-suggestion-item:active,
    .suggestion-item:active {
        background-color: #e8f5e8;
    }
}

@media (max-width: 480px) {

    .search-suggestions,
    #searchSuggestions {
        max-height: 45vh;
        left: -5px;
        right: -5px;
        border-radius: 0 0 16px 16px;
    }

    .search-suggestion-item,
    .suggestion-item {
        padding: 1.5rem 1.25rem;
        min-height: 70px;
    }

    .suggestion-main {
        font-size: 1.15rem;
        margin-bottom: 0.5rem;
    }

    .suggestion-address {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .suggestion-details {
        font-size: 0.9rem;
    }
}

/* Loading animation */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
}

/* Prevent text selection on touch devices */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .legend,
    .sync-status {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .footer-content h1 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }

    .footer-content p {
        font-size: 0.9rem;
    }

    .control-panel {
        padding: 0.5rem;
    }

    .map-container {
        height: calc(100vh - 80px);
        /* Adjusted for landscape without footer */
        min-height: 200px;
        overflow: hidden;
    }

    .info-panel {
        max-height: 40vh;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .footer-content {
        padding: 0 0.5rem;
    }

    .footer-content h1 {
        font-size: 1.3rem;
    }

    .footer-content p {
        font-size: 0.85rem;
    }

    .map-container {
        height: calc(100vh - 60px);
        /* Adjusted for very small screens without footer */
        min-height: 150px;
        overflow: hidden;
    }

    .control-panel {
        padding: 0.4rem;
    }

    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .legend {
        left: 10px;
        right: auto;
        max-width: 220px;
        padding: 0.5rem;
        font-size: 0.7rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .legend,
    .info-panel,
    .modal-content {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Report Location Button - floating on map */
.report-location-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 5000;
}

.btn-floating {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
    transition: all 0.3s ease;
    background: #28a745;
    color: white;
}

.btn-floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #218838;
}

.btn-floating:active {
    transform: translateY(0);
}

/* Pinned Locations Dropdown - positioned on map */
.pinned-locations-dropdown {
    position: absolute;
    bottom: 20px;
    left: 10px;
    /* Align with Leaflet zoom controls and Map Legend */
    z-index: 5000;
}

.pinned-locations-dropdown .btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.pinned-list {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #28a745;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.2);
    min-width: 385px;
    max-width: 440px;
    max-height: 100vh;
    overflow: hidden;
    z-index: 5100;
    margin-bottom: 0.5rem;
    display: none;
}

.pinned-list-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.pinned-list-header h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pinned-list-header .close-btn {
    color: white;
    opacity: 0.8;
    font-size: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    position: static;
}

.pinned-list-header .close-btn:hover {
    opacity: 1;
}

.pinned-list-filters {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.pinned-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.pinned-search-container input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.pinned-search-container input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.pinned-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.9rem;
}

.pinned-urgency-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.urgency-filter {
    padding: 0.3rem 0.6rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}

.urgency-filter:hover {
    border-color: #17a2b8;
    color: #17a2b8;
    /* transform: translateY(-1px); */
}

.urgency-filter.active {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.urgency-filter[data-urgency="critical"] {
    color: #dc3545;
}

.urgency-filter[data-urgency="critical"]:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.urgency-filter[data-urgency="critical"].active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.urgency-filter[data-urgency="urgent"] {
    color: #fd7e14;
}

.urgency-filter[data-urgency="urgent"]:hover {
    border-color: #fd7e14;
    color: #fd7e14;
}

.urgency-filter[data-urgency="urgent"].active {
    background: #fd7e14;
    border-color: #fd7e14;
    color: white;
}

.urgency-filter[data-urgency="moderate"] {
    color: #ffc107;
}

.urgency-filter[data-urgency="moderate"]:hover {
    border-color: #ffc107;
    color: #ffc107;
}

.urgency-filter[data-urgency="moderate"].active {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.pinned-list-content {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.no-pins {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

.pinned-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pinned-item:hover {
    background-color: #f8f9fa;
}

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

.pinned-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.pinned-item-name strong {
    font-weight: 700;
    color: #17a2b8;
}

.pinned-item-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.pinned-item-urgency {
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.pinned-item-source {
    background: #e9ecef;
    color: #495057;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.pinned-item-needs {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.pinned-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}

.waze-btn {
    background: #00d4ff;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.waze-btn:hover {
    background: #00b8e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.waze-btn:active {
    transform: translateY(0);
}

.waze-btn i {
    font-size: 0.8rem;
}

/* Google Maps button styling */
.google-maps-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.google-maps-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.google-maps-btn:active {
    transform: translateY(0);
}

.google-maps-btn i {
    font-size: 0.8rem;
}

/* Popup-specific Waze button styling */
.popup-waze-btn {
    min-width: 140px;
    justify-content: center;
    flex: 1;
}

/* Popup-specific Google Maps button styling */
.popup-google-maps-btn {
    min-width: 140px;
    justify-content: center;
    flex: 1;
}

.popup-content .google-maps-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.popup-content .waze-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

/* Sync Status Indicator */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #e9ecef;
}

/* Auth Status Indicator */
.auth-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.auth-indicator:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-indicator.connected {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.auth-indicator.local {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.auth-indicator.anonymous {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.admin-link {
    text-decoration: none;
    white-space: nowrap;
}

/* User Admin Banner */
.user-admin-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.banner-content i {
    font-size: 1.5rem;
}

.banner-content span {
    font-size: 0.95rem;
    line-height: 1.5;
}

.banner-link {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.banner-link:hover {
    opacity: 0.8;
}

.banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Performance optimizations */
#map {
    will-change: transform;
}

.leaflet-marker-icon,
.leaflet-marker-shadow {
    will-change: transform;
}

/* Pulse marker for location highlighting */
.pulse-marker {
    position: relative;
}

.pulse-ring {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #667eea;
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulse-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    top: 9px;
    left: 9px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.sync-status #syncIcon {
    font-size: 0.7rem;
}

.sync-status.online #syncIcon {
    color: #28a745;
    animation: pulse 2s infinite;
}

.sync-status.offline #syncIcon {
    color: #dc3545;
}

.sync-status.connecting #syncIcon {
    color: #ffc107;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

}

/* Mobile responsive styles for Waze and Google Maps buttons */
@media (max-width: 768px) {
    .waze-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .google-maps-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .pinned-item-actions {
        margin-top: 0.4rem;
    }

    .popup-waze-btn {
        min-width: 120px;
        font-size: 0.75rem;
    }

    .popup-google-maps-btn {
        min-width: 120px;
        font-size: 0.75rem;
    }

    .popup-content .waze-btn {
        padding: 0.4rem 0.8rem;
    }

    .popup-content .google-maps-btn {
        padding: 0.4rem 0.8rem;
    }
}

/* Image Upload Styles */
.image-upload-container {
    margin-top: 0.5rem;
}

.btn-outline {
    background: transparent;
    border: 2px dashed #17a2b8;
    color: #17a2b8;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: rgba(23, 162, 184, 0.1);
    border-color: #138496;
    color: #138496;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.image-remove-btn:hover {
    background: #dc3545;
}

.upload-help-text {
    margin-top: 0.5rem;
    color: #6c757d;
}

.upload-help-text small {
    font-size: 0.8rem;
}

/* Image display in popups */
.popup-images {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.popup-images h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 600;
}

.popup-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.popup-image-item {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.popup-image-item:hover {
    transform: scale(1.05);
}

.popup-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add photo button in gallery */
.add-photo-item {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-photo-item:hover {
    background: #e9ecef;
    border-color: #17a2b8;
    transform: scale(1.02);
}

.add-photo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.75rem;
    text-align: center;
}

.add-photo-content i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: #17a2b8;
}

.add-photo-content span {
    font-weight: 500;
}

/* Image modal for full-size viewing */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    z-index: 100000;
}

.image-modal.show {
    display: flex;
}

.image-modal-header {
    background: transparent;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100001;
}

.image-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.image-modal-details {
    flex: 1;
    color: white;
    text-align: left;
}

.image-modal-details h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-modal-details .detail-item {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.image-modal-details .detail-item strong {
    color: white;
    font-weight: 600;
}

.image-modal-image-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 80vh;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

.image-modal-close {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    opacity: 0.8;
}

.image-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

/* Responsive adjustments for image modal */
@media (max-width: 768px) {
    .image-modal-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .image-modal-close {
        align-self: flex-end;
        margin-top: -2rem;
    }

    .image-modal-details h4 {
        font-size: 1rem;
    }

    .image-modal-details .detail-item {
        font-size: 0.8rem;
    }

    .image-modal img {
        max-height: 60vh;
    }
}

/* Location info display for add photos modal */
.location-info-display {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.location-info-display h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.location-info-display .info-item {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.location-info-display .info-item strong {
    color: #495057;
}

/* Welcome Guide Modal Styles */
.welcome-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.welcome-guide-overlay.show {
    display: flex;
}

.welcome-guide-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: welcomeSlideIn 0.4s ease-out;
}

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-guide-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.welcome-guide-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}


.welcome-guide-body {
    padding: 2rem;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}

.welcome-guide-body::-webkit-scrollbar {
    width: 6px;
}

.welcome-guide-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.welcome-guide-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.welcome-intro {
    text-align: -webkit-left;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    z-index: 1;
}

.welcome-intro>* {
    position: relative;
    z-index: 2;
}

.welcome-intro p {
    margin: 0;
    font-size: 1.2rem;
    color: white;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #17a2b8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.feature-content h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.feature-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.welcome-guidelines {
    margin-bottom: 2rem;
}

.guideline-box {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: #fff8e1;
    border-radius: 16px;
    border: 2px solid #ffc107;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.2);
    position: relative;
}

.guideline-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffc107, #ffeb3b, #ffc107);
    border-radius: 18px;
    z-index: -1;
    opacity: 0.3;
}

.guideline-box i {
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.guideline-box strong {
    color: #b8860b;
    font-size: 1.2rem;
    font-weight: 600;
}

.guideline-box p {
    margin: 0.5rem 0 0 0;
    color: #8b6914;
    line-height: 1.6;
    font-size: 0.95rem;
}

.emergency-contacts h4 {
    color: #dc3545;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.contact-item {
    padding: 1rem;
    background: #f8d7da;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    color: #721c24;
    font-size: 0.9rem;
}

.welcome-guide-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* Remove mobile tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for inputs and content areas */
input,
textarea,
.info-content,
.welcome-guide-body,
.pinned-list-content {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Specific mobile touch behavior fixes */
.report-location-btn,
.pinned-locations-dropdown .btn,
.pinned-item,
.btn,
button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* Mobile responsive for welcome guide */
@media (max-width: 768px) {
    .welcome-guide-modal {
        max-width: 95%;
        margin: 10px;
    }

    .welcome-guide-header {
        padding: 1rem 1.5rem;
    }

    .welcome-guide-header h2 {
        font-size: 1.2rem;
    }

    .welcome-guide-body {
        padding: 1.5rem;
    }

    .welcome-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

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

/* Chat Styles */
.chat-section {
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
}

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

.chat-header h5 {
    margin: 0;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-chat-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-chat-toggle:hover {
    background-color: #f0f0f0;
}

.chat-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px 10px;
    background: white;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.chat-input-container input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn-send-chat {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-send-chat:hover {
    background: #0056b3;
}

.btn-send-chat:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-info {
    margin-top: 8px;
    font-size: 10px;
    color: #888;
    text-align: center;
}

/* Mobile chat adjustments */
@media (max-width: 768px) {
    .chat-container {
        max-height: 150px;
    }

    .chat-input-container input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Photo Toggle Styles */
.photos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.photos-header h5 {
    margin: 0;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-toggle-photos {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.btn-toggle-photos:hover {
    background-color: #f0f0f0;
    color: #333;
}

.btn-toggle-photos i {
    font-size: 14px;
}