/* ============================================================================
   DASHBOARD STYLES - DataSpur V2
   Tree View, Filters, and Query Interface
   ============================================================================ */

/* Layout */
.dashboard-layout {
    display: flex;
    gap: 16px;
    padding: 16px;
    padding-left: 8px;
    padding-top: 80px;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* Filter Sidebar */
.filter-sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    flex: 1;
}

.filter-header .material-symbols-outlined {
    color: rgba(var(--rgb-sunflower-gold), 1);
}

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

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.filter-label .material-symbols-outlined {
    font-size: 18px;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: rgba(var(--rgb-sunflower-gold), 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
    cursor: pointer;
}

.filter-checkbox-label {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.filter-checkbox-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.filter-loading {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 10px;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-inputs .filter-input {
    flex: 1;
    font-size: 0.8rem;
    padding: 8px 10px;
}

.date-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.stat-item .material-symbols-outlined {
    font-size: 28px;
    color: rgba(var(--rgb-sunflower-gold), 0.8);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tree Header */
.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.tree-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tree-header-left h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.tree-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.tree-header-right {
    display: flex;
    gap: 10px;
}

/* Tree Container */
.tree-container {
    padding: 20px;
    min-height: 300px;
}

.tree-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

.tree-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.tree-empty .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Tree Structure */
.tree-source {
    margin-bottom: 15px;
}

.tree-source-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tree-source-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tree-expand-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
}

.tree-source.expanded .tree-expand-icon {
    transform: rotate(90deg);
}

.tree-source-icon {
    font-size: 22px;
}

.tree-source-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.tree-source-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.tree-source-checkbox {
    width: 18px;
    height: 18px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
    cursor: pointer;
}

.tree-source-content {
    display: none;
    padding-left: 25px;
    margin-top: 5px;
}

.tree-source.expanded .tree-source-content {
    display: block;
}

/* Tree Section */
.tree-section {
    margin-bottom: 8px;
}

.tree-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.tree-section-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tree-section-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.tree-section-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.tree-section-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.tree-section-checkbox {
    width: 16px;
    height: 16px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
    cursor: pointer;
}

.tree-section-content {
    display: none;
    padding-left: 20px;
    margin-top: 5px;
}

.tree-section.expanded .tree-section-content {
    display: block;
}

/* Tree Report */
.tree-report {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 5px;
    margin-left: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tree-report:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.tree-report.selected {
    background: rgba(var(--rgb-sunflower-gold), 0.1);
    border-color: rgba(var(--rgb-sunflower-gold), 0.3);
}

.tree-report-checkbox {
    width: 16px;
    height: 16px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
    cursor: pointer;
    margin-top: 2px;
}

.tree-report-icon {
    font-size: 20px;
    color: rgba(var(--rgb-sunflower-gold), 0.8);
    margin-top: 2px;
}

.tree-report-info {
    flex: 1;
}

.tree-report-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}

.tree-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.tree-report-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tree-report-meta .material-symbols-outlined {
    font-size: 14px;
}

.tree-report-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.tree-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(var(--rgb-sunflower-gold), 0.15);
    color: rgba(var(--rgb-sunflower-gold), 1);
    border-radius: 10px;
}

/* Selection Bar */
.selection-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 25px;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(var(--rgb-sunflower-gold), 1);
    font-weight: 500;
}

.selection-actions {
    display: flex;
    gap: 10px;
}

/* Query Modal */
.modal-lg {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.query-selected-reports {
    margin-bottom: 20px;
}

.query-selected-reports label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    display: block;
}

.selected-reports-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-report-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(var(--rgb-sunflower-gold), 0.15);
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(var(--rgb-sunflower-gold), 1);
}

.selected-report-chip .material-symbols-outlined {
    font-size: 16px;
}

.query-input-section {
    margin-bottom: 20px;
}

.query-input-section label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    display: block;
}

.query-input-section textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.query-input-section textarea:focus {
    outline: none;
    border-color: rgba(var(--rgb-sunflower-gold), 0.5);
}

.query-input-section textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.query-examples {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.query-examples span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.example-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.query-submit {
    text-align: center;
    margin-bottom: 25px;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 1rem;
}

/* Results Section */
.query-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.results-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: #fff;
    margin: 0;
}

.results-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
}

.results-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.results-table td {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.results-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* AI Insights */
.ai-insights {
    padding: 15px;
    background: rgba(var(--rgb-sunflower-gold), 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
}

.ai-insights h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(var(--rgb-sunflower-gold), 1);
    margin: 0 0 10px 0;
}

.ai-insights p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
}

/* SQL Details */
.sql-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.sql-details summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.sql-details summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sql-details pre {
    margin: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: pre-wrap;
}

.sql-details .btn {
    margin: 10px 15px 15px;
}

/* Loading & Error States */
.query-loading,
.query-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
}

.query-loading {
    color: rgba(255, 255, 255, 0.6);
}

.query-error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
}

/* Button Styles */
.btn-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(var(--rgb-sunflower-gold), 1);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .filter-sidebar {
        width: 100%;
        position: static;
    }

    .stats-bar {
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        padding: 10px;
        padding-top: 70px;
    }

    .tree-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .tree-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .selection-bar {
        flex-direction: column;
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
    }

    .stat-item {
        flex: 1 1 100%;
    }

    .tree-report {
        margin-left: 5px;
    }

    .modal-lg {
        max-height: 95vh;
    }
}

/* Spinning Animation */
.spinning {
    animation: spin 1s linear infinite;
}

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

/* Custom Scrollbar for Filter Panels */
.filter-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.filter-checkboxes::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.filter-checkboxes::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.filter-checkboxes::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   PHASE 2: VIEW MODE TOGGLE
   ============================================================================ */

