/* Variáveis CSS - Tema Roxo Moderno */
:root {
    --hpe-primary-color: #6A1B9A;
    --hpe-primary-hover: #4A148C;
    --hpe-secondary-color: #AB47BC;
    --hpe-accent-color: #CE93D8;
    --hpe-success-color: #06D6A0;
    --hpe-success-hover: #05B88A;
    --hpe-danger-color: #EF476F;
    --hpe-danger-hover: #D43D63;
    --hpe-warning-color: #FFD166;
    --hpe-warning-hover: #E5B952;
    --hpe-dark-color: #2B2D42;
    --hpe-light-color: #F8F9FA;
    --hpe-background-color: #ffffff;
    --hpe-card-background: #ffffff;
    --hpe-shadow-color: rgba(106, 27, 154, 0.1);
    --hpe-shadow-hover: rgba(106, 27, 154, 0.2);
    --hpe-border-color: #EDF2F4;
    --hpe-text-color: #2B2D42;
    --hpe-text-light: #8D99AE;
    --hpe-gradient-primary: linear-gradient(135deg, #6A1B9A 0%, #AB47BC 100%);
    --hpe-gradient-accent: linear-gradient(135deg, #CE93D8 0%, #AB47BC 100%);
    --hpe-border-radius: 12px;
    --hpe-border-radius-sm: 8px;
    --hpe-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset e Base */
#hpe-map-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--hpe-text-color);
    background: var(--hpe-light-color);
}

/* Header Flutuante Moderno */
.hpe-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--hpe-border-color);
    z-index: 1000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px var(--hpe-shadow-color);
}

.hpe-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hpe-header-title h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--hpe-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hpe-header-badge {
    background: var(--hpe-gradient-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Filtros */
.hpe-filters-container {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 320px;
    background: var(--hpe-background-color);
    border-radius: var(--hpe-border-radius);
    box-shadow: 0 8px 32px var(--hpe-shadow-color);
    z-index: 999;
    transform: translateX(-110%);
    transition: var(--hpe-transition);
    border: 1px solid var(--hpe-border-color);
}

.hpe-filters-container.is-visible {
    transform: translateX(0);
}

.hpe-filters-header {
    padding: 20px;
    border-bottom: 1px solid var(--hpe-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hpe-filters-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--hpe-text-color);
}

.hpe-filters-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.hpe-filter-group {
    margin-bottom: 20px;
}

.hpe-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--hpe-text-color);
}

.hpe-filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--hpe-border-color);
    border-radius: var(--hpe-border-radius-sm);
    background: var(--hpe-background-color);
    font-size: 0.95rem;
    transition: var(--hpe-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238D99AE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.hpe-filter-select:focus {
    outline: none;
    border-color: var(--hpe-primary-color);
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.hpe-distance-slider {
    width: 100%;
    margin: 15px 0;
}

.hpe-distance-value {
    text-align: center;
    font-size: 0.9rem;
    color: var(--hpe-text-light);
    margin-top: 8px;
}

.hpe-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.hpe-filter-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--hpe-border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--hpe-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hpe-apply-filters {
    background: var(--hpe-gradient-primary);
    color: white;
}

.hpe-clear-filters {
    background: var(--hpe-light-color);
    color: var(--hpe-text-color);
    border: 2px solid var(--hpe-border-color);
}

/* Layout Principal */
.hpe-map-and-list-wrapper {
    position: relative !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    padding-top: 70px;
}

#hpeMapaEmpregos {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}

/* Sidebar Moderna (Desktop) */
.hpe-employment-list-sidebar {
    position: absolute !important;
    top: 80px !important;
    right: 20px !important;
    width: 380px !important;
    height: calc(100vh - 100px) !important;
    background: var(--hpe-background-color) !important;
    border-radius: var(--hpe-border-radius) !important;
    box-shadow: 0 8px 32px var(--hpe-shadow-color) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: translateX(420px) !important;
    transition: var(--hpe-transition) !important;
    z-index: 10 !important;
    border: 1px solid var(--hpe-border-color) !important;
}

.hpe-map-and-list-wrapper:hover .hpe-employment-list-sidebar {
    transform: translateX(0) !important;
}

.hpe-list-header {
    padding: 20px;
    background: var(--hpe-gradient-primary);
    text-align: center;
    position: relative;
}

.hpe-list-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.hpe-employment-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.hpe-employment-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Cards de Emprego */
.hpe-employment-card {
    background: var(--hpe-card-background);
    border-radius: var(--hpe-border-radius);
    padding: 0;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px var(--hpe-shadow-color);
    transition: var(--hpe-transition);
    cursor: pointer;
    border: 1px solid var(--hpe-border-color);
    overflow: hidden;
}

.hpe-card-header {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.hpe-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpe-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--hpe-gradient-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hpe-card-content {
    padding: 16px;
}

.hpe-card-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hpe-text-color);
    line-height: 1.3;
}

.hpe-attributes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0;
}

.hpe-attribute-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--hpe-text-light);
}

.hpe-attribute-item i {
    width: 16px;
    text-align: center;
    color: var(--hpe-primary-color);
}

