#metricsWidget {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 350px;
    max-height: 80vh;
    background: #1A1B1B;
    border: 0.5px solid #41ffd2;
    color: #fff;
    z-index: 10000;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
}

#metricsWidget.draggable {
    cursor: grabbing !important;
}

.metrics-header,
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(65, 255, 210, 0.3);
}

.metrics-header h3,
.summary-header h3 {
    margin: 0;
    color: #41ffd2;
    font-size: 18px;
    font-weight: 300;
}

.metrics-header-buttons,
.summary-header-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.close-metrics-btn,
.reset-metrics-position-btn,
.close-summary-btn,
.reset-summary-position-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-metrics-btn,
.close-summary-btn {
    font-size: 24px;
}

.close-metrics-btn:hover,
.reset-metrics-position-btn:hover,
.close-summary-btn:hover,
.reset-summary-position-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #41ffd2;
}

.metrics-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.metrics-category h4 {
    margin: 0 0 10px 0;
    color: #41ffd2;
    font-size: 14px;
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 10px;
}

.metrics-category.komun h4 { color: #19FF00; font-weight: 600; }
.metrics-category.komun .metric-shape { background: #19FF00; }

.metrics-category.even h4 { color: #8068E9; font-weight: 600; }
.metrics-category.even .metric-shape { background: #8068E9; }

.metrics-category.decyz h4 { color: #007AFF; font-weight: 600; }
.metrics-category.decyz .metric-shape { background: #007AFF; }

.metrics-category.bran h4 { color: #FFA300; font-weight: 600; }
.metrics-category.bran .metric-shape { background: #FFA300; }

.category-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: normal;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.metric-item:hover {
    background: rgba(65, 255, 210, 0.1);
    border-color: rgba(65, 255, 210, 0.3);
}

.metric-item.selected {
    background: rgba(65, 255, 210, 0.2);
    border-color: #41ffd2;
}

.metric-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    display: none;
}

.metric-checkbox.checked {
    background: #41ffd2;
    border-color: #41ffd2;
}

.metric-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.metric-name {
    color: #41FFD2;
    font-size: 12px;
    flex: 1;
    font-weight: 200;
}

.metric-shape {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.metric-shape.circle {
    background: #fff;
    border-radius: 50%;
}

.metric-shape.diamond {
    background: #fff;
    transform: rotate(45deg);
}

.metrics-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(65, 255, 210, 0.3);
    background: rgba(0, 0, 0, 0.5);
    display: none;
}

.metrics-summary {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.metrics-summary strong {
    color: #41ffd2;
}

.metric-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #41ffd2;
    border-radius: 6px;
    color: #fff;
    padding: 10px 12px;
    font-size: 13px;
    max-width: 250px;
    z-index: 10005;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(65, 255, 210, 0.3);
}

.metric-tooltip.visible {
    opacity: 1;
}

.metric-tooltip-content {
    line-height: 1.4;
}

#summaryWidget {
    position: absolute;
    top: 50px;
    right: -500px;
    bottom: 100px;
    width: 20%;
    min-width: 280px;
    background: #1A1B1B;
    border: 0.5px solid #41ffd2;
    color: #fff;
    box-sizing: border-box;
    transition: right 0.5s ease;
    z-index: 10001;
    user-select: none;
    display: flex;
    flex-direction: column;
}

#summaryWidget.visible {
    right: 50px;
}

#summaryWidget .summary-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#summaryWidget .drag-hint {
    display: none;
}

.summary-category-header {
    margin: 20px 0 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(65, 255, 210, 0.3);
}

.summary-category-header h4 {
    margin: 0;
    color: #41ffd2;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.summary-category-header:first-of-type {
    margin-top: 10px;
}

#summaryWidget .summary-category-header.komun h4 { color: #19FF00; font-weight: 600; }
#summaryWidget .summary-category-header.even h4 { color: #8068E9; font-weight: 600; }
#summaryWidget .summary-category-header.decyz h4 { color: #007AFF; font-weight: 600; }
#summaryWidget .summary-category-header.bran h4 { color: #FFA300; font-weight: 600; }

#summaryWidget .summaryItem {
    display: grid;
    grid-template-columns: 14px 1fr;
    grid-auto-rows: auto;
    align-items: start;
    gap: 10px;
    margin-bottom: 12px;
}

#summaryWidget .summaryItem .metric-shape {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

#summaryWidget .summaryItem .metric-shape.circle {
    background: #fff;
    border-radius: 50%;
}

#summaryWidget .summaryItem .metric-shape.diamond {
    background: #fff;
    transform: rotate(45deg);
}

#summaryWidget .summaryItem.komun .metric-shape { background: #19FF00; }
#summaryWidget .summaryItem.even .metric-shape { background: #8068E9; }
#summaryWidget .summaryItem.decyz .metric-shape { background: #007AFF; }
#summaryWidget .summaryItem.bran .metric-shape { background: #FFA300; }

#summaryWidget .summaryItem .metric-headline {
    grid-column: 2;
    font-weight: 700;
    line-height: 1.25;
}

#summaryWidget .summaryItem .metric-desc {
    grid-column: 2;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    line-height: 1.4;
}

#summaryWidget .summary-content .export-map-btn,
#summaryWidget .summary-content .save-map-btn {
    display: block;
    margin-top: 15px;
}

#summaryWidget .summary-content .export-map-btn:first-of-type {
    margin-top: 25px;
    padding-top: 15px;
}

.export-map-btn,
.save-map-btn {
    background: rgba(65, 255, 210, 0.1);
    border: 1px solid #41ffd2;
    color: #fff;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.export-map-btn span,
.save-map-btn span {
    position: relative;
    z-index: 2;
}

.export-map-btn::after,
.save-map-btn::after {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #41ffd2;
    transition: all 0.3s ease;
    z-index: 1;
}

.export-map-btn:hover::after,
.save-map-btn:hover::after {
    width: 100%;
}

.export-map-btn:hover,
.save-map-btn:hover {
    color: #000;
    border-color: #41ffd2;
}
