/**
 * Timeline Visualizer Tool - Styles
 * NO INLINE STYLES - CSP Compliant
 * Location: assets/css/timeline-visualizer.css
 */

/* Base Styles */
body {
    background: #000;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Matrix Canvas Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

/* Matrix Controls */
#matrix-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

#matrix-controls:hover {
    opacity: 1;
}

.matrix-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s;
}

.matrix-control-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

/* Main Container */
.tool-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
    min-height: 100vh;
}

/* Header */
.tool-header {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 2px solid #00ff41;
    margin-bottom: 30px;
}

.tool-title {
    font-size: 2.5rem;
    color: #00ff41;
    text-shadow: 0 0 20px #00ff41;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.tool-subtitle {
    color: #00ccff;
    font-size: 1.1rem;
    margin: 10px 0;
}

.tool-badge {
    display: inline-block;
    background: rgba(0, 255, 65, 0.2);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, 2px);
    }
    98% {
        transform: translate(2px, -2px);
    }
}

/* Mode Selection */
.mode-selection {
    background: rgba(0, 20, 10, 0.9);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
}

.mode-selection h2 {
    color: #00ff41;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.mode-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    transform: translateY(-3px);
}

.mode-btn.active {
    background: rgba(0, 255, 65, 0.3);
    border-color: #00ff41;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
    font-weight: bold;
}

/* Mode Panels */
.mode-panel {
    display: none;
    background: rgba(0, 20, 10, 0.9);
    border: 2px solid #00ccff;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
}