.tree-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.view-mode-btn.active {
    background: rgba(var(--rgb-sunflower-gold), 0.2);
    color: rgba(var(--rgb-sunflower-gold), 1);
}

.view-mode-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================================================
   PHASE 2: GRID VIEW
   ============================================================================ */

.grid-container {
    padding: 20px;
    min-height: 300px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.report-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.report-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.report-card.selected {
    background: rgba(var(--rgb-sunflower-gold), 0.1);
    border-color: rgba(var(--rgb-sunflower-gold), 0.4);
}

.report-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.report-card-checkbox {
    width: 18px;
    height: 18px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.report-card-icon {
    font-size: 24px;
    color: rgba(var(--rgb-sunflower-gold), 0.8);
    flex-shrink: 0;
}

.report-card-title {
    flex: 1;
}

.report-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.report-card-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.report-card-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.report-card-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.report-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.report-card-stat .material-symbols-outlined {
    font-size: 16px;
}

.report-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.report-card-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(var(--rgb-sunflower-gold), 0.15);
    color: rgba(var(--rgb-sunflower-gold), 1);
    border-radius: 10px;
}

.report-card-columns {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-card-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.report-card-date .material-symbols-outlined {
    font-size: 14px;
}

/* ============================================================================
   PHASE 2: SAVED FILTERS
   ============================================================================ */

.saved-filters-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saved-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-filter-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.saved-filter-item.active {
    background: rgba(var(--rgb-sunflower-gold), 0.15);
    border: 1px solid rgba(var(--rgb-sunflower-gold), 0.3);
}

.saved-filter-icon {
    font-size: 18px;
    color: rgba(var(--rgb-sunflower-gold), 0.7);
}

.saved-filter-name {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-filter-delete {
    opacity: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.saved-filter-item:hover .saved-filter-delete {
    opacity: 1;
}

.saved-filter-delete:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

.saved-filters-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 15px 10px;
}

.btn-full-width {
    width: 100%;
    justify-content: center;
}

/* Save Filter Modal */
.save-filter-modal {
    padding: 20px;
}

.save-filter-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.save-filter-input:focus {
    outline: none;
    border-color: rgba(var(--rgb-sunflower-gold), 0.5);
}

.save-filter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================================================
   RESPONSIVE UPDATES FOR PHASE 2
   ============================================================================ */

@media (max-width: 1024px) {
    .tree-header {
        flex-wrap: wrap;
    }

    .tree-header-center {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }

    .report-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .view-mode-toggle {
        width: 100%;
    }

    .view-mode-btn {
        flex: 1;
        justify-content: center;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .report-card-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================================================
   NETWORK GRAPH STYLES (Phase 3)
   ============================================================================ */

/* Graph Container */
#networkContainer {
    width: 100%;
    height: 600px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.network-graph-svg {
    cursor: grab;
}

.network-graph-svg:active {
    cursor: grabbing;
}

/* Graph Loading/Error States */
.graph-loading,
.graph-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.graph-loading .material-symbols-outlined,
.graph-error .material-symbols-outlined {
    font-size: 48px;
    color: rgba(var(--rgb-sunflower-gold), 0.7);
}

.graph-error .material-symbols-outlined {
    color: rgba(255, 100, 100, 0.7);
}

/* Graph Nodes */
.graph-node {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.graph-node:hover {
    transform: scale(1.1);
}

.graph-node circle {
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.graph-node:hover circle {
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2;
}

.node-label {
    font-family: inherit;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Graph Links */
.graph-link {
    pointer-events: none;
}

/* Graph Tooltip */
.graph-tooltip {
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px 18px;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.graph-tooltip .tooltip-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.graph-tooltip .tooltip-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.graph-tooltip .tooltip-info .material-symbols-outlined {
    font-size: 16px;
    color: rgba(var(--rgb-sunflower-gold), 0.8);
}

.graph-tooltip .tooltip-hint {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Graph Controls Panel */
.graph-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.graph-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.graph-control-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.graph-control-label .material-symbols-outlined {
    font-size: 16px;
}

.graph-control-options {
    display: flex;
    gap: 6px;
}

.graph-control-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.graph-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.graph-control-btn.active {
    background: rgba(var(--rgb-sunflower-gold), 0.2);
    border-color: rgba(var(--rgb-sunflower-gold), 0.4);
    color: rgba(var(--rgb-sunflower-gold), 1);
}

/* Link Strength Checkboxes */
.graph-link-filters {
    display: flex;
    gap: 12px;
}

.graph-link-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.graph-link-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: rgba(var(--rgb-sunflower-gold), 1);
}

.graph-link-filter .link-indicator {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.graph-link-filter .link-strong {
    background: rgba(var(--rgb-sunflower-gold), 0.9);
}

.graph-link-filter .link-medium {
    background: rgba(var(--rgb-sunflower-gold), 0.5);
}

.graph-link-filter .link-weak {
    background: rgba(var(--rgb-sunflower-gold), 0.25);
}

/* Graph Actions */
.graph-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.graph-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.graph-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.graph-action-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Graph Legend */
.graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 15px;
}

.graph-legend-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 10px;
}

.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.graph-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.graph-legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* Graph Stats Bar */
.graph-stats {
    display: flex;
    gap: 20px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 15px;
}

.graph-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.graph-stat-value {
    font-weight: 600;
    color: rgba(var(--rgb-sunflower-gold), 1);
}

/* Responsive Graph */
@media (max-width: 1024px) {
    .graph-controls {
        flex-direction: column;
    }

    .graph-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    #networkContainer {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .graph-control-options {
        flex-wrap: wrap;
    }

    .graph-link-filters {
        flex-direction: column;
        gap: 8px;
    }

    #networkContainer {
        height: 400px;
    }

    .graph-legend {
        flex-direction: column;
        gap: 8px;
    }
}
