/* Map layout */
.map-wrapper {
    display: flex;
    height: calc(100vh - 160px);
    width: 100%;
    position: relative;
    background: #f5f5f5;
}

.main-content {
    padding: 0;
    margin: 0;
}

#map {
    flex: 1;
    z-index: 1;
}

.leaflet-container {
    background: #e8f4f8;
}

/* Basemap list */
.basemap-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.basemap-option {
    padding: 10px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
}

.basemap-option:hover {
    background: #f9f9f9;
    border-color: var(--accent-blue);
}

.basemap-option.active {
    background: #e8f4f8;
    border-color: var(--accent-blue);
    font-weight: 600;
    color: var(--accent-blue);
}

/* Sidebar layout */
.map-sidebar {
    width: 320px;
    background: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
    z-index: 300;
}

/* Tabs */
.tab-menu {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}

.tab-button {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #f0f0f0;
}

.tab-button.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: white;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.placeholder-content {
    padding: 20px 0;
    text-align: center;
    color: #999;
    font-size: 13px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
}

.muted-note {
    font-size: 11px;
    color: #bbb;
}

/* Chart controls */
.chart-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.chart-control-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.chart-control-group select:hover {
    border-color: var(--accent-blue);
}

.chart-button,
.chart-config-button {
    padding: 10px 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
}

.chart-button:hover,
.chart-config-button:hover {
    background: var(--accent-blue-dark);
}

.chart-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Floating chart card */
.floating-chart-card {
    position: absolute;
    left: 50px;
    top: 10%;
    width: 350px;
    height: 80%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 250;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.floating-chart-card.collapsed {
    position: absolute;
    bottom: 20px;
    left: 20px;
    top: auto;
    width: 200px;
    height: auto;
    border-radius: 6px;
}

.floating-chart-card.collapsed .chart-card-header {
    border-radius: 6px;
    border-bottom: none;
}

.floating-chart-card.collapsed .chart-card-content,
.floating-chart-card.collapsed .chart-filters-info,
.floating-chart-card.collapsed .chart-card-subheader {
    display: none;
}

.floating-chart-card.hidden {
    display: none;
}

.chart-card-header {
    padding: 12px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 7px 7px 0 0;
}

.chart-card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.chart-card-subheader {
    padding: 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.chart-card-subheader h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.chart-card-controls {
    display: flex;
    gap: 6px;
}

.chart-card-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    color: #666;
    transition: all 0.2s;
}

.chart-card-btn:hover {
    color: var(--accent-blue);
}

.chart-filters-info {
    padding: 8px 12px;
    background: #f0f5ff;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
}

.chart-filters-info strong {
    color: #333;
    display: block;
    margin-bottom: 4px;
}

.chart-filters-item {
    margin: 3px 0;
    padding-left: 8px;
    border-left: 2px solid var(--accent-blue);
}

.filter-link {
    color: var(--accent-blue);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-link:hover {
    color: var(--accent-blue-dark);
    text-decoration: none;
}

.chart-card-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    margin-bottom: 12px;
    flex: 1;
}

.chart-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

.chart-nav-btn {
    background: none;
    border: 1px solid #ddd;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.2s;
}

.chart-nav-btn:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.chart-nav-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Filter modal */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.filter-modal.is-hidden {
    display: none;
}

.filter-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.filter-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
}

.filter-modal-close:hover {
    color: #333;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.filter-control {
    margin-bottom: 10px;
    font-size: 13px;
}

.filter-control label {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    cursor: pointer;
    gap: 8px;
}