.mode-panel.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mode-panel h3 {
    color: #00ccff;
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.panel-description {
    color: #a0ffa0;
    margin: 0 0 25px 0;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00ff41;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    border-radius: 5px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: #00ccff;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.input-hint {
    color: #888;
    font-size: 0.85rem;
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Timeline Input Groups */
.timeline-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.timeline-input-group {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    padding: 20px;
}

.timeline-input-group h4 {
    color: #00ccff;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.2rem;
}

.timeline-input-group label {
    display: block;
    color: #a0ffa0;
    font-size: 0.9rem;
    margin: 10px 0 5px 0;
}

.timeline-input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 10px 10px 10px 0;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

.btn-primary {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
}

.btn-secondary {
    border-color: #ffaa00;
    color: #ffaa00;
}

.btn-secondary:hover {
    background: rgba(255, 170, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
}

.btn-tertiary {
    border-color: #00ccff;
    color: #00ccff;
}

.btn-tertiary:hover {
    background: rgba(0, 204, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.5);
}

/* Visualization Output */
.visualization-output {
    margin-top: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 65, 0.5);
    border-radius: 8px;
}

.visualization-output h4 {
    color: #00ff41;
    font-size: 1.3rem;
    margin: 0 0 20px 0;
    text-align: center;
    text-transform: uppercase;
}

.timeline-canvas {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
    overflow-x: auto;
}

.analysis-results {
    background: rgba(0, 20, 10, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
    padding: 20px;
}

.result-item {
    color: #a0ffa0;
    padding: 10px;
    margin: 5px 0;
    border-left: 3px solid #00ff41;
    background: rgba(0, 255, 65, 0.05);
}

.result-item.error {
    border-left-color: #ff4444;
    color: #ffaaaa;
    background: rgba(255, 0, 0, 0.1);
}

.result-item.warning {
    border-left-color: #ffaa00;
    color: #ffcc66;
    background: rgba(255, 170, 0, 0.1);
}

.result-item.success {
    border-left-color: #00ff41;
    color: #a0ffa0;
    background: rgba(0, 255, 65, 0.1);
}

/* Help Section */
.help-section {
    background: rgba(0, 30, 40, 0.9);
    border: 2px solid #00ccff;
    border-radius: 10px;
    padding: 30px;
    margin: 40px 0;
}

.help-section h3 {
    color: #00ccff;
    font-size: 1.8rem;
    margin: 0 0 20px 0;
    text-align: center;
    text-transform: uppercase;
}

.help-mode {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 8px;
}

.help-mode h4 {
    color: #00ccff;
    font-size: 1.3rem;
    margin: 0 0 15px 0;
}

.help-mode ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-mode li {
    color: #a0e0ff;
    padding: 8px 0 8px 25px;
    position: relative;
    line-height: 1.6;
}

.help-mode li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #00ccff;
    font-size: 1.2rem;
}

/* Console Info */
.console-info {
    background: rgba(0, 20, 0, 0.9);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
}

.console-info h3 {
    color: #00ff41;
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.console-info p {
    color: #a0ffa0;
    margin: 0 0 15px 0;
}

.console-commands {
    list-style: none;
    padding: 0;
    margin: 0;
}

.console-commands li {
    color: #a0ffa0;
    padding: 8px 0;
    font-family: 'Courier New', monospace;
}

.console-commands code {
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 4px;
    color: #00ff41;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

/* Navigation */
.tool-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 2px solid rgba(0, 255, 65, 0.3);
}

.nav-btn {
    display: inline-block;
    padding: 12px 25px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

/* Footer */
.tool-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 2px solid rgba(0, 255, 65, 0.3);
    margin-top: 40px;
    color: #888;
}

.tool-footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Timeline Visualization Styles */
.timeline-row {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 5px;
}

.timeline-time {
    min-width: 80px;
    color: #00ccff;
    font-weight: bold;
    margin-right: 15px;
}

.timeline-event {
    flex: 1;
    color: #00ff41;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid #00ff41;
    border-radius: 3px;
}

.timeline-event.conflict {
    border-left-color: #ff4444;
    background: rgba(255, 0, 0, 0.1);
    color: #ffaaaa;
}

.timeline-connector {
    color: #00ff41;
    margin: 5px 0;
    padding-left: 80px;
    font-size: 1.5rem;
}

/* Convergence Visualization */
.convergence-timeline {
    margin: 20px 0;
    padding: 15px;
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
}

.convergence-timeline h5 {
    color: #00ccff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.convergence-bar {
    height: 30px;
    background: rgba(0, 255, 65, 0.2);
    border: 1px solid #00ff41;
    border-radius: 5px;
    position: relative;
    margin: 10px 0;
}

.convergence-marker {
    position: absolute;
    top: -5px;
    bottom: -5px;
    width: 3px;
    background: #ff4444;
}

.convergence-marker.divergence {
    background: #ffaa00;
}

.convergence-marker.endpoint {
    background: #00ccff;
}

.convergence-label {
    position: absolute;
    top: -25px;
    font-size: 0.8rem;
    color: #a0ffa0;
    white-space: nowrap;
}

/* Causality Graph */
.causality-node {
    display: inline-block;
    padding: 12px 20px;
    margin: 10px;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    border-radius: 8px;
    color: #00ff41;
    text-align: center;
}

.causality-node.paradox {
    border-color: #ff4444;
    background: rgba(255, 0, 0, 0.1);
    color: #ffaaaa;
}

.causality-arrow {
    color: #00ccff;
    font-size: 2rem;
    margin: 0 10px;
}

.causality-arrow.prevents {
    color: #ff4444;
}

.causality-graph-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-title {
        font-size: 1.8rem;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .timeline-inputs {
        grid-template-columns: 1fr;
    }
    
    .tool-navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .timeline-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-time {
        margin-bottom: 5px;
    }
    
    .timeline-connector {
        padding-left: 0;
        text-align: center;
        width: 100%;
    }
    
    .causality-graph-row {
        flex-direction: column;
    }
    
    .causality-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 10px;
    }
    
    .tool-header {
        padding: 20px 10px;
    }
    
    .tool-title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .tool-subtitle {
        font-size: 0.95rem;
    }
    
    .mode-selection,
    .mode-panel,
    .help-section,
    .console-info {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
}