/* OSINT Graph Visualization Styles */

/* Container */
.graph-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
}

.graph-canvas {
    width: 100%;
    height: 100%;
}

/* Node colors by type */
:root {
    --color-person: #3b82f6;
    --color-email: #ef4444;
    --color-phone: #22c55e;
    --color-company: #f59e0b;
    --color-username: #8b5cf6;
    --color-domain: #06b6d4;
    --color-service: #ec4899;
    --color-breach: #dc2626;
    --color-address: #84cc16;
    --color-social-profile: #a855f7;
    --color-default: #9ca3af;
}

/* Sidebar panels */
.graph-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: rgba(30, 30, 46, 0.95);
    border-left: 1px solid #374151;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

.graph-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: #f3f4f6;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 4px 8px;
}

.sidebar-close:hover {
    color: #f3f4f6;
}

.sidebar-content {
    padding: 16px;
}

/* Node detail panel */
.node-detail {
    color: #e5e7eb;
}

.node-detail-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.node-detail-type.person { background: var(--color-person); }
.node-detail-type.email { background: var(--color-email); }
.node-detail-type.phone { background: var(--color-phone); }
.node-detail-type.company { background: var(--color-company); }
.node-detail-type.username { background: var(--color-username); }
.node-detail-type.domain { background: var(--color-domain); }
.node-detail-type.service { background: var(--color-service); }
.node-detail-type.breach { background: var(--color-breach); }

.node-detail-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 16px;
    word-break: break-word;
}

.node-detail-section {
    margin-bottom: 16px;
}

.node-detail-section h4 {
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.node-connections {
    list-style: none;
    padding: 0;
    margin: 0;
}

.node-connection-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #374151;
}

.node-connection-item:last-child {
    border-bottom: none;
}

.connection-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    color: white;
}

.connection-label {
    flex: 1;
    font-size: 0.875rem;
    color: #d1d5db;
}

/* Controls panel */
.graph-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #374151;
    background: rgba(30, 30, 46, 0.9);
    color: #d1d5db;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(55, 65, 81, 0.9);
    color: #f3f4f6;
}

.control-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Minimap */
.graph-minimap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 150px;
    height: 100px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    z-index: 50;
}

.minimap-canvas {
    width: 100%;
    height: 100%;
}

.minimap-viewport {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    pointer-events: none;
}

/* Status bar */
.graph-status {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #374151;
    border-radius: 8px;
    color: #d1d5db;
    font-size: 0.875rem;
    z-index: 50;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected { background: #22c55e; }
.status-dot.connecting { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.disconnected { background: #ef4444; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Legend */
.graph-legend {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 12px 16px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #374151;
    border-radius: 8px;
    z-index: 50;
}

.legend-title {
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.legend-label {
    color: #d1d5db;
    font-size: 0.75rem;
}

/* Progress overlay */
.graph-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-text {
    color: #d1d5db;
    margin-top: 16px;
    font-size: 0.875rem;
}

.progress-step {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 8px;
}

/* Events log */
.events-log {
    position: absolute;
    bottom: 16px;
    left: 200px;
    right: 180px;
    max-height: 120px;
    overflow-y: auto;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 8px;
    z-index: 50;
    font-family: monospace;
    font-size: 0.75rem;
}

.event-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: #9ca3af;
}

.event-time {
    color: #6b7280;
}

.event-type {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.event-type.node_added { background: #22c55e33; color: #22c55e; }
.event-type.edge_added { background: #3b82f633; color: #3b82f6; }
.event-type.step_started { background: #f59e0b33; color: #f59e0b; }
.event-type.step_completed { background: #8b5cf633; color: #8b5cf6; }
.event-type.chain_finished { background: #06b6d433; color: #06b6d4; }
.event-type.error { background: #ef444433; color: #ef4444; }

.event-message {
    flex: 1;
    color: #d1d5db;
}

/* Tooltip */
.graph-tooltip {
    position: absolute;
    padding: 8px 12px;
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid #374151;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 4px;
}

.tooltip-label {
    font-weight: 600;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .graph-sidebar {
        width: 100%;
    }

    .graph-legend {
        display: none;
    }

    .events-log {
        left: 16px;
        right: 16px;
        bottom: 130px;
    }
}
