@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }

/* 1. SOFT SLATE BACKGROUND */
body {
    background: #0f172a; /* Deep, soothing slate blue */
    color: #e2e8f0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 2. ELEVATED CARD */
.dashboard-container {
    width: 950px;
    height: 680px;
    background: #1e293b; /* Slightly lighter slate for the main card */
    border-radius: 28px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    padding: 35px 40px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.header { display: flex; justify-content: space-between; align-items: center; }

.title-section { display: flex; align-items: center; gap: 20px; }
.title-section h1 {
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1.5px;
}

.network-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #94a3b8; font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; background-color: #f43f5e; }
.dot.connected { background-color: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.mode-bar { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }

/* 3. BUTTONS */
.pill-btn {
    background-color: #334155;
    color: #cbd5e1;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill-btn:hover {
    transform: translateY(-3px);
    background-color: #475569;
    color: #ffffff;
}

.pill-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3); 
}

.danger-btn { background-color: rgba(225, 29, 72, 0.15); color: #fb7185; border: 1px solid rgba(225, 29, 72, 0.3); padding: 10px 20px; }
.danger-btn:hover { background-color: #e11d48; color: white; box-shadow: 0 8px 20px rgba(225, 29, 72, 0.4); }

.action-btn { 
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%); 
    color: white; margin-top: 20px; box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* --- MIC / PUSH-TO-TALK BUTTON STYLING --- */
.mic-btn {
    margin-top: 15px;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease-in-out;
    z-index: 10;
}

.mic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(14, 165, 233, 0.4);
}

.mic-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
    animation: pulse-mic 1.2s infinite alternate;
}

@keyframes pulse-mic {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.main-content { display: flex; flex: 1; justify-content: space-between; align-items: center; margin-top: 20px; }

.panel { width: 230px; height: 380px; display: flex; flex-direction: column; gap: 12px; }
.panel h3 { font-size: 13px; color: #64748b; letter-spacing: 1px; margin-bottom: 5px; font-weight: 700; text-transform: uppercase; }
.sub-mode-group, .toggle-group { display: flex; flex-direction: column; gap: 12px; }

/* 4. TOGGLES */
.toggle-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff; border: none; padding: 14px 18px; border-radius: 16px; font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}
.toggle-box:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4); }
.toggle-box.off { background: #334155; color: #94a3b8; box-shadow: none; }
.toggle-box.off:hover { transform: translateY(-4px) scale(1.02); background: #475569; color: #f8fafc; }

.state-indicator { float: right; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; font-size: 12px; }

/* 5. ROBOT CORE */
.center-core {
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
    background: radial-gradient(circle, #0f172a 0%, #1e293b 70%);
    border-radius: 50%; padding: 30px; box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.3); transition: transform 0.3s;
}
.center-core:hover { transform: scale(1.03); }
#particleCanvas { width: 380px; height: 380px; }

.status-box {
    margin-top: 15px; font-size: 15px; font-weight: 600; color: #f8fafc; background: #0f172a; padding: 10px 24px; border-radius: 24px; border: 1px solid #334155;
}

/* 6. MODALS & SHUTDOWN OVERLAY */
.hidden { display: none !important; }
.modal { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-card { background: #1e293b; padding: 35px; border-radius: 24px; width: 460px; display: flex; flex-direction: column; gap: 15px; border: 1px solid #334155; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.modal-card h2 { font-size: 22px; color: #f8fafc; margin-bottom: 5px; }
.modal-card label { font-size: 13px; color: #94a3b8; font-weight: 600; margin-bottom: -5px; }
.modal-card input, .modal-card textarea { background: #0f172a; border: 1px solid #334155; color: #f8fafc; padding: 12px 16px; border-radius: 12px; outline: none; font-size: 14px; }
.modal-card input:focus, .modal-card textarea:focus { border-color: #38bdf8; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 15px; }

.shutdown-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0f172a; display: flex; justify-content: center; align-items: center; z-index: 9999;
}
.shutdown-content { text-align: center; color: #f8fafc; animation: fadeUp 0.8s ease; }
.shutdown-content h1 { font-size: 32px; color: #38bdf8; margin-bottom: 10px; }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }