/* Public Map Styles */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#public-map {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Map Title Label - Top Center (white Leaflet-style label) */
.map-title-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile: smaller title */
@media (max-width: 576px) {
    .map-title-label {
        top: 8px;
        padding: 4px 8px;
        font-size: 11px;
        max-width: calc(100vw - 20px);
    }
}

/* Legend Overlay */
.legend-overlay {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 250px;
}

.legend-overlay h6 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color-box {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border: 1px solid #999;
    border-radius: 3px;
}

.legend-marker {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-label {
    font-size: 13px;
    color: #555;
}

/* Watermark */
.watermark {
    position: absolute;
    bottom: 10px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

/* geoDB.io Logo - Top Right */
.geodb-logo-container {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.geodb-logo-container:hover {
    transform: translateY(2px);
    filter: drop-shadow(0 4px 8px rgba(38, 166, 154, 0.4));
}

.geodb-logo-container a {
    display: block;
    line-height: 0;
}

.geodb-logo {
    height: 48px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ============================================================================
   Public Map Sidebar - Collapsible Info Panel
   ============================================================================ */

.public-map-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.public-map-sidebar.collapsed {
    transform: translateX(-100%);
}

/* Toggle Button */
.public-map-sidebar .sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    right: -32px;
    transform: translateY(-50%);
    width: 32px;
    height: 48px;
    background: rgba(30, 30, 30, 0.95);
    border: none;
    border-radius: 0 8px 8px 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.public-map-sidebar .sidebar-toggle-btn:hover {
    background: rgba(50, 50, 50, 0.95);
}

/* Sidebar Header */
.public-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.public-sidebar-header .map-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4ECDC4;
}

.public-sidebar-header .map-description {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Sidebar Content */
.public-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Sections */
.public-sidebar-content .sidebar-section {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.public-sidebar-content .section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Info Items */
.info-item {
    margin-bottom: 10px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.info-label i {
    margin-right: 6px;
}

.info-value {
    font-size: 0.9rem;
    color: #fff;
}

/* Layer Groups */
.layer-group {
    margin-bottom: 15px;
}

.layer-group:last-child {
    margin-bottom: 0;
}

.layer-group-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

/* Basemap Options */
.basemap-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.basemap-option {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.basemap-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.basemap-option input[type="radio"] {
    margin: 0 10px 0 0;
    accent-color: #4ECDC4;
}

.basemap-option span {
    font-size: 0.85rem;
    color: #ccc;
}

/* Layer Toggle Items */
.layer-toggle-item {
    padding: 6px 0;
}

.layer-toggle-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.layer-toggle-item input[type="checkbox"] {
    margin: 0 10px 0 0;
    accent-color: #4ECDC4;
}

.layer-toggle-item span {
    font-size: 0.85rem;
    color: #ccc;
}

/* Legend */
#public-legend-content .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

#public-legend-content .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

#public-legend-content .legend-label {
    font-size: 0.8rem;
    color: #ccc;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4ECDC4;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

/* Sidebar Footer */
.public-sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.geodb-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    transition: color 0.2s;
}

.geodb-link:hover {
    color: #4ECDC4;
}

.geodb-link .footer-logo {
    height: 20px;
    width: auto;
}

/* Scrollbar */
.public-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.public-sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.public-sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.3);
    border-radius: 3px;
}

.public-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.5);
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .public-map-sidebar {
        width: 100%;
        max-width: 280px;
    }

    .public-map-sidebar.collapsed {
        transform: translateX(-100%);
    }
}

/* ============================================================================
   Public Map Legends Wrapper (Collapsible)
   ============================================================================ */

.public-legends-wrapper {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    max-width: 300px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: none;  /* Hidden until legends are added */
}

.public-legends-wrapper.show {
    display: block;
}

.public-legends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(78, 205, 196, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    user-select: none;
}

.public-legends-header:hover {
    background: rgba(78, 205, 196, 0.25);
}

.public-legends-title {
    color: #4ECDC4;
    font-weight: 600;
    font-size: 0.9rem;
}

.public-legends-title i {
    margin-right: 8px;
}

.public-legends-chevron {
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

/* Legend body */
.public-legends-body {
    padding: 0;
    max-height: 350px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Collapsed state */
.public-legends-wrapper.collapsed .public-legends-body {
    display: none;
}

.public-legends-wrapper.collapsed .public-legends-chevron {
    transform: rotate(180deg);
}

.public-legends-wrapper.collapsed .public-legends-header {
    border-bottom: none;
}

/* Legends container inside body */
#public-legends-container {
    padding: 0;
}

.public-legend {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 15px;
    margin-bottom: 0;
    box-shadow: none;
    pointer-events: auto;
    min-width: auto;
    max-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.public-legend:last-child {
    border-bottom: none;
}

.public-legend-header {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.public-legend-element {
    color: #e0e0e0;
    font-size: 11px;
    margin-bottom: 6px;
}

.public-legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.public-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-legend-symbol {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.public-legend-symbol.square {
    border-radius: 2px;
}

.public-legend-symbol.triangle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid;
    border-radius: 0;
    background-color: transparent !important;
}

.public-legend-symbol.diamond {
    transform: rotate(45deg);
    border-radius: 2px;
}

.public-legend-symbol.star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border-radius: 0;
}

.public-legend-label {
    color: #fff;
    font-size: 11px;
    flex: 1;
}

/* Drill Assay Legend - line symbol for trace segments */
.drill-assay-legend .public-legend-header {
    border-bottom-color: rgba(78, 205, 196, 0.4);
}

.public-drill-legend-line {
    width: 20px;
    height: 4px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* Mobile Responsiveness for Legends */
@media (max-width: 576px) {
    .public-legends-wrapper {
        bottom: 15px;
        left: 10px;
        max-width: calc(100vw - 20px);
    }

    .public-legend {
        min-width: auto;
        max-width: none;
    }
}

/* ============================================================================
   Company Map - Project Pin Icons
   ============================================================================ */

.project-pin-icon {
    /* Remove default leaflet marker styles */
    background: none !important;
    border: none !important;
}

.project-pin-icon .marker-label {
    pointer-events: none;
}

/* Hover effect on project pins */
.project-pin-icon:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.project-pin-icon svg {
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}
