﻿
/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Farmer Hunter report styling.
 */


/*
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Farmer hunters map product page styling.
 */

/* Marker pins styled to match legend colors */

.marker-pin-container {
    /* reset default leaflet divIcon styles */
}

.marker-pin {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border: 2px solid #fff;
}

.marker-pin::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    top: 7px;
    left: 7px;
}

.marker-pin--farmer { background: #28a745; }
.marker-pin--hunter { background: #007bff; }
.marker-pin--islander { background: #6c757d; }

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

/* Popup Styling */
.ph-map-popup-root .leaflet-popup-content-wrapper {
    border-radius: 10px;
}

.ph-map-popup {
    max-width: 360px;
}

.ph-map-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ph-type {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    color: #fff;
}
.ph-type--farmer { background: #28a745; }
.ph-type--hunter { background: #007bff; }
.ph-type--islander { background: #6c757d; }

.ph-sample {
    color: #6c757d;
    font-weight: 600;
}

.ph-map-popup-body {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
}

.ph-img-wrap {
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #eee;
}

.ph-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.ph-meta {
    color: #6c757d;
    font-size: 13px;
}

.ph-desc { margin-top: 6px; }

.ph-map-popup-actions { margin-top: 10px; }

/* ProductFarmerHuntersMap.css - Custom map styles for ProductFarmerHunters page */

/* ========================================
   DnaGenics Color Variables
   ======================================== */
:root {
    --dnagenics-teal: #2DD4BF;
    --dnagenics-lime: #84CC16;
    --dnagenics-dark: #0F172A;
    --dnagenics-white: #FFFFFF;
    --dnagenics-teal-light: #E6FFFA;
    --dnagenics-lime-light: #F0FDF4;
}

/* ========================================
   Map Container
   ======================================== */
#map {
    height: 60vh;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.2);
    border: 2px solid var(--dnagenics-teal-light);
    position: relative;
    z-index: 1;
    display: block;
    margin: 0 auto;
}

/* Leaflet pane z-index fixes */
.leaflet-pane {
    z-index: auto !important;
}

.leaflet-popup-pane {
    z-index: 10000 !important;
}

.leaflet-tooltip-pane {
    z-index: 9999 !important;
}

/* Premium Zoom Controls */
.leaflet-control-zoom {
    border: none !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #2c3e50 !important;
    border: none !important;
    font-size: 16px !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background: #28a745 !important;
    color: #ffffff !important;
}

.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
}

.leaflet-control-attribution a {
    color: #28a745 !important;
}

/* ========================================
   Legend Styling
   ======================================== */
.legend {
    max-height: 30vh !important;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 244, 0.95) 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(45, 212, 191, 0.3);
    width: 320px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.legend-category {
    margin-bottom: 20px;
}

.legend-category h5 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: var(--dnagenics-dark);
    border-bottom: 2px solid var(--dnagenics-teal);
    padding-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
    color: var(--dnagenics-dark);
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.legend-item:hover {
    background: linear-gradient(135deg, var(--dnagenics-teal-light), var(--dnagenics-lime-light));
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.2);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(45, 212, 191, 0.3);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Beautiful Earth-Toned Popup Styling
   Matching ProductFarmerHuntersV2 design
   ======================================== */
.leaflet-popup {
    z-index: 10000 !important;
}

.leaflet-popup-content-wrapper {
    background: var(--hg-parchment) !important;
    border-radius: 16px !important;
    box-shadow: var(--hg-shadow-medium) !important;
    border: 1px solid rgba(124, 106, 82, 0.15) !important;
    padding: 0 !important;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 360px !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: var(--hg-parchment) !important;
    border: 1px solid rgba(124, 106, 82, 0.15) !important;
    box-shadow: 0 2px 8px rgba(92, 74, 61, 0.1) !important;
}

.leaflet-popup-close-button {
    color: var(--hg-earth-dark) !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    padding: 8px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 16px !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(124, 106, 82, 0.1) !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.leaflet-popup-close-button:hover {
    background: var(--hg-earth) !important;
    color: white !important;
    transform: scale(1.1) !important;
}

/* ========================================
   Popup Content Structure
   ======================================== */
.hg-popup-content {
    font-family: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    color: var(--hg-charcoal);
    overflow: hidden;
}

.hg-popup-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--hg-earth-light) 0%, var(--hg-forest-light) 100%);
}

.hg-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.hg-popup-image-wrapper:hover .hg-popup-image {
    transform: scale(1.05);
}

.hg-popup-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hg-earth-light) 0%, var(--hg-forest-light) 100%);
    color: var(--hg-earth);
}

.hg-popup-image-placeholder i {
    font-size: 4rem;
    opacity: 0.3;
}

.hg-popup-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hg-popup-body {
    padding: 20px 24px 24px;
    background: var(--hg-parchment);
}

.hg-popup-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--hg-earth-dark);
    margin: 0 0 12px 0;
    line-height: 1.3;
    font-family: 'Source Serif Pro', Georgia, serif;
}

