/* ==========================================
   HUBEL VERDE - INTERACTIVE TEAM MAP STYLES
   ========================================== */

/* Montserrat is imported by primary variables, but ensure availability */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --hv-green: #38B449;
    --hv-green-dark: #2a8a37;
    --hv-green-light: rgba(56, 180, 73, 0.1);
    --hv-green-glow: rgba(56, 180, 73, 0.25);
    --hv-black: #0b1c2d;
    --hv-slate-dark: #112538;
    --hv-slate-light: #f4f7f6;
    --hv-gray-border: #e2e8f0;
    --hv-shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
    --hv-shadow-premium: 0 12px 30px rgba(11, 28, 45, 0.1);
    --hv-shadow-green: 0 10px 25px rgba(56, 180, 73, 0.15);
}

/* Page Layout */
.team-section {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--hv-slate-light);
    color: var(--hv-black);
    padding: 60px 0;
}

/* Elegant Hero Banner */
.team-hero-banner {
    position: relative;
    background: linear-gradient(135deg, var(--hv-black) 0%, #15324a 100%);
    color: #ffffff;
    padding: 80px 0;
    border-bottom: 4px solid var(--hv-green);
    overflow: hidden;
}

.team-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 180, 73, 0.15) 0%, rgba(56, 180, 73, 0) 70%);
    pointer-events: none;
}

.team-hero-banner h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.team-hero-banner h1 span {
    color: var(--hv-green);
}

.team-hero-banner p {
    font-size: 1.15rem;
    font-weight: 400;
    max-width: 700px;
    opacity: 0.9;
    line-height: 1.6;
}

/* Sticky Split Columns Container */
.map-split-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Sidebar Columns (Filters & List) */
.filter-list-column {
    flex: 1 1 450px;
    max-width: 100%;
}

@media (min-width: 992px) {
    .filter-list-column {
        max-width: 42%;
    }
}

/* Glassmorphism Filter Card */
.glass-filter-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--hv-shadow-subtle);
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.glass-filter-card:hover {
    box-shadow: var(--hv-shadow-premium);
}

.glass-filter-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--hv-black);
    display: flex;
    align-items: center;
    gap: 10px;
}

.glass-filter-card h4 i {
    color: var(--hv-green);
}

/* Custom Styled Selection Inputs */
.hv-form-group {
    margin-bottom: 18px;
}

.hv-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
    display: block;
}

.hv-select-wrapper {
    position: relative;
}

.hv-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--hv-black);
    background-color: #ffffff;
    border: 1px solid var(--hv-gray-border);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hv-select:focus {
    outline: none;
    border-color: var(--hv-green);
    box-shadow: 0 0 0 4px var(--hv-green-light);
}

.hv-select-wrapper::after {
    content: '\f107'; /* FontAwesome Angle Down */
    font-family: 'FontAwesome';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.hv-select-wrapper:hover .hv-select {
    border-color: #cbd5e1;
}

.hv-select-wrapper:hover::after {
    color: var(--hv-green);
}

/* Clear Reset Button */
.hv-clear-btn {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    color: #64748b;
    border: 1px dashed var(--hv-gray-border);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.hv-clear-btn:hover {
    background-color: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border-color: #fca5a5;
}

/* Result Counters */
.results-meta {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 15px;
    padding-left: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-meta span.count {
    color: var(--hv-green);
    font-weight: 700;
    font-size: 1rem;
}

/* Dynamic Agronomist List Container */
.agronomists-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* High-fidelity Agronomist Cards */
.agronomist-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--hv-gray-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: var(--hv-shadow-subtle);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.agronomist-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background-color: var(--hv-green);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.agronomist-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hv-shadow-green);
    border-color: var(--hv-green-glow);
}

.agronomist-card:hover::before {
    width: 6px;
}

/* Card Header (Photo & Main details) */
.card-header-flex {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agronomist-avatar-container {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--hv-slate-light);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.agronomist-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agronomist-init-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hv-green) 0%, var(--hv-green-dark) 100%);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.agronomist-identity {
    flex-grow: 1;
}

