/* ============================================
   BENNY RADIO – Retro Space Funkgeraet Chat Widget
   ============================================ */

/* --- FAB (Floating Action Button) --- */
.radio-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99990;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(145deg, #5a4a2a, #3a2a14);
    border: 3px solid #8B6914;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 20px rgba(139,105,20,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.radio-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 30px rgba(139,105,20,0.3);
}
.radio-fab:active { transform: scale(0.95); }
.radio-fab svg { width: 30px; height: 30px; color: #C8A86E; }
.radio-fab.open { display: none; }

/* Pulse ring */
.radio-fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(139,105,20,0.4);
    animation: radio-pulse 2.5s ease-in-out infinite;
}
@keyframes radio-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0; }
}

/* --- Radio Body --- */
.radio-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99991;
    width: 380px;
    max-height: 600px;
    display: none;
    flex-direction: column;
    font-family: 'Inter', -apple-system, sans-serif;
    transform: scale(0.8) translateY(40px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s;
}
.radio-widget.open {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Antenna */
.radio-antenna {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 40px;
    position: relative;
}
.radio-antenna-rod {
    width: 3px;
    height: 36px;
    background: linear-gradient(to top, #666, #aaa, #888);
    border-radius: 2px;
    position: relative;
}
.radio-antenna-rod::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ff4444, #cc0000);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,68,68,0.6);
    animation: radio-blink 1.5s ease-in-out infinite;
}
@keyframes radio-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(255,68,68,0.6); }
    50% { opacity: 0.4; box-shadow: 0 0 4px rgba(255,68,68,0.2); }
}
.radio-antenna-base {
    width: 20px;
    height: 6px;
    background: linear-gradient(to bottom, #555, #333);
    border-radius: 2px 2px 0 0;
    position: absolute;
    bottom: 0;
}

/* Main housing */
.radio-housing {
    background: linear-gradient(160deg, #4a4a4a 0%, #3a3a3a 20%, #2e2e2e 50%, #252525 80%, #1e1e1e 100%);
    border-radius: 16px;
    border: 2px solid #555;
    box-shadow:
        0 16px 48px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 0 0 1px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
}
/* Metal texture */
.radio-housing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(255,255,255,0.015) 1px,
        rgba(255,255,255,0.015) 2px
    );
    pointer-events: none;
    border-radius: 14px;
}

/* Top bar - speaker grille + brand */
.radio-top {
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.radio-grille {
    display: flex;
    gap: 3px;
}
.radio-grille-slot {
    width: 3px;
    height: 20px;
    background: #1a1a1a;
    border-radius: 1px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}
.radio-brand {
    font-family: 'Georgia', serif;
    font-size: 0.75rem;
    color: #C8A86E;
    letter-spacing: 0.2em;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.radio-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3a3a3a, #222);
    border: 1px solid #4a4a4a;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}
.radio-close-btn:hover { color: #C8A86E; border-color: #C8A86E; }

/* Screen */
.radio-screen-frame {
    margin: 12px 14px;
    background: #0a0a08;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.6);
    overflow: hidden;
    position: relative;
}
/* Scanline overlay */
.radio-screen-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 4px
    );
    pointer-events: none;
    z-index: 2;
    border-radius: 6px;
}
.radio-screen {
    height: 320px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.radio-screen::-webkit-scrollbar { width: 4px; }
.radio-screen::-webkit-scrollbar-track { background: transparent; }
.radio-screen::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* Messages */
.radio-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: radio-msg-in 0.3s ease-out;
}
@keyframes radio-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.radio-msg-bot {
    align-self: flex-start;
    background: rgba(139,105,20,0.15);
    color: #C8A86E;
    border: 1px solid rgba(139,105,20,0.25);
    border-bottom-left-radius: 3px;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.8rem;
}
.radio-msg-user {
    align-self: flex-end;
    background: rgba(200,168,110,0.2);
    color: #e0d0b0;
    border: 1px solid rgba(200,168,110,0.3);
    border-bottom-right-radius: 3px;
}
.radio-msg-typing {
    align-self: flex-start;
    background: rgba(139,105,20,0.1);
    border: 1px solid rgba(139,105,20,0.15);
    color: #C8A86E;
    padding: 10px 16px;
    border-bottom-left-radius: 3px;
}
.radio-typing-dots {
    display: flex;
    gap: 4px;
}
.radio-typing-dots span {
    width: 6px;
    height: 6px;
    background: #C8A86E;
    border-radius: 50%;
    animation: radio-dot-bounce 1.2s ease-in-out infinite;
}
.radio-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.radio-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes radio-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Frequency display */
.radio-freq {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    gap: 8px;
}
.radio-freq-label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.65rem;
    color: #666;
    letter-spacing: 0.1em;
}
.radio-freq-bar {
    flex: 1;
    height: 2px;
    background: #222;
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}
.radio-freq-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(to right, #8B6914, #C8A86E);
    border-radius: 1px;
    animation: radio-freq-sweep 4s ease-in-out infinite alternate;
}
@keyframes radio-freq-sweep {
    0% { left: 0; width: 30%; }
    100% { left: 70%; width: 30%; }
}

/* Input area */
.radio-input-area {
    padding: 10px 14px 14px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.radio-input-wrap {
    flex: 1;
    position: relative;
}
.radio-input {
    width: 100%;
    background: #1a1a18;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 10px 14px;
    color: #e0d0b0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    min-height: 40px;
    max-height: 80px;
}
.radio-input::placeholder { color: #555; }
.radio-input:focus { border-color: #8B6914; }

/* TRANSMIT button */
.radio-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #8B6914, #6B4F0E);
    border: 2px solid #A67F1A;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(139,105,20,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    flex-shrink: 0;
}
.radio-send-btn:hover {
    background: linear-gradient(145deg, #A67F1A, #8B6914);
    box-shadow: 0 6px 20px rgba(139,105,20,0.5);
    transform: scale(1.05);
}
.radio-send-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(139,105,20,0.3), inset 0 2px 4px rgba(0,0,0,0.2);
}
.radio-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.radio-send-btn svg { width: 20px; height: 20px; }

/* Bottom knobs */
.radio-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.radio-knob-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.radio-knob {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.radio-knob-dial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    border: 1px solid #555;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
}
.radio-knob-dial::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: #C8A86E;
    border-radius: 1px;
}
.radio-knob-label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.5rem;
    color: #666;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.radio-status {
    display: flex;
    align-items: center;
    gap: 6px;
}
.radio-status-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 0 6px rgba(76,175,80,0.5);
}
.radio-status-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.6rem;
    color: #4CAF50;
    letter-spacing: 0.1em;
}

/* Mobile */
@media (max-width: 480px) {
    .radio-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 85vh;
        border-radius: 0;
    }
    .radio-housing { border-radius: 16px 16px 0 0; }
    .radio-antenna { display: none; }
    .radio-fab { bottom: 16px; right: 16px; width: 56px; height: 56px; }
    .radio-fab svg { width: 26px; height: 26px; }
}