.hg-popup-period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--hg-earth-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--hg-earth-dark);
    font-weight: 500;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hg-popup-period i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.hg-popup-details {
    margin-bottom: 20px;
}

.hg-popup-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(124, 106, 82, 0.1);
    font-size: 0.9rem;
    line-height: 1.6;
}

.hg-popup-detail-row:last-of-type {
    border-bottom: none;
}

.hg-popup-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hg-stone);
    font-weight: 500;
    min-width: 90px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
}

.hg-popup-label i {
    font-size: 0.75rem;
    color: var(--hg-earth);
    width: 14px;
    text-align: center;
}

.hg-popup-value {
    color: var(--hg-charcoal);
    font-weight: 500;
    text-align: right;
    flex: 1;
    font-family: 'Source Serif Pro', Georgia, serif;
}

.hg-popup-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(124, 106, 82, 0.1);
}

.hg-popup-description p {
    margin: 0;
    color: var(--hg-stone);
    font-size: 0.9rem;
    line-height: 1.7;
    font-style: italic;
}

.hg-popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: var(--hg-gradient-earth);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--hg-shadow-soft);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.3px;
}

.hg-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--hg-shadow-medium);
    color: white;
    text-decoration: none;
}

.hg-popup-button i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.hg-popup-button:hover i {
    transform: translateX(2px);
}

/* ========================================
   Responsive Popup
   ======================================== */
@media (max-width: 768px) {
    .leaflet-popup-content {
        width: 320px !important;
    }
    
    .hg-popup-image-wrapper {
        height: 180px;
    }
    
    .hg-popup-title {
        font-size: 1.2rem;
    }
    
    .hg-popup-body {
        padding: 16px 20px 20px;
    }
}

@media (max-width: 480px) {
    .leaflet-popup-content {
        width: 280px !important;
    }
    
    .hg-popup-image-wrapper {
        height: 160px;
    }
}

/* ========================================
   Info Panel
   ======================================== */
.info-panel {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 244, 0.95) 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(45, 212, 191, 0.3);
    z-index: 1000;
    max-width: 350px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(45, 212, 191, 0.2);
}

.info-panel h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--dnagenics-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--dnagenics-teal);
    padding-bottom: 8px;
}

.info-panel p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--dnagenics-dark);
    line-height: 1.5;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-height: 800px) {
    .legend {
        max-height: 20vh;
        width: 280px;
    }
    
    #map {
        height: 50vh;
    }
}

@media (max-width: 768px) {
    #map {
        height: 50vh;
        border-radius: 10px;
    }
    
    .legend {
        width: 280px;
        padding: 15px;
        max-height: 25vh;
    }
    
    .custom-popup .leaflet-popup-content {
        width: 300px !important;
    }
    
    .sample-image-tooltip {
        height: 150px;
    }
    
    .info-panel {
        max-width: 280px;
        padding: 15px;
    }
    
    .view-profile-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .legend {
        width: 250px;
        padding: 12px;
    }
    
    .custom-popup .leaflet-popup-content {
        width: 280px !important;
    }
    
    .sample-image-tooltip {
        height: 120px;
    }
    
    .info-panel {
        max-width: 250px;
        padding: 12px;
    }
}

/* ========================================
   Animation Enhancements
   ======================================== */
.legend-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.legend-item:nth-child(1) { animation-delay: 0.1s; }
.legend-item:nth-child(2) { animation-delay: 0.2s; }
.legend-item:nth-child(3) { animation-delay: 0.3s; }
.legend-item:nth-child(4) { animation-delay: 0.4s; }
.legend-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Scrollbar Styling
   ======================================== */
.legend::-webkit-scrollbar {
    width: 6px;
}

.legend::-webkit-scrollbar-track {
    background: rgba(45, 212, 191, 0.1);
    border-radius: 3px;
}

.legend::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--dnagenics-teal), var(--dnagenics-lime));
    border-radius: 3px;
}

.legend::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--dnagenics-lime), var(--dnagenics-teal));
}

/* ========================================
   RELATED PRODUCTS
   ======================================== */
.fhmap-related-products {
    padding: 60px 0;
    background: #f8f9fa;
}

.fhmap-related-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: #2c3e50;
    margin-bottom: 40px;
    font-weight: 700;
}

.fhmap-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 991px) {
    .fhmap-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .fhmap-related-grid {
        grid-template-columns: 1fr;
    }
}

.fhmap-related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e9ecef;
}

.fhmap-related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.fhmap-related-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #e9ecef;
}

.fhmap-related-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.fhmap-related-content h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.fhmap-related-content p {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

.fhmap-related-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dnagenics-teal);
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s ease;
    margin-top: auto;
}

.fhmap-related-link:hover {
    color: var(--dnagenics-lime);
    text-decoration: underline;
}

.fhmap-related-link i {
    transition: transform 0.2s ease;
}

.fhmap-related-link:hover i {
    transform: translateX(4px);
}