.agronomist-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--hv-black);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.agronomist-location {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.agronomist-location i {
    color: var(--hv-green);
}

/* Card Body (Specialties & Description) */
.card-body-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.specialty-badge {
    align-self: flex-start;
    background-color: var(--hv-green-light);
    color: var(--hv-green-dark);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid rgba(56, 180, 73, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.agronomist-bio {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* Card Footer (Actions) */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    border-top: 1px solid var(--hv-gray-border);
    padding-top: 15px;
}

.hv-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.hv-btn-outline {
    background-color: transparent;
    color: var(--hv-black);
    border: 1px solid var(--hv-gray-border);
}

.hv-btn-outline:hover {
    background-color: var(--hv-slate-light);
    border-color: var(--hv-black);
}

.hv-btn-primary {
    background-color: var(--hv-green);
    color: #ffffff !important;
    border: 1px solid var(--hv-green);
}

.hv-btn-primary:hover {
    background-color: var(--hv-green-dark);
    border-color: var(--hv-green-dark);
    box-shadow: 0 4px 12px rgba(56, 180, 73, 0.2);
}

/* Empty Placeholder Card */
.empty-directory-card {
    text-align: center;
    padding: 40px 20px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px dashed var(--hv-gray-border);
    color: #64748b;
}

.empty-directory-card i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.empty-directory-card h5 {
    font-weight: 600;
    color: var(--hv-black);
    margin-bottom: 8px;
}

/* Sticky Leaflet Map Column */
.map-sticky-column {
    flex: 1 1 500px;
    position: relative;
    min-height: 500px;
}

@media (min-width: 992px) {
    .map-sticky-column {
        position: sticky;
        top: 100px;
        height: calc(100vh - 140px);
        max-height: 700px;
    }
}

.map-wrapper {
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--hv-shadow-premium);
    border: 1px solid var(--hv-gray-border);
    display: flex;
    flex-direction: column;
}

#map {
    width: 100%;
    flex-grow: 1;
    z-index: 1; /* Keep leaflet under bootstrap modals if any */
}

/* Map Header (Legend / Quick tools) */
.map-control-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(11, 28, 45, 0.9);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
}

.map-control-overlay h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hv-green);
    margin-bottom: 6px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.legend-color-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background-color: var(--hv-green);
    opacity: 0.5;
    border: 1.5px solid var(--hv-green);
}

.legend-color-box.pulse {
    background-color: var(--hv-green);
    opacity: 1;
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(56, 180, 73, 0.4);
}

/* Custom Glowing Pulse Leaflet Marker */
.custom-pulse-marker {
    background-color: var(--hv-green);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(56, 180, 73, 0.7);
    animation: hvMarkerPulse 1.6s infinite;
}

@keyframes hvMarkerPulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(56, 180, 73, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(56, 180, 73, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(56, 180, 73, 0);
    }
}

/* Custom Tooltip & Popup Style */
.leaflet-tooltip-hv {
    background-color: var(--hv-black) !important;
    border: 1px solid var(--hv-green) !important;
    color: #ffffff !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    padding: 6px 10px !important;
}

.leaflet-tooltip-hv::before {
    border-right-color: var(--hv-black) !important;
}

.leaflet-popup-content-wrapper {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: var(--hv-shadow-premium) !important;
    border: 1px solid var(--hv-gray-border) !important;
    font-family: 'Montserrat', sans-serif !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 15px 18px !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
    border: 1px solid var(--hv-gray-border) !important;
}

/* Popup Content Style */
.hv-popup-title {
    font-weight: 700;
    color: var(--hv-black);
    font-size: 1rem;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--hv-green);
    padding-bottom: 3px;
}

.hv-popup-count {
    color: var(--hv-green-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.hv-popup-agronomist-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--hv-green-dark) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.hv-popup-agronomist-link:hover {
    color: var(--hv-green) !important;
}