.filter-control input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.filter-control input[type="number"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.filter-control select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.filter-select.narrow {
    margin-left: 10px;
    min-width: 150px;
}

.filter-number {
    width: 80px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 5px;
}

.filter-separator {
    margin: 0 5px;
}

.filter-hint {
    font-size: 11px;
    color: #999;
    margin-left: 5px;
}

.filter-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.filter-action {
    flex: 1;
    padding: 10px 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-action:hover {
    background: var(--accent-blue-dark);
}

.filter-cancel {
    flex: 1;
    padding: 10px 12px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.filter-cancel:hover {
    background: #e0e0e0;
}

.bounding-box-inputs {
    margin-top: 8px;
    margin-left: 20px;
    display: none;
}

.bounding-box-inputs .form-field {
    margin-bottom: 8px;
}

.bounding-box-inputs label {
    display: block;
    margin-bottom: 4px;
}

.bounding-box-inputs input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* =============================================
   EXPANDABLE FILTER PANEL
   ============================================= */

.filter-panel {
    position: absolute;
    top: 10px;
    right: 330px;
    z-index: 500;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: width 0.2s ease;
    width: auto;
}

/* Header - always visible */
.filter-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: white;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}

.filter-panel-header:hover {
    background: #f5f5f5;
}

.filter-panel.expanded .filter-panel-header {
    border-bottom-color: #e0e0e0;
    background: #fafafa;
}

.filter-panel-header .material-icons:first-child {
    font-size: 20px;
    color: var(--accent-blue);
}

.filter-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.filter-badge {
    min-width: 18px;
    height: 18px;
    background: #e53935;
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: 4px;
}

.filter-badge.visible {
    display: flex;
}

.expand-arrow {
    font-size: 20px;
    color: #888;
    margin-left: auto;
    transition: transform 0.2s;
}

.filter-panel.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* Content - expandable */
.filter-panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    width: 0;
    padding: 0;
}

.filter-panel.expanded .filter-panel-content {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    width: 300px;
}

.filter-panel .filter-section {
    border-bottom: 1px solid #eee;
}

.filter-panel .filter-section:last-of-type {
    border-bottom: none;
}

/* Collapsible section header */
.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.filter-section-header:hover {
    background: #f5f5f5;
}

.filter-panel .filter-section h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-arrow {
    font-size: 18px;
    color: #999;
    transition: transform 0.2s;
}

.filter-section.expanded .section-arrow {
    transform: rotate(180deg);
}

/* Collapsible section body */
.filter-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    padding: 0 16px;
}

.filter-section.expanded .filter-section-body {
    max-height: 300px;
    padding: 0 16px 12px 16px;
}

.filter-panel .filter-control {
    margin-bottom: 4px;
}

.filter-panel .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.filter-panel .radio-label input[type="radio"] {
    margin: 0;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.filter-panel .filter-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 6px;
    background: white;
}

.filter-panel .filter-number {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-panel .year-range-inputs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 23px;
    margin-top: 2px;
}

.filter-panel .year-range-inputs span {
    color: #888;
    font-size: 12px;
}

.filter-panel .filter-hint {
    display: block;
    font-size: 11px;
    color: #999;
    margin-left: 23px;
    margin-top: 1px;
}

.filter-panel .bounding-box-inputs {
    margin: 8px 0 0 23px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
    display: none;
}

.filter-panel .bbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.filter-panel .bbox-row:last-child {
    margin-bottom: 0;
}

.filter-panel .bbox-row label {
    width: 18px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.filter-panel .bbox-row input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* Footer buttons */
.filter-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.filter-panel-footer .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.filter-panel-footer .btn .material-icons {
    font-size: 16px;
}

.filter-panel-footer .btn-primary {
    background: var(--accent-blue);
    color: white;
}

.filter-panel-footer .btn-primary:hover {
    background: var(--accent-blue-dark, #1565c0);
}

.filter-panel-footer .btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.filter-panel-footer .btn-secondary:hover {
    background: #ddd;
}

/* =============================================
   LAYERS PANEL
   ============================================= */

.layers-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

.layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f8f8;
    cursor: pointer;
    user-select: none;
}

.layer-header:hover {
    background: #f0f0f0;
}

.layer-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.layer-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.layer-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-count {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}

.layer-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.layer-visibility-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-visibility-btn:hover {
    background: rgba(0,0,0,0.08);
}

.layer-visibility-btn .material-icons {
    font-size: 18px;
    color: #555;
}

.expand-icon {
    font-size: 20px;
    color: #888;
}

.layer-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.layer-body.expanded {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #eee;
}

.layer-body-content {
    padding: 12px;
}

.layer-description {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.layer-opacity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.layer-opacity-control label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.layer-opacity-control input[type="range"] {
    flex: 1;
    height: 4px;
    cursor: pointer;
}

.layer-opacity-control span {
    font-size: 11px;
    color: #666;
    min-width: 32px;
    text-align: right;
}

.granules-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.granules-header > span {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    flex: 1;
}

.toggle-all-btn {
    padding: 3px 8px;
    font-size: 10px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    color: #555;
}

.toggle-all-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.granules-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}

.granule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.granule-checkbox {
    display: flex;
    align-items: center;
}

.granule-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.granule-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    min-width: 0;
}

