/* SILK - Essential Styles
   Only styles that Tailwind CSS cannot handle
*/

/* ============================================
   Scenario Buttons
   Base styles + active state with pulsing dot
   ============================================ */
.btn-scenario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: #d1d5db;
    transition: all 0.2s;
}

.btn-scenario:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
    color: white;
}

.btn-scenario[data-active="true"] {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
    border-color: #00d9ff;
    border-left: 3px solid #00d9ff;
    padding-left: calc(0.75rem - 2px);
    position: relative;
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.5);
}

.btn-scenario[data-active="true"]::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ff88;
}

.btn-scenario[data-active="true"]::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: translateY(-50%) scale(2.5);
        opacity: 0;
    }
}

/* ============================================
   Range Slider Custom Styling
   (Tailwind cannot style pseudo-elements)
   ============================================ */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    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: #00d9ff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

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

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00d9ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   CSS Containment for Performance
   ============================================ */
.event-monitor {
    contain: layout style;
}

.event-log {
    contain: content;
    will-change: scroll-position;
}

/* ============================================
   Event Item Remove Animation
   ============================================ */
.event-item.removing {
    animation: collapse-out 0.2s ease-out forwards;
    pointer-events: none;
}

/* ============================================
   Material Icons Global Alignment
   ============================================ */
span.material-icons {
    vertical-align: middle;
}

/* ============================================
   Scrollbar Styling (WebKit only)
   ============================================ */
.event-log::-webkit-scrollbar {
    width: 6px;
}

.event-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.event-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.event-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Animated Molecules Background (Welcome Screen)
   Science/Lab themed floating particles
   Uses CSS variables for compact definitions
   ============================================ */
.molecule {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    width: var(--size);
    height: var(--size);
    background: var(--bg);
    box-shadow: var(--glow);
    left: var(--x, auto);
    right: var(--rx, auto);
    top: var(--y, auto);
    bottom: var(--by, auto);
    animation: float var(--dur) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.bond {
    position: absolute;
    height: 2px;
    width: var(--w);
    left: var(--x, auto);
    right: var(--rx, auto);
    top: var(--y, auto);
    bottom: var(--by, auto);
    transform: rotate(var(--rot));
    background: linear-gradient(90deg, rgba(0,217,255,0) 0%, rgba(0,217,255,0.4) 20%, rgba(0,255,136,0.4) 80%, rgba(0,255,136,0) 100%);
    animation: bond-pulse 4s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0.5;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    25% { transform: translateY(-30px) translateX(15px) scale(1.05); }
    50% { transform: translateY(-50px) translateX(-10px) scale(1); }
    75% { transform: translateY(-20px) translateX(-20px) scale(0.95); }
}

@keyframes bond-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}
