/* Basic Reset */
body, h1, h2, h3, p, div, input, button, label {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    height: 100%;
    margin: 0;
}

body {
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    display: flex;
    height: 100vh;
}

.main-content {
    flex-grow: 3; /* Takes 3 parts of space */
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3a3a3a;
    overflow: hidden; /* Prevent content from breaking layout */
}

#visualization-container {
    flex-grow: 1; /* Takes remaining space in main-content */
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden; /* Important for Plotly chart */
    border-bottom: 1px solid #3a3a3a;
    text-align: center;
}

.sidebar {
    flex-basis: 300px; /* Fixed width */
    min-width: 250px;
    flex-shrink: 0; /* Don't shrink */
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: #1f1f1f;
}

#visualization-container h1 {
    font-size: 2.5em;
    color: #e0e0e0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #3a3a3a;
    text-align: center;
}

.sidebar h2 {
    font-size: 1.5em;
    color: #e0e0e0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #3a3a3a;
    text-align: center;
}

.feed-input-area {
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

#response-selector {
    padding: 12px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 25px;
    font-size: 1.4em;
    background-color: #1a1a1a;
    color: #e0e0e0;
    width: 100%;
    margin-bottom: 10px;
}

#response-selector option {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 8px;
}

#response-selector optgroup {
    background-color: #2a2a2a;
    color: #cccccc;
    font-weight: bold;
    padding: 8px;
}

.feed-input-area h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
    font-size: 1.2em;
    text-align: center;
}

#send-button {
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.4em;
    padding: 16px 20px;
    width: 100%;
}
#send-button:hover {
    background-color: #166fe5;
}

#connection-chart {
    flex-grow: 1;
    min-height: 400px;
    width: 100%;
}

#controls-panel {
    margin-top: 15px;
}

.button-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.button-container button {
    flex-grow: 1;
    padding: 10px;
    font-size: 1.2em;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px; /* Added for consistent height */
}

#controls-panel button, #controls-panel label, #controls-panel input {
    display: block;
    width: 100%;
    color: #e0e0e0;
    font-size: 1.2em;
}

#reset-button {
    background-color: #dc3545;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#reset-button:hover {
    background-color: #c82333;
}

#toggle-simulation {
    color: white;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.simulation-start {
    background-color: #28a745;
}
.simulation-start:hover {
    background-color: #218838;
}

.simulation-stop {
    background-color: #3e94ce;
}
.simulation-stop:hover {
    background-color: #34739c;
}

/* Speed Control Styles */
.speed-control {
    margin-top: 15px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

.speed-control label {
    display: block;
    color: #e0e0e0;
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: bold;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.speed-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1877f2;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1877f2;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.speed-slider:hover::-webkit-slider-thumb {
    background: #166fe5;
}

.speed-slider:hover::-moz-range-thumb {
    background: #166fe5;
}

#speed-value {
    color: #e0e0e0;
    font-size: 1.1em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* D3 Network Visualization Styles */
.d3-network-container {
    background: #1a1a1a;
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

.network-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.network-edge {
    stroke: #aaaaaa;
    stroke-width: 2px;
    opacity: 0.4;
    transition: all 0.5s ease;
}

.network-edge.strong-connection {
    stroke: #888888;
    stroke-width: 4px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.network-edge.weak-connection {
    stroke: #444444;
    stroke-width: 0.5px;
    opacity: 0.2;
}

.user-node {
    filter: drop-shadow(0 0 8px #B8860B);
}

.avatar-head {
    transition: all 0.3s ease;
}

.avatar-body {
    transition: all 0.3s ease;
}

.pizza-legend {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5em;
    color: #e0e0e0;
}

.legend-color-box {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 1px solid #333;
    display: inline-block;
}

#description-panel p {
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.speech-bubble {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.speech-bubble-box {
    stroke: #cccccc;
    stroke-width: 1.5;
    rx: 8;
    ry: 8;
    fill: rgba(45, 45, 45, 0.85);
}

.speech-bubble-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 22px;
    fill: #e0e0e0;
    pointer-events: none;
}