.granule-year {
    font-weight: 600;
    color: var(--accent-blue);
    background: #e3f2fd;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.granule-title {
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.granule-count {
    color: #888;
    font-size: 10px;
    flex-shrink: 0;
}

.no-granules {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: #888;
}

.loading-placeholder p {
    margin: 0;
    font-size: 12px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Basemap option icons */
.basemap-option .material-icons {
    font-size: 18px;
    color: #666;
}

.basemap-option.active .material-icons {
    color: var(--accent-blue);
}

/* =============================================
   CUSTOM LAYERS (Events & Projects)
   ============================================= */

.custom-layer-card {
    border: 2px solid #e0e0e0;
}

.custom-layer-card .layer-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Events layer color indicator */
.layer-color.events-color {
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
}

/* Projects layer color indicator */
.layer-color.projects-color {
    background: linear-gradient(135deg, #26A69A 0%, #66BB6A 100%);
}

/* Layer description */
.layer-description {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Custom layer filters */
.custom-layer-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.custom-layer-filters .filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-layer-filters .filter-row label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    min-width: 60px;
}

.custom-layer-filters .filter-row select {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.custom-layer-filters .filter-row select:hover {
    border-color: var(--accent-blue);
}

/* Custom layer legend */
.custom-layer-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #666;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* =============================================
   EVENT MARKERS
   ============================================= */

.event-marker {
    background: transparent;
    border: none;
}

.event-marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    border: 3px solid white;
    position: relative;
}

.event-marker-pin .material-icons {
    transform: rotate(45deg);
    color: white;
    font-size: 18px;
}

.event-marker-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* Featured event marker glow */
.event-marker.featured .event-marker-pin {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.4), 0 3px 10px rgba(0,0,0,0.3);
}

/* =============================================
   PROJECT MARKERS
   ============================================= */

.project-marker {
    background: transparent;
    border: none;
}

.project-marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    border: 3px solid white;
    position: relative;
}

.project-marker-pin .material-icons {
    transform: rotate(45deg);
    color: white;
    font-size: 18px;
}

.project-marker-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* Featured project marker glow */
.project-marker.featured .project-marker-pin {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.4), 0 3px 10px rgba(0,0,0,0.3);
}

/* =============================================
   PREVIEW CARD POPUPS
   ============================================= */

.preview-card-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.preview-card-popup .leaflet-popup-content {
    margin: 0;
    width: 300px !important;
}

.preview-card-popup .leaflet-popup-tip {
    background: white;
}

.map-preview-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.preview-card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-card-content {
    padding: 14px;
}

.preview-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.preview-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Status badges */
.preview-card-badge.status-upcoming {
    background: #E8F5E9;
    color: #2E7D32;
}

.preview-card-badge.status-ongoing {
    background: #E3F2FD;
    color: #1565C0;
}

.preview-card-badge.status-completed {
    background: #F5F5F5;
    color: #616161;
}

.preview-card-badge.status-cancelled {
    background: #FFEBEE;
    color: #C62828;
}

.preview-card-badge.status-planning {
    background: #FFF3E0;
    color: #E65100;
}

.preview-card-badge.status-active {
    background: #E8F5E9;
    color: #2E7D32;
}

.preview-card-badge.status-suspended {
    background: #FFF8E1;
    color: #F9A825;
}

/* Category badges */
.preview-card-badge.category-green-grey {
    background: #E0F2F1;
    color: #00796B;
}

.preview-card-badge.category-plantation {
    background: #E8F5E9;
    color: #388E3C;
}

.preview-card-badge.featured {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.preview-card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
}

.preview-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #666;
}

.preview-card-meta .material-icons {
    font-size: 16px;
    color: #888;
}

.preview-card-desc {
    margin: 10px 0;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preview-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 16px;
    background: var(--primary-color, #2D7D6E);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    border: 2px solid var(--primary-color, #2D7D6E);
    transition: all 0.2s ease;
}

.preview-card-link:hover {
    background: var(--secondary-color, #3A9D8C);
    border-color: var(--secondary-color, #3A9D8C);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 125, 110, 0.3);
}

.preview-card-link .material-icons {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.preview-card-link:hover .material-icons {
    transform: translateX(3px);
}

/* Event-specific preview card */
.event-preview-card .preview-card-image {
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
}

/* Project-specific preview card */
.project-preview-card .preview-card-image {
    background: linear-gradient(135deg, #26A69A 0%, #66BB6A 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .map-sidebar {
        width: 250px;
    }

    .floating-chart-card {
        width: 300px;
        left: 45px;
        top: 10%;
        height: 80%;
    }

    .filter-panel {
        right: 260px;
    }

    .filter-panel.expanded .filter-panel-content {
        width: 260px;
    }
}

@media (max-width: 600px) {
    .map-wrapper {
        flex-direction: column;
    }

    .map-sidebar {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid #ddd;
    }

    .floating-chart-card {
        width: 100%;
        left: 0;
        right: 0;
        top: auto;
        bottom: 210px;
        border-radius: 0;
        max-height: 200px;
    }

    .filter-panel {
        top: 10px;
        right: 10px;
        left: auto;
    }

    .filter-panel.expanded {
        left: 10px;
        right: 10px;
    }

    .filter-panel-content {
        width: auto;
    }

    .filter-panel.expanded .filter-panel-content {
        max-height: 50vh;
    }
}
