* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0f0f23 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4, #8b5cf6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
    margin-bottom: 10px;
}

@keyframes gradient {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.subtitle {
    color: #9ca3af;
    font-size: 1.1em;
}

.architecture-selector {
    text-align: center;
    margin-bottom: 30px;
}

.architecture-selector label {
    margin-right: 15px;
    font-weight: 600;
    color: #c4b5fd;
}

.architecture-selector select {
    padding: 10px 20px;
    font-size: 1em;
    background: #1e1e3f;
    border: 2px solid #4c1d95;
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.architecture-selector select:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.networks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.network-panel {
    background: rgba(30, 30, 63, 0.8);
    border: 2px solid;
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.network-panel.traditional {
    border-color: #3b82f6;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.network-panel.constraint {
    border-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h2 {
    font-size: 1.5em;
}

.network-panel.traditional .panel-header h2 {
    color: #60a5fa;
}

.network-panel.constraint .panel-header h2 {
    color: #34d399;
}

.approach-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.network-panel.traditional .approach-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

.network-panel.constraint .approach-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

.network-canvas {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    background: rgba(15, 15, 35, 0.6);
}

.network-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #9ca3af;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
}

.network-panel.traditional .stat-value {
    color: #60a5fa;
}

.network-panel.constraint .stat-value {
    color: #34d399;
}

.controls-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    background: rgba(30, 30, 63, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 20px;
}

.control-group h3 {
    color: #c4b5fd;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.input-controls {
    margin-bottom: 15px;
}

.input-pair {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.input-pair label {
    min-width: 80px;
    color: #9ca3af;
}

.input-pair input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #1e1e3f;
    border-radius: 3px;
    outline: none;
}

.input-pair input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.input-pair input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.input-pair span {
    min-width: 40px;
    text-align: right;
    color: #c4b5fd;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: #c4b5fd;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}

.training-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.training-controls select {
    padding: 10px;
    background: #1e1e3f;
    border: 1px solid #4c1d95;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1em;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.training-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #1e1e3f;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    width: 0%;
    transition: width 0.3s ease;
}

.loss-section {
    background: rgba(30, 30, 63, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.loss-section h3 {
    color: #c4b5fd;
    margin-bottom: 15px;
}

.loss-legend {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.legend-item {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.legend-item.traditional {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

.legend-item.constraint {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

.loss-canvas {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    background: rgba(15, 15, 35, 0.6);
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(30, 30, 63, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 20px;
}

.info-card h4 {
    color: #c4b5fd;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 8px 0;
    color: #9ca3af;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li strong {
    color: #c4b5fd;
}

@media (max-width: 1200px) {
    .networks-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .controls-section {
        grid-template-columns: 1fr;
    }

    .info-section {
        grid-template-columns: 1fr;
    }
}

/* Glow effects */
.glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.glow-green {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}
