/* Portfolio Heatmap Component Styles */
.portfolio-heatmap-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #f3f4f6;
}

.heatmap-header h3 {
    font-weight: 600;
    margin-bottom: 16px;
    color: #1f2937;
    letter-spacing: -0.025em;
}

.heatmap-controls {
    margin-bottom: 15px;
}

.heatmap-controls select {
    padding: 10px 16px;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    min-width: 200px;
    font-weight: 400;
    transition: all 0.2s ease;
}

.heatmap-controls select:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.heatmap-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #6b7280;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.heatmap-visualization {
    min-height: 500px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

/* Tooltip styles */
.heatmap-tooltip {
    position: absolute;
    padding: 12px 16px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 8px;
    pointer-events: none;
    font-weight: 500;
    line-height: 1.4;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* SVG text styles */
.category-label {
    fill: #6b7280;
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none !important;
}

.category-label:hover {
    fill: #1f2937;
}

.symbol-label {
    fill: #ffffff;
    pointer-events: none;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.value-label {
    fill: #ffffff;
    pointer-events: none;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .heatmap-legend {
        gap: 12px;
    }
    

    .legend-color {
        width: 16px;
        height: 16px;
        border-radius: 4px;
    }
    

    .heatmap-controls select {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
    }
    
    .heatmap-visualization {
        min-height: 400px;
    }
}

@media (max-width: 576px) {
    .portfolio-heatmap-container {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .heatmap-legend {
        gap: 8px;
        justify-content: center;
    }
    
    .heatmap-visualization {
        min-height: 350px;
        border-radius: 6px;
    }
    
    .heatmap-header {
        margin-bottom: 16px;
        text-align: center;
    }
    
    .heatmap-header h3 {
        margin-bottom: 12px;
    }
}

/* Dark theme support */
[data-bs-theme="dark"] .portfolio-heatmap-container {
    background: var(--bs-dark, #212529);
    color: var(--bs-light, #f8f9fa);
}

[data-bs-theme="dark"] .heatmap-controls select {
    background: var(--bs-dark, #212529);
    color: var(--bs-light, #f8f9fa);
    border-color: var(--bs-secondary, #6c757d);
}

/* Loading state */
.heatmap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    flex-direction: column;
    gap: 15px;
}

.heatmap-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bs-secondary, #6c757d);
    border-top: 4px solid var(--bs-primary, #0d6efd);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.heatmap-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    flex-direction: column;
    gap: 15px;
    color: var(--color-red, #dc3545);
    font-family: 'Mulish', sans-serif;
    font-weight: 400;
}

.heatmap-error .error-icon {
    font-size: 48px;
}

/* Enhanced interactions */
.portfolio-heatmap-container .heatmap-visualization svg rect {
    transition: all 0.15s ease;
}

.portfolio-heatmap-container .heatmap-visualization svg g.leaf rect:hover {
    filter: brightness(1.05) saturate(1.1);
    stroke-width: 2;
    stroke: #dee2e6;
}

/* Loading state improvements */
.heatmap-loading {
    color: var(--color-dark, #6b7280);
    font-weight: 400;
}

/* Improved responsive breakpoints */
@media (max-width: 1200px) {
    .heatmap-visualization {
        min-height: 450px;
    }
    
    .heatmap-legend {
        gap: 16px;
    }
}

@media (max-width: 992px) {
    .portfolio-heatmap-container {
        padding: 20px;
    }

}
