/* Frontend Styles for Postal Map Iran Plugin */

.postal-map-container {
    font-family: 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 10px;
}

.postal-map-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    text-align: center;
}

.postal-map-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.postal-map-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 16px;
}

.postal-map-filters {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-count {
    width: 100%;
    order: -1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #e74c3c;
}

.filter-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: end;
}

.filter-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.postal-map-content {
    min-height: 600px;
}

.map-section {
    width: 100%;
    width: 100%;
    position: relative;
}

#postal-map {
    width: 100%;
    height: 600px;
    border: none;
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0;
    direction: rtl;
    text-align: right;
    font-family: 'Tahoma', sans-serif;
}

.popup-content {
    padding: 15px;
    min-width: 250px;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f1f1;
}

.popup-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e74c3c;
}

.popup-info h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: bold;
}

.popup-type {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
    display: inline-block;
}

.popup-details {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.popup-details .detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.popup-details .label {
    font-weight: bold;
    color: #2c3e50;
    min-width: 80px;
}

.popup-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f1f1;
}

.popup-call-btn {
    background: #27ae60;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.popup-call-btn:hover {
    background: #219a52;
}

.popup-details-btn {
    background: #3498db;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.popup-details-btn:hover {
    background: #2980b9;
}

.popup-navigation-btn {
    background: #9b59b6;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.popup-navigation-btn:hover {
    background: #8e44ad;
}

.popup-share-btn {
    background: #f39c12;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.popup-share-btn:hover {
    background: #e67e22;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    font-size: 16px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f1f1;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Modern Pin Marker */
.modern-pin-marker {
    background: transparent !important;
    border: none !important;
}

.pin-marker {
    transition: all 0.3s ease;
}

.pin-marker:hover {
    transform: rotate(-45deg) scale(1.1) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .postal-map-container {
        margin: 5px;
        border-radius: 8px;
    }
    
    #postal-map {
        height: 350px !important;
    }
    
    .postal-map-filters {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .postal-map-header {
        padding: 15px;
    }
    
    .postal-map-header h2 {
        font-size: 20px;
    }
    
    .postal-map-header p {
        font-size: 14px;
    }
    
    .postal-map-content {
        min-height: 400px;
    }
    
    #postal-map {
        height: 400px;
    }
    
    .postal-map-filters {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .filter-btn {
        align-self: stretch;
        padding: 12px 20px;
    }
    
    .results-count {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .popup-actions {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .popup-call-btn,
    .popup-details-btn,
    .popup-navigation-btn,
    .popup-share-btn {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .popup-content {
        min-width: 200px;
        padding: 12px;
    }
    
    .popup-avatar {
        width: 50px;
        height: 50px;
    }
    
    .popup-info h4 {
        font-size: 16px;
    }
    
    .popup-type {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* RTL Improvements */
.leaflet-control-zoom {
    left: 10px !important;
    right: auto !important;
}

.leaflet-control-attribution {
    left: 0 !important;
    right: auto !important;
}

/* Custom Marker Colors */
.marker-post-melli { background-color: #e74c3c; }
.marker-tipax { background-color: #3498db; }
.marker-chapar { background-color: #2ecc71; }
.marker-boxeit { background-color: #f39c12; }
.marker-pick { background-color: #9b59b6; }
.marker-mahex { background-color: #1abc9c; }