/* ========================================
   WebGL Particle Simulation - Styles
   © 2026 GNSS | MIT License
   ======================================== */

:root {
    --primary-color: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.4);
    --secondary-color: #ff6b9d;
    --bg-dark: #0a0a12;
    --panel-bg: rgba(15, 15, 25, 0.85);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(100, 200, 255, 0.25);
    --warning-color: #ff9999;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    overflow: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

canvas {
    display: block;
}

/* Instructions Panel - Top Left */
#instructions {
    position: absolute;
    top: 24px;
    left: 24px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    line-height: 1.8;
    user-select: none;
    background: var(--panel-bg);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 280px;
}

#instructions h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#instructions .control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#instructions .key {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

#instructions .tip {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-style: italic;
    color: var(--primary-color);
    opacity: 0.8;
}

#instructions .warning {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 100, 100, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--warning-color);
    color: var(--warning-color);
    font-size: 11px;
    line-height: 1.6;
}

/* Mode Display - Top Right */
#mode-desc {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--primary-color);
    font-size: 15px;
    pointer-events: none;
    text-align: right;
    background: var(--panel-bg);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#mode-desc::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 6px transparent;
    }
}

/* Control Panel - Bottom Center */
#ui-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--panel-bg);
    padding: 18px 28px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 212, 255, 0.08);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 8px;
}

button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    min-width: 75px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-glow), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

button:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.08));
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

button:hover::before {
    opacity: 1;
}

button:active {
    transform: translateY(0);
}

button.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 212, 255, 0.15));
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 0 10px rgba(0, 212, 255, 0.1);
}

/* Control Groups */
.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    padding-left: 18px;
    margin-left: 6px;
}

.control-group span {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Select Dropdown */
select {
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
}

select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Range Sliders */
input[type=range] {
    width: 100px;
    height: 6px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), #00a8cc);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    transition: all 0.2s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.7);
}

input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), #00a8cc);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Color Picker */
input[type=color] {
    width: 36px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
    transition: all 0.2s ease;
}

input[type=color]:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

input[type=color]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type=color]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

/* Loading Animation */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer Attribution */
#footer {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 11px;
    pointer-events: none;
    text-align: center;
    opacity: 0.6;
}

/* About Button */
#about-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: unset;
    padding: 0;
}

#about-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

#about-btn.active {
    background: var(--primary-color);
    color: var(--bg-dark);
}

/* About Panel */
#about-panel {
    position: absolute;
    bottom: 95px;
    right: 30px;
    z-index: 99;
    width: 340px;
    max-height: 70vh;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    padding: 24px;
    overflow-y: auto;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#about-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

#about-panel h2 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

#about-panel h3 {
    margin: 20px 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#about-panel p {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

#about-panel ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

#about-panel li {
    margin-bottom: 6px;
}

#about-panel .highlight {
    color: var(--primary-color);
    font-weight: 500;
}

#about-panel .tech-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
}

#about-panel .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* Responsive Design */
@media (max-width: 900px) {
    #ui-panel {
        flex-wrap: wrap;
        max-width: 90%;
        justify-content: center;
        padding: 16px 20px;
    }

    .control-group {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #instructions {
        max-width: 200px;
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    #instructions {
        display: none;
    }

    #mode-desc {
        font-size: 12px;
        padding: 8px 14px;
    }
}
