/* Main styles for Tree Planting App */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Custom navbar styling */
.navbar-brand {
    font-weight: 600;
}

/* Map container */
#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Location list */
.location-list {
    max-height: 500px;
    overflow-y: auto;
}

/* Tree status badges */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

/* Card styling */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Button styling */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Photo preview */
#previewContainer img {
    max-height: 300px;
    width: auto;
    border-radius: 6px;
}

/* Tree photo in modal */
#treePhotoFullsize {
    max-height: 500px;
    width: auto;
}

/* Stats cards on dashboard */
.card .h2 {
    font-size: 2.5rem;
    font-weight: 600;
}

/* Form elements */
.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Custom modal styling */
.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #map {
        height: 350px;
    }
    
    .location-list {
        max-height: 300px;
    }
}

/* Location suggestions styling */
#locationSuggestions {
    position: absolute;
    width: 100%;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    top: 38px;
}


.search-box {
    position: relative;
    margin-bottom: 15px;
}

.suggestion-item {
    cursor: pointer;
}


.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item.active {
    background-color: #f8f9fa;
    color: #28a745;
}

/* Make the suggestion list scrollable on small screens */
@media (max-width: 576px) {
    #locationSuggestions {
        max-height: 150px;
    }
}

/* Add these styles to your assets/css/style.css file */

/* Welcome card styling */
.welcome-card {
    max-width: 300px;
    margin-right: 10px;
    margin-top: 10px;
}

.welcome-card .card {
    border: none;
    border-radius: 8px;
}

.welcome-card .card-title {
    color: #28a745;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.welcome-card .btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

/* Popup styling for the map */
.leaflet-popup-content {
    min-width: 200px;
}

.leaflet-popup-content h6 {
    margin-bottom: 8px;
    color: #28a745;
    font-weight: 600;
}

.leaflet-popup-content img {
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Map attribution (make it less obtrusive) */
.leaflet-control-attribution {
    font-size: 9px;
    background-color: rgba(255, 255, 255, 0.7);
}

/* Map zoom controls styling */
.leaflet-control-zoom a {
    color: #28a745 !important;
    border-color: #e0e0e0 !important;
}

/* Map loading indicator */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

/* Map loading control */
.map-loading-control {
    z-index: 1000;
    display: none; /* Hidden by default */
}

.map-loading-control .card {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Toast styling for better visibility */
#toast-container {
    z-index: 1100 !important;
}

#toast-container .toast {
    opacity: 1 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.leaflet-touch-instruction {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    padding: 5px 10px;
    margin: 10px;
    transition: opacity 1s ease;
}

.leaflet-touch-instruction-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.touch-icon {
    display: flex;
    align-items: center;
}



.map-mode-control {
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

.map-mode-control .btn-group {
    width: 100%;
}

.center-pin-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -100%); /* Adjust to position the bottom of the pin at the center */
    pointer-events: none; /* Let clicks pass through to the map */
    z-index: 1000;
}

.center-pin {
    animation: pin-drop 0.5s ease-out;
}

.center-pin svg {
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.5));
}

@keyframes pin-drop {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

#plant-instructions {
    font-size: 0.9rem;
}

.welcome-card {
    max-width: 300px;
    margin-bottom: 10px;
}

.welcome-card .card-body {
    padding: 10px;
}

.leaflet-touch-instruction {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    animation: fade-instruction 5s forwards;
}

.leaflet-touch-instruction-content {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.touch-icon {
    margin-right: 8px;
    color: #0078A8;
}

@keyframes fade-instruction {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.map-loading-control {
    z-index: 1000;
}

/* Custom marker colors */
.marker-planned {
    color: #f6c23e;
}

.marker-planted {
    color: #1cc88a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-mode-control .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .map-mode-control .btn svg {
        width: 14px;
        height: 14px;
    }
    
    #mark-confirm-btn, #map-confirm-buttons .alert {
        font-size: 0.9rem;
    }
}









/* Main Style CSS for Tree Planting App */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.card {
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    color: white;
}

/* Stats Card Animations */
@keyframes fadeNumber {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-number {
    animation: fadeNumber 0.5s ease forwards;
}

/* Drive Cards */
.drive-card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 15px;
}

.drive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.drive-stats {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stat-item {
    flex: 1;
    padding: 0.25rem;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* Main Navigation Tabs */
.main-tabs .nav-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    color: #495057;
    border: none;
}

.main-tabs .nav-link.active {
    color: #28a745;
    border-bottom: 3px solid #28a745;
    background-color: transparent;
}

.main-tabs .nav-item {
    margin-bottom: -1px;
}

/* Location list */
.location-list {
    max-height: 500px;
    overflow-y: auto;
}

/* Location suggestions */
#locationSuggestions, #driveSuggestions {
    position: absolute;
    width: 100%;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.toggle-label {
    margin: 0 8px;
    font-size: 0.9rem;
    color: #6c757d;
}

.toggle-label.active {
    color: #198754;
    font-weight: 600;
}

.stats-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.stats-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #28a745;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

/* Map elements */
#map {
    height: 500px;
    width: 100%;
    border-radius: 0.25rem;
}

.center-pin-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -100%);
    pointer-events: none;
    z-index: 1000;
}

.center-pin {
    animation: pin-drop 0.5s ease-out;
}

@keyframes pin-drop {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Welcome card */
.welcome-card {
    max-width: 300px;
    margin-bottom: 10px;
}

.welcome-card .card-body {
    padding: 10px;
}

/* Mobile touch instruction */
.leaflet-touch-instruction {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    animation: fade-instruction 5s forwards;
}

.leaflet-touch-instruction-content {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.touch-icon {
    margin-right: 8px;
    color: #0078A8;
}

@keyframes fade-instruction {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Loading control */
.map-loading-control {
    z-index: 1000;
}

/* Plant instructions */
#plant-instructions {
    font-size: 0.9rem;
}

/* Create drive button */
.create-drive-button {
    padding: 10px;
    text-align: center;
    margin-bottom: 15px;
}

/* Drive search container */
.drive-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    margin-bottom: 10px;
}

/* Responsive styles */
@media (max-width: 768px) {
    #map {
        height: 400px;
    }
    
    .drive-search-container {
        flex-direction: column;
    }
    
    .drive-search-container .input-group {
        margin-bottom: 10px;
        width: 100%;
    }
    
    .drive-search-container .btn {
        width: 100%;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .main-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .toggle-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .location-list {
        max-height: 300px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .row-cols-sm-2 > .col {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Mobile first approach for drive cards */
@media (max-width: 575.98px) {
    .row-cols-1 > .col {
        padding: 0 5px;
    }
    
    .drive-card {
        margin-bottom: 10px;
    }
    
    .drive-card .card-body {
        padding: 10px;
    }
}