.hpe-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.hpe-action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--hpe-border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: var(--hpe-transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hpe-action-primary {
    background: var(--hpe-gradient-primary);
    color: white !important;
}

.hpe-action-secondary {
    background: var(--hpe-light-color);
    color: var(--hpe-text-color);
    border: 1px solid var(--hpe-border-color);
}

/* Popups do Mapa */
.leaflet-popup-content-wrapper.hpe-map-popup {
    border-radius: var(--hpe-border-radius) !important;
    box-shadow: 0 8px 25px var(--hpe-shadow-hover) !important;
    overflow: hidden;
    background: var(--hpe-background-color) !important;
}

.hpe-map-popup .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 280px !important;
    font-family: inherit !important;
}

.hpe-map-popup .leaflet-popup-tip {
    background: var(--hpe-background-color) !important;
}

.hpe-popup-header {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.hpe-popup-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpe-popup-body {
    padding: 16px;
}

.hpe-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* Ícones do Mapa */
.hpe-employment-marker {
    background: transparent !important;
    border: none !important;
}

.hpe-employment-icon {
    background: var(--hpe-gradient-primary);
    color: white;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% 50% 50% 0;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(106, 27, 154, 0.4);
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.hpe-employment-icon i {
    transform: rotate(45deg);
    font-size: 14px !important;
}

.hpe-marker-cluster {
    color: black;
    background-clip: padding-box;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 12px;
    border: 2px solid rgba(255,255,255,0.5);
}
.hpe-marker-cluster-small { background-color: rgba(106, 27, 154, 0.8); width: 30px !important; height: 30px !important; }
.hpe-marker-cluster-medium { background-color: rgba(106, 27, 154, 0.8); width: 40px !important; height: 40px !important; font-size: 14px; }
.hpe-marker-cluster-large { background-color: rgba(106, 27, 154, 0.8); width: 50px !important; height: 50px !important; font-size: 16px; }

/* Controles do Mapa */
.hpe-map-controls-container {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 401;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hpe-map-control-button {
    background: var(--hpe-background-color);
    color: var(--hpe-text-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px var(--hpe-shadow-color);
    cursor: pointer;
    transition: var(--hpe-transition);
}

/* Popup da Lista Mobile */
.hpe-mobile-list-popup {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000; display: flex;
    flex-direction: column; justify-content: flex-end; opacity: 0;
    visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.hpe-mobile-list-popup.is-visible { opacity: 1; visibility: visible; }
.hpe-mobile-list-popup-content {
    background: var(--hpe-light-color); height: 85vh;
    border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hpe-mobile-list-popup.is-visible .hpe-mobile-list-popup-content { transform: translateY(0); }
.hpe-mobile-list-header {
    padding: 16px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--hpe-border-color);
    background: white; border-radius: 20px 20px 0 0;
}
.hpe-mobile-list-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.hpe-mobile-list-close-btn {
    background: var(--hpe-light-color); border: none; border-radius: 50%;
    width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer;
}
.hpe-mobile-employment-list { flex-grow: 1; overflow-y: auto; padding: 16px; }

/* Loading Overlay */
.hpe-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.hpe-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--hpe-primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: hpe-spin 1s linear infinite;
}
@keyframes hpe-spin {
    to { transform: rotate(360deg); }
}
.hpe-loading-overlay p {
    margin-top: 16px;
    font-size: 1rem;
    color: var(--hpe-text-color);
}

/* Toast Notifications */
.hpe-toast {
    position: fixed;
    bottom: 30px;
    right: 20px;
    background: var(--hpe-background-color);
    padding: 12px 20px;
    border-radius: var(--hpe-border-radius-sm);
    box-shadow: 0 4px 12px var(--hpe-shadow-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--hpe-transition);
}
.hpe-toast.hpe-toast-show {
    opacity: 1;
    transform: translateY(0);
}
.hpe-toast-success { border-left: 4px solid var(--hpe-success-color); }
.hpe-toast-error { border-left: 4px solid var(--hpe-danger-color); }
.hpe-toast-warning { border-left: 4px solid var(--hpe-warning-color); }
.hpe-toast-info { border-left: 4px solid var(--hpe-primary-color); }
.hpe-toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--hpe-text-light);
}

/* Responsividade */
@media (max-width: 992px) {
    .hpe-employment-list-sidebar { display: none !important; }
    .hpe-map-controls-container { bottom: 100px; }
    .hpe-show-mobile-list-btn {
        display: flex; position: fixed; bottom: 30px; right: 20px;
        padding: 16px 24px; background: var(--hpe-gradient-primary); color: white;
        border: none; border-radius: 50px; font-size: 1rem; font-weight: 600;
        box-shadow: 0 6px 20px rgba(106, 27, 154, 0.3); z-index: 1000;
        cursor: pointer; align-items: center; gap: 8px;
    }
}

/* Ajustes Finais */
.hpe-user-location-marker {
    width: 32px !important;
    height: 32px !important;
    background: #6A1B9A;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px !important;
}

.leaflet-popup-content p {
    margin: 0 !important;
}
.leaflet-popup-content-wrapper.hpe-map-popup {
    padding: 1px;
}