/* Map Container */
.map-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Leaflet Map Styling */
#map {
    height: 500px;
    width: 100%;
    min-height: 350px;
    background-color: #f8f9fa;
}

/* Map Controls */
.leaflet-control {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    background: white;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease;
}

.leaflet-bar a {
    border-bottom: 1px solid #dee2e6 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    color: #495057 !important;
    font-size: 16px !important;
    text-decoration: none !important;
}

.leaflet-bar a:first-child {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.leaflet-bar a:last-child {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-bottom: none !important;
}

.leaflet-bar a:hover {
    background-color: #f8f9fa !important;
    color: #0d6efd !important;
}

/* Marker Styling */
.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s, filter 0.2s;
}

.leaflet-marker-icon:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* Error Messages */
.map-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Search Input */
#address-search {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0.625rem 1rem;
    height: calc(2.75rem + 2px);
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#search-address {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0.625rem 1.25rem;
    height: calc(2.75rem + 2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Styling */
.card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-img-top {
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
    height: 180px;
    object-fit: cover;
}

/* Button Styling */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

/* Form Styling */
.form-control, .form-select {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    #map {
        height: 400px;
    }
    
    .card-img-top {
        height: 160px;
    }
}

@media (max-width: 768px) {
    #map {
        height: 350px;
    }
    
    .card-img-top {
        height: 140px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 576px) {
    #map {
        height: 300px;
    }
    
    .card-img-top {
        height: 120px;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
    margin: 1rem auto;
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

.rounded { border-radius: 0.5rem !important; }
.rounded-lg { border-radius: 0.75rem !important; }
.rounded-xl { border-radius: 1rem !important; }

/* Waypoint Detail Page */
.waypoint-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.media-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.media-card .card-img-top {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.media-card .card-footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
}

.media-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-card:hover .media-actions {
    opacity: 1;
}

.media-actions .btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.media-actions .btn:hover {
    background: #fff;
}

/* Question Styles */
.question-option {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
}

.question-option .form-check-input {
    margin-left: -1.5rem;
}

/* Map in Waypoint Detail */
#map {
    height: 300px;
    border-radius: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

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