/* 
 * Cause-Effect Visualization CSS
 * This file contains all styling for the 3D visualization of nodes and edges
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #f5f5f5;
}

/* Main application container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header styling */
.app-header {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Control buttons and selectors */
.controls {
    display: flex;
    gap: 10px;
}

button, select {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

button:hover, select:hover {
    background-color: #4a6b8a;
}

/* Main visualization container */
#visualization-container {
    flex: 1;
    position: relative;
    background-color: #0a1a2a;
    overflow: hidden;
}

/* The SVG element for D3 visualization */
#visualization {
    width: 100%;
    height: 100%;
    background-color: #0a1a2a;
}

/* Node styling in the visualization */
.node circle {
    stroke: #fff;
    stroke-width: 2.5px;
    transition: all 0.3s;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.node:hover circle {
    stroke: #fff;
    stroke-width: 3px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.node text {
    font-size: 16px;
    font-family: sans-serif;
    pointer-events: none;
    fill: #ffffff;
}

/* Link (edge) styling */
.link {
    fill: none;
    transition: stroke-opacity 0.3s;
}

.link:hover {
    stroke-opacity: 1;
}

/* Details panel styling */
#details-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, opacity 0.3s;
    z-index: 100;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#node-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

#close-panel {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#close-panel:hover {
    background-color: #e0e0e0;
}

#node-details {
    padding: 15px;
    line-height: 1.5;
}

/* Loading indicator */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    font-size: 1.1rem;
}

/* Error message styling */
#error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
}

/* Helper classes */
.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    #details-panel {
        width: calc(100% - 40px);
        top: auto;
        bottom: 20px;
        max-height: 50vh;
    }
}
