/* --- Global Reset & Variables --- */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* Prevents body scroll, panes handle scrolling */
    height: 100vh;
}

/* --- Layout Containers --- */
#workspace {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
}

/* --- Fleet Page Grid --- */
#agent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 40px;
    overflow-y: auto;
}

.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.agent-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.agent-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-info strong {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* --- Control Page Toolbar --- */
.tabs {
    display: flex;
    align-items: center;
    background: #1e293b;
    padding: 8px 15px;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.tab-btn.active-toggle {
    background: var(--danger) !important;
    color: white;
    border-color: #fca5a5;
}

.tab-btn.danger {
    color: var(--danger);
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 5px;
}

/* --- Panes & Canvas --- */
.tab-pane {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    background: #000;
}

#mainCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
}

/* --- Terminal / Shell --- */
#terminal-container {
    height: 200px;
    background: #020617;
    border-top: 2px solid var(--border);
    display: flex;
    flex-direction: column;
}

#cmd-output {
    flex-grow: 1;
    padding: 10px 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    overflow-y: auto;
    color: #cbd5e1;
}

.input-line {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #0f172a;
}

.prompt { color: var(--accent); margin-right: 10px; font-weight: bold; }

#cmd-input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    flex-grow: 1;
    font-family: inherit;
}

/* --- Audio Config Card --- */
.config-card {
    max-width: 500px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin: 40px auto;
    border: 1px solid var(--border);
}

.full-select {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 20px 0;
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Sidebar transition logic */
#terminal-sidebar {
    width: 350px;
    transition: width 0.3s ease, opacity 0.2s;
    overflow: hidden;
}

#terminal-sidebar.collapsed {
    width: 0px !important;      /* !important overrides the inline HTML style */
    min-width: 0px !important;  /* Prevents flexbox from keeping it open */
    border-left: none !important;
    opacity: 0;
    pointer-events: none;
    padding: 0 !important;      /* Ensures no internal padding holds space */
    margin: 0 !important;
}

/* Ensure the canvas updates its size instantly */
#video-pane {
    transition: flex-grow 0.3s ease;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-btn.active {
    background-color: #3b82f6; /* Blue highlight */
    border-bottom: 3px solid #fff;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}








        :root { --accent: #6366f1; --bg-dark: #0f172a; --card-bg: #1e293b; }
        .admin-bar { background: #020617; padding: 10px 20px; border-bottom: 2px solid var(--accent); display: flex; justify-content: space-between; align-items: center; }
        .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
        .modal-content { background: var(--card-bg); margin: 10% auto; padding: 25px; width: 400px; border-radius: 12px; border: 1px solid var(--accent); color: white; }

        /* State Card Styles */
/* 1. Define the Animations */
@keyframes neon-glow-available {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); border-color: #10b981; }
    100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); }
}

@keyframes neon-glow-busy {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.5); border-color: #f59e0b; }
    100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.4); }
}

/* 2. Apply to your existing card classes */
.agent-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #334155;
    background: #1e293b; /* Ensure background is solid so glow stands out */
}

/* Available State: Glowing Green */
.card-available {
    border-left: 5px solid #10b981;
    animation: neon-glow-available 2s infinite ease-in-out;
}

/* Busy State: Glowing Amber */
.card-busy {
    border-left: 5px solid #f59e0b;
    animation: neon-glow-busy 2s infinite ease-in-out;
}

/* Hover effect remains, but we elevate the glow */
.agent-card:hover {
    transform: translateY(-8px);
    z-index: 10;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
        .card-busy { border-left: 5px solid #f59e0b; box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.1); }
        .card-offline { border-left: 5px solid #ef4444; filter: grayscale(0.5); }
/* Animation for the "Marching Ants" dashed border */
@keyframes border-dance {
    0% { background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%; }
    100% { background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%; }
}

/* Animation for the blue breathing glow */
@keyframes neon-glow-new {
    0% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.6); border-color: #3b82f6; }
    100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.5); }
}

.card-new {
    border-left: 5px solid #3b82f6 !important;
    border-style: dashed;
    animation: neon-glow-new 1.5s infinite ease-in-out;
    /* Optional: This subtle background tint makes the "New" card feel unique */
    background: linear-gradient(145deg, #1e293b, #1a2333);
}

/* Enhancing the hover for new cards specifically */
.card-new:hover {
    border-style: solid; /* Becomes solid on hover to show readiness */
    transform: scale(1.02);
}
        .status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
        .admin-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
        .tool-btn { background: #334155; border: none; color: #94a3b8; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
        .tool-btn:hover { background: var(--accent); color: white; }

