/* ==============================================
   LEAKY INTEGRATE-AND-FIRE NEURON VISUALIZATION
   ============================================== */

/* Container */
.lif-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

/* Main Layout - Two Column */
.lif-main-layout {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

/* Left Panel - Controls */
.lif-control-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lif-control-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 15px;
}

.lif-control-section h4 {
    color: #58a6ff;
    font-size: 13px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lif-control-section h4 .icon {
    font-size: 16px;
}

/* Parameter Sliders */
.lif-param-group {
    margin-bottom: 15px;
}

.lif-param-group:last-child {
    margin-bottom: 0;
}

.lif-param-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.lif-param-label .name {
    color: #c9d1d9;
    font-size: 12px;
}

.lif-param-label .value {
    color: #7ee787;
    font-size: 13px;
    font-weight: bold;
    min-width: 50px;
    text-align: right;
}

.lif-param-label .unit {
    color: #8b949e;
    font-size: 11px;
    margin-left: 4px;
}

.lif-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #21262d;
    border-radius: 3px;
    outline: none;
}

.lif-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #58a6ff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.lif-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.lif-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #58a6ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Different colors for different parameters */
.lif-slider.current::-webkit-slider-thumb { background: #f0b429; }
.lif-slider.resistance::-webkit-slider-thumb { background: #a371f7; }
.lif-slider.capacitance::-webkit-slider-thumb { background: #3fb950; }
.lif-slider.threshold::-webkit-slider-thumb { background: #f85149; }

/* Stats Display */
.lif-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lif-stat-item {
    background: #21262d;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.lif-stat-item .label {
    color: #8b949e;
    font-size: 10px;
    display: block;
    margin-bottom: 4px;
}

.lif-stat-item .value {
    color: #c9d1d9;
    font-size: 16px;
    font-weight: bold;
}

.lif-stat-item .value.spike {
    color: #f85149;
}

.lif-stat-item .value.voltage {
    color: #58a6ff;
}

/* Control Buttons */
.lif-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lif-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.15s ease;
}

.lif-btn:hover {
    background: #30363d;
}

.lif-btn.primary {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

.lif-btn.primary:hover {
    background: #2ea043;
}

.lif-btn.danger {
    background: #21262d;
    border-color: #f85149;
    color: #f85149;
}

.lif-btn.danger:hover {
    background: #f8514922;
}

/* Right Panel - Visualizations */
.lif-visual-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Canvas Containers */
.lif-canvas-container {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.lif-canvas-container.graph {
    flex: 1;
    min-height: 200px;
}

.lif-canvas-container.metaphor {
    height: 220px;
}

.lif-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Canvas Labels */
.lif-canvas-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(22, 27, 34, 0.9);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    color: #8b949e;
    z-index: 10;
}

.lif-canvas-label .title {
    color: #58a6ff;
    font-weight: bold;
}

/* Spike Indicator */
.lif-spike-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f85149;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 10;
}

.lif-spike-indicator.active {
    opacity: 1;
    animation: spikePulse 0.3s ease;
}

@keyframes spikePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Legend */
.lif-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    background: #161b22;
    border-radius: 8px;
}

.lif-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #c9d1d9;
}

.lif-legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.lif-legend-color.voltage { background: #58a6ff; }
.lif-legend-color.threshold { background: #f85149; height: 2px; border-style: dashed; }
.lif-legend-color.spike { background: #f0b429; width: 3px; height: 12px; }
.lif-legend-color.water { background: linear-gradient(to bottom, #58a6ff, #1a5fb4); width: 14px; height: 14px; border-radius: 2px; }

/* Equation Display */
.lif-equation {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    color: #c9d1d9;
    text-align: center;
}

.lif-equation .math {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.lif-equation .tau {
    color: #a371f7;
}

.lif-equation .voltage {
    color: #58a6ff;
}

.lif-equation .current {
    color: #f0b429;
}

.lif-equation .resistance {
    color: #a371f7;
}

/* Preset Buttons */
.lif-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lif-preset-btn {
    padding: 6px 10px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lif-preset-btn:hover {
    background: #30363d;
    color: #c9d1d9;
}

.lif-preset-btn.active {
    background: #58a6ff22;
    border-color: #58a6ff;
    color: #58a6ff;
}

/* Input Pattern Display */
.lif-input-pattern {
    margin-top: 10px;
    padding: 10px;
    background: #21262d;
    border-radius: 6px;
}

.lif-input-pattern .label {
    color: #8b949e;
    font-size: 10px;
    margin-bottom: 6px;
}

.lif-input-pattern select {
    width: 100%;
    padding: 6px 10px;
    background: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    .lif-main-layout {
        flex-direction: column;
    }
    
    .lif-control-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .lif-control-section {
        flex: 1;
        min-width: 200px;
    }
}

/* Simulation Content Background */
#content_sim {
    background-color: #0d1117;
}

/* Time Constant Display */
.lif-tau-display {
    background: #a371f722;
    border: 1px solid #a371f7;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
    text-align: center;
}

.lif-tau-display .label {
    color: #8b949e;
    font-size: 10px;
}

.lif-tau-display .value {
    color: #a371f7;
    font-size: 14px;
    font-weight: bold;
}

/* Animation for water drops */
@keyframes waterDrop {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(30px); opacity: 0; }
}

/* Flash effect for spike */
@keyframes spikeFlash {
    0% { background: rgba(248, 81, 73, 0.3); }
    100% { background: transparent; }
}

.lif-canvas-container.spiked {
    animation: spikeFlash 0.2s ease;
}
