/* Matrix Filters - Dropdown Styles */
.matrix-filter-dropdown {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.dropdown-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dropdown-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-button-date {
    font-size: 14px;
    opacity: 0.9;
}

.dropdown-button-separator {
    margin: 0 8px;
    opacity: 0.6;
    display: none;
    /* Ukryty domyślnie, pokazany przez JS */
}

.dropdown-button-text {
    flex: 1;
    text-align: left;
    margin-left: 8px;
}

.dropdown-button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.matrix-filter-dropdown.show .dropdown-button svg {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white !important;
    min-width: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.matrix-filter-dropdown.show .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333 !important;
    padding: 14px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.dropdown-content a:hover {
    background-color: #f3f4f6 !important;
    border-left-color: #667eea;
}

.dropdown-content a.active {
    background-color: #ede9fe !important;
    border-left-color: #764ba2;
    font-weight: 600;
    color: #764ba2 !important;
}

.dropdown-item-title {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    color: #1f2937 !important;
}

.dropdown-item-description {
    font-size: 12px;
    color: #6b7280 !important;
    display: block;
}

/* Matrix Point States */
.matrix-value-point {
    transition: opacity 0.3s ease, fill 0.3s ease;
}

.matrix-value-point.inactive-point {
    opacity: 0.2;
    fill: #d1d5db !important;
}

#matrix circle {
    transition: opacity 0.3s ease, fill 0.3s ease;
}

#matrix circle.inactive-point {
    opacity: 0.15;
    fill: #e5e7eb !important;
}

/* Matrix Filtered State - removed cls-29 and cls-61 to keep age labels always visible */

/* Icon States */
.faded-icon {
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

/* Chakra Card States (used by matrix-filters.js for SVG filtering) */
.chakra-card {
    cursor: pointer;
    transition: background 0.25s ease;
}

.chakra-card:not(.summary-card):hover {
    background: rgba(255, 255, 255, 0.04);
}

.chakra-card.chakra-active {
    background: rgba(139, 92, 246, 0.1) !important;
}

.chakra-card.summary-card {
    cursor: default;
}

/* Responsive */
@media (max-width: 768px) {
    .matrix-filter-dropdown {
        max-width: 100%;
        margin-bottom: 0.5rem;
    }

    .dropdown-button {
        font-size: 14px;
        padding: 10px 16px;
    }

    .dropdown-content {
        max-height: 300px;
    }
}

/* Smooth scrollbar for dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Tooltip Styles */
.chakra-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chakra-tooltip {
    position: relative;
    display: inline-block;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
}

.chakra-tooltip:hover .help-icon {
    background-color: #7c3aed;
    color: white;
}

.tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: rgba(31, 41, 55, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 50;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.chakra-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(31, 41, 55, 0.95) transparent transparent transparent;
}