/**
 * Emergent Swarm Intelligence - Dark Theme with Neon Effects
 */

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

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

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

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

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    background: linear-gradient(90deg, #00ffaa, #00aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #888;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.controls-panel {
    background: rgba(20, 20, 35, 0.8);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    height: fit-content;
}

.controls-panel h2 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: #00ffaa;
}

.control-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-of-type {
    border-bottom: none;
}

.control-section h3 {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 12px;
    color: #00aaff;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 5px;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00ffaa;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00ffaa;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.checkbox-label span {
    color: #ccc;
}

.control-group select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.control-group select:focus {
    border-color: #00ffaa;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #00ffaa, #00aaff);
    color: #0a0a14;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.canvas-container {
    position: relative;
    background: rgba(10, 10, 20, 0.9);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#boidCanvas {
    display: block;
    width: 100%;
    height: 600px;
}

.stats-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(10, 10, 20, 0.9);
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #888;
    margin-right: 15px;
}

.stat-value {
    color: #00ffaa;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.info-panel {
    background: rgba(20, 20, 35, 0.8);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.info-panel h3 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: #00ffaa;
}

.info-panel p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #bbb;
    margin-bottom: 15px;
}

.info-panel ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-panel li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #bbb;
    margin-bottom: 8px;
}

.info-panel strong {
    color: #00aaff;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        order: 2;
    }

    .canvas-container {
        order: 1;
    }
}

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

    .subtitle {
        font-size: 0.9rem;
    }

    .controls-panel,
    .info-panel {
        padding: 15px;
    }

    #boidCanvas {
        height: 400px;
    }

    .stats-panel {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 170, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 170, 0.5);
}

/* Animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container > * {
    animation: fadeIn 0.6s ease-out;
}
