/* U-235 Nuclear Fission Simulator - Styles */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;700&display=swap');

/* Base Styles */
body {
    margin: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #000000, #0a0a1a, #000510);
    font-family: 'Rajdhani', sans-serif;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 10, 30, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%);
}

/* Animated grid background */
#grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.4;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* HUD Display */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #0ff;
    background: linear-gradient(135deg, rgba(0, 15, 30, 0.95), rgba(0, 30, 50, 0.85));
    padding: 25px;
    border-left: 4px solid #0ff;
    border-radius: 8px;
    backdrop-filter: blur(15px);
    width: 300px;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

h1 {
    margin: 0 0 15px 0;
    font-size: 28px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
    }
    50% {
        text-shadow: 0 0 30px #0ff, 0 0 60px #0ff, 0 0 80px #0ff;
    }
}

.label {
    font-size: 12px;
    color: #88ccff;
    margin-top: 8px;
    letter-spacing: 1px;
}

.value {
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    margin-top: 2px;
}

.critical {
    color: #f00;
    text-shadow: 0 0 10px #f00;
    animation: flashText 0.2s infinite;
}

@keyframes flashText {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Controls */
#controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex;
    gap: 20px;
}

button {
    background: linear-gradient(135deg, rgba(0, 40, 60, 0.9), rgba(0, 20, 40, 0.9));
    border: 2px solid #0ff;
    color: #0ff;
    padding: 18px 45px;
    font-family: 'Rajdhani';
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.05);
    letter-spacing: 2px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(135deg, #0ff, #00aacc);
    color: #000;
    box-shadow: 0 0 60px #0ff, 0 0 100px rgba(0, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    border-color: #fff;
}

button:active {
    transform: translateY(-1px) scale(1.02);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Graph Container */
#graph-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 120px;
    background: linear-gradient(135deg, rgba(0, 15, 30, 0.95), rgba(0, 30, 50, 0.85));
    border: 2px solid #0ff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(15px);
}

/* Neutron Indicator */
#neutron-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ff0;
    background: linear-gradient(135deg, rgba(40, 30, 0, 0.95), rgba(60, 40, 0, 0.85));
    padding: 18px 25px;
    border-right: 4px solid #ff0;
    border-radius: 8px;
    backdrop-filter: blur(15px);
    font-size: 16px;
    letter-spacing: 2px;
    box-shadow: 0 8px 32px rgba(255, 255, 0, 0.4), inset 0 0 20px rgba(255, 255, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
    text-transform: uppercase;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 0, 0.3);
}

#neutron-indicator.active {
    opacity: 1;
    animation: warningPulse 0.5s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(255, 255, 0, 0.4), inset 0 0 20px rgba(255, 255, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 255, 0, 0.7), inset 0 0 30px rgba(255, 255, 0, 0.2);
    }
}

/* Particle Labels */
.particle-label {
    position: absolute;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 1), 0 0 5px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.8px;
    white-space: nowrap;
    transition: opacity 0.2s;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.proton-label {
    border: 1.5px solid #ff4444;
    color: #ff8888;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.6), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.neutron-label {
    border: 1.5px solid #4488ff;
    color: #88bbff;
    box-shadow: 0 0 15px rgba(68, 136, 255, 0.6), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.incoming-label {
    border: 2px solid #ffff00;
    color: #ffff88;
    font-size: 11px;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8), 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulsate 0.8s ease-in-out infinite;
}

@keyframes pulsate {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 255, 0, 0.8), 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(255, 255, 0, 1), 0 2px 15px rgba(0, 0, 0, 0.6);
    }
}

/* Energy Level Diagram */
#energy-diagram {
    position: absolute;
    top: 20px;
    right: 360px;
    width: 200px;
    max-height: 500px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(0, 15, 30, 0.95), rgba(0, 30, 50, 0.85));
    border: 2px solid #0ff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    color: #0ff;
    font-family: 'Rajdhani';
    display: none;
}

#energy-diagram h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
}

.shell-level {
    margin: 8px 0;
    padding: 6px;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid #0ff;
    border-radius: 3px;
}

.shell-name {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.shell-dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.shell-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #0ff;
}

.shell-dot.filled {
    background: #0ff;
    box-shadow: 0 0 5px #0ff;
}

.shell-dot.empty {
    background: transparent;
}
