/**
 * Ecosystem Graph with ECharts - Styles
 */

.ecosystem-graph-container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ecosystem-graph-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.ecosystem-graph-loader p {
    font-size: 16px;
    color: #666;
    direction: rtl;
}

/* Tooltip styling */
.echarts-tooltip {
    direction: rtl;
    text-align: right;
}

/* Legend styling for RTL */
.ecosystem-graph-container .echarts-legend {
    direction: rtl;
}

/* بهبود نمایش تصاویر در گراف */
.ecosystem-graph-container canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Responsive */
@media (max-width: 768px) {
    .ecosystem-graph-container {
        height: 600px !important;
    }
}

/* Filter panel */
.ecosystem-filter-panel {
    direction: rtl;
    max-height: 100%;
    overflow-y: auto;
}

.ecosystem-filter-panel h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.filter-category-item {
    margin-bottom: 15px;
}

.filter-category-item > label {
    font-weight: 600;
    color: #333;
}

.filter-subcategory-list {
    margin-right: 25px;
    margin-top: 8px;
}

.filter-subcategory-list label {
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.ecosystem-filter-panel input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5470c6;
}

.ecosystem-graph-wrapper {
    position: relative;
    direction: rtl;
}

.ecosystem-filter-toggle-btn {
    transition: background 0.3s ease;
}

.ecosystem-filter-toggle-btn:hover {
    background: #4164c0 !important;
}

.ecosystem-filter-panel {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.ecosystem-filter-panel::-webkit-scrollbar {
    width: 6px;
}

.ecosystem-filter-panel::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.ecosystem-filter-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ecosystem-filter-panel::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.ecosystem-filter-panel.show {
    display: block;
}

.ecosystem-filter-item {
    margin-bottom: 10px;
}

.ecosystem-filter-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.ecosystem-filter-item input[type="checkbox"] {
    margin-left: 8px;
}

.ecosystem-filter-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #5470c6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1001;
    font-size: 14px;
}

.ecosystem-filter-toggle:hover {
    background: #4164c0;
}

/* استایل برای business nodes با دایره بکگراند */
.ecosystem-graph-container .business-node-background {
    fill: #ffffff;
    stroke-width: 2px;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.2));
}

/* بهبود نمایش tooltip */
.ecosystem-graph-container .echarts-tooltip {
    font-family: Tahoma, Arial, sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
}

/* استایل برای business nodes - اضافه کردن دایره بکگراند با CSS */
.ecosystem-graph-container canvas {
    position: relative;
}

/* استفاده از SVG overlay برای اضافه کردن دایره بکگراند */
.ecosystem-graph-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

