/* ==================================================
   PETA UMKM - CUSTOM STYLES
   Leaflet Map Integration with Emerald Theme
   ================================================== */

/* Hero Header */
.map-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 1rem 0 0.75rem;
    border-bottom: 3px solid #10b981;
}

.map-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin: 0 0 0.25rem;
    text-align: center;
}

.map-hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

/* Search Bar */
.map-search-wrapper {
    max-width: 800px;
    margin: 0 auto 1.25rem;
    /* Reduced bottom margin */
    position: relative;
}

.map-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.map-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.map-search-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.75rem 1.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: white;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

/* Map Container */
.map-section {
    padding: 1rem 0 0 0;
    /* Minimal top padding only */
    background: #f8fafc;
}

.map-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
    height: calc(100vh - 200px);
    /* Full height minus header */
    min-height: calc(100vh - 200px);
    padding: 0 0.5rem 0.5rem;
    /* Only side and bottom padding */
}

.map-container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    overflow: hidden;
    position: relative;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Map Badge */
.map-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 400;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.map-badge-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

/* UMKM List Panel */
.umkm-panel {
    background: #f8fafc;
    border-radius: 24px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.umkm-panel-header {
    padding: 1.5rem;
    background: white;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.umkm-panel-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.25rem;
}

.umkm-panel-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.umkm-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* UMKM Card */
.umkm-card {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid #f1f5f9;
    display: flex;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.umkm-card:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    transform: translateY(-2px);
}

.umkm-card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
}

.umkm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.umkm-card:hover .umkm-card-image img {
    transform: scale(1.1);
}

.umkm-card-content {
    flex: 1;
    min-width: 0;
    /* Critical for flex container overflow fix */
    overflow: hidden;
    /* Prevent any child overflow */
    max-width: 100%;
}

.umkm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.umkm-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s;
}

.umkm-card:hover .umkm-card-title {
    color: #10b981;
}

.umkm-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-default {
    background: #f1f5f9;
    color: #64748b;
}

.badge-landmark {
    background: #dbeafe;
    color: #3b82f6;
}

.badge-pemerintahan {
    background: #f3e8ff;
    color: #7e22ce;
}

.badge-kuliner {
    background: #fee2e2;
    color: #ef4444;
}

.badge-jasa {
    background: #ede9fe;
    color: #8b5cf6;
}

.badge-ibadah {
    background: #dcfce7;
    color: #10b981;
}

.badge-pangkalan {
    background: #ffedd5;
    color: #f59e0b;
}

.badge-sekolah {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge-kesehatan {
    background: #e0f2fe;
    color: #0ea5e9;
}

.umkm-card-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.umkm-card-address {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    overflow: hidden !important;
    max-width: 100% !important;
}

.umkm-card-address i {
    color: #10b981;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.umkm-card-address span {
    flex: 1;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Modal */
.map-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.map-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 700px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.map-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #1e293b;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: white;
    transform: rotate(90deg);
}

.modal-image {
    height: 280px;
    width: 100%;
    background: #e2e8f0;
    position: relative;
}

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

.modal-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
}

.modal-category-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    background: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.modal-desc {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 2rem;
    line-height: 1.7;
    padding-left: 1rem;
    border-left: 4px solid #d1fae5;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.modal-info-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.modal-info-icon {
    color: #10b981;
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

.modal-info-content {
    flex: 1;
}

.modal-info-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.25rem;
}

.modal-info-value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-maps {
    background: linear-gradient(135deg, #4285f4 0%, #1967d2 100%);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-maps:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .map-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .map-container {
        height: 450px;
    }

    .umkm-panel {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .map-hero-title {
        font-size: 2rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    .map-section {
        padding: 2rem 0;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .umkm-card {
        padding: 1rem;
    }

    .umkm-card-image {
        width: 80px;
        height: 80px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}
/* ==================================================
   PETA UMKM ENHANCED - ADDITIONAL STYLES
   New Features: Location, Distance, Hours, Favorites
   ================================================== */

/* Advanced Filters Section */
.advanced-filters {
    max-width: 900px;
    margin: 2rem auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.filter-group,
.sort-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.sort-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    margin-right: 0.5rem;
}

.control-btn,
.sort-btn {
    padding: 0.6rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    background: white;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover,
.sort-btn:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.control-btn.active,
.sort-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.location-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    color: white;
}

.location-btn:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* User Location Marker */
.user-location-marker {
    background: transparent;
}

.pulse-marker {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-marker i {
    font-size: 24px;
    color: #3b82f6;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pulse-marker::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Distance Badge */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-weight: 600;
}

.distance-badge i {
    font-size: 0.7rem;
    color: #10b981;
}

/* Status Badges */
.status-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.status-badge.open {
    background: #10b981;
    color: white;
}

.status-badge.closed {
    background: #ef4444;
    color: white;
}

/* Popular Badge */
.popular-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 2;
}

.popular-badge i {
    font-size: 0.75rem;
    animation: flicker 2s ease-in-out infinite;
}

/* Favorite Button */
.favorite-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.favorite-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.1);
}

.favorite-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
    animation: heartbeat 0.6s ease;
}

.favorite-btn i {
    font-size: 1rem;
    transition: transform 0.3s;
}

.favorite-btn:hover i {
    transform: scale(1.2);
}

.umkm-card.is-favorite {
    border-color: #fecaca;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

/* Modal Action Button */
.modal-action-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-action-btn:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.modal-action-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.modal-action-btn.active i {
    animation: heartbeat 0.6s ease;
}

/* Animations */
@keyframes heartbeat {

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

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1.1);
    }

    75% {
        transform: scale(1.3);
    }
}

@keyframes flicker {

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

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.4;
    }

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .advanced-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group,
    .sort-group {
        justify-content: center;
        width: 100%;
    }

    .sort-label {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .control-btn,
    .sort-btn {
        flex: 1;
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .popular-badge,
    .status-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.65rem;
    }

    .distance-badge {
        font-size: 0.7rem;
    }
}

/* Fix line-clamp compatibility */
.umkm-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    /* Standard property for future compatibility */
}

/* Modal Actions Responsive Grid */
@media (max-width: 640px) {
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-action-btn,
    .modal-btn {
        width: 100%;
    }
}

/* Fix card address text overflow */
.umkm-card-address {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.umkm-card-address span {
    word-break: break-word !important;
    max-width: 100%;
}
