/**
 * FoodBankFinder.Net - Custom Styles
 * Layout, navigation, and component styles
 */

/* ===== GLOBAL STYLES ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* ===== TOP NAVIGATION ===== */
.navbar.bg-dark-green {
    background-color: #155724 !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
}

/* ===== LEFT SIDEBAR NAVIGATION ===== */
.left-sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 250px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    background-color: #d4edda;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.left-sidebar::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: rgba(21, 87, 36, 0.3);
    border-radius: 3px;
}

.sidebar-content {
    padding: 1rem;
}

.sidebar-heading {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.sidebar-divider {
    margin: 1.5rem 0;
    border-color: rgba(21, 87, 36, 0.2);
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.stats-box .stat-item {
    padding: 0.5rem 0;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Hide sidebar on mobile by default */
@media (max-width: 991.98px) {
    .left-sidebar {
        transform: translateX(-100%);
    }

    .left-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Desktop - adjust main content for sidebar */
@media (min-width: 992px) {
    .main-content {
        margin-left: 250px;
    }

    .sidebar-toggle {
        display: none;
    }

    /* Adjust footer for sidebar */
    .footer {
        margin-left: 250px;
    }
}

/* ===== FOOD BANK CARDS ===== */
.food-bank-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #28a745;
}

.food-bank-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.food-bank-card .card-title {
    color: #155724;
    font-weight: 700;
}

.food-bank-card .badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

.food-bank-card .btn {
    transition: all 0.2s ease;
}

/* ===== MAP STYLES ===== */
#map,
#detailMap,
#previewMap {
    border-radius: 0.5rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content h6 {
    color: #155724;
    margin-bottom: 0.5rem;
}

/* Custom marker popup */
.marker-popup {
    min-width: 200px;
}

.marker-popup .popup-title {
    font-weight: 700;
    color: #155724;
    margin-bottom: 0.25rem;
}

.marker-popup .popup-address {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.marker-popup .popup-status {
    margin-bottom: 0.5rem;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: auto;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
    transition: all 0.2s ease;
}

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

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

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

/* Facebook share button */
.share-btn-facebook {
    background-color: #1877f2;
    border-color: #1877f2;
    color: white;
}

.share-btn-facebook:hover {
    background-color: #1565c0;
    border-color: #1565c0;
    color: white;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-label {
    font-weight: 600;
    color: #155724;
    margin-bottom: 0.5rem;
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-info {
    border-left-color: #20c997;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-danger {
    border-left-color: #dc3545;
}

/* ===== CARDS ===== */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table tbody tr:hover {
    background-color: rgba(40, 167, 69, 0.05);
}

/* ===== DISTANCE DISPLAY ===== */
.distance-badge {
    background-color: #6c757d;
    color: white;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* ===== STATUS INDICATORS ===== */
.status-open {
    color: #28a745;
    font-weight: 700;
}

.status-closed {
    color: #6c757d;
    font-weight: 700;
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 2rem 1rem !important;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    #map,
    #detailMap {
        height: 400px !important;
    }

    .food-bank-card {
        margin-bottom: 1rem;
    }
}

/* ===== ANIMATION ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ===== SEARCH INPUT ===== */
.search-input-group {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FILTER SECTION ===== */
.filter-section {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ===== SHARE BUTTON ===== */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-share i {
    font-size: 1.2rem;
}

/* ===== UTILITIES ===== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-green {
    box-shadow: 0 0.125rem 0.25rem rgba(40, 167, 69, 0.075) !important;
}

.shadow-green {
    box-shadow: 0 0.5rem 1rem rgba(40, 167, 69, 0.15) !important;
}

.shadow-lg-green {
    box-shadow: 0 1rem 3rem rgba(40, 167, 69, 0.175) !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #28a745;
    border-radius: 5px;
}

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