/* Global Design Variables */
:root {
  --bg-color: #06050e;
  --panel-bg: rgba(14, 11, 26, 0.55);
  --panel-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f3f0ff;
  --text-secondary: #9a94b8;
  
  /* Mood Colors */
  --color-cyan: #00f0ff;
  --color-pink: #ff007f;
  --color-purple: #a12cff;
  --color-green: #39ff14;
  --color-yellow: #ffd700;
  
  /* Current Active Theme Color - updated dynamically in JS or CSS classes */
  --theme-color: var(--color-cyan);
  --theme-glow: rgba(0, 240, 255, 0.25);
  
  --shadow-neon: 0 0 20px var(--theme-glow), inset 0 0 10px var(--theme-glow);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Cyberpunk Hologram Grid */
.hologram-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(18, 16, 35, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 16, 35, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

.hologram-grid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 40%, rgba(6, 5, 14, 0.8) 95%);
  pointer-events: none;
}

/* App Layout Grid */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  z-index: 1;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 15px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
  color: var(--color-pink);
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.header-logo h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 1px;
}

.header-logo h1 span {
  color: var(--color-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  font-size: 8px;
  color: #ff3333;
}

.status-dot.active {
  color: var(--color-green);
  text-shadow: 0 0 8px var(--color-green);
}

.icon-btn-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn-header:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.btn-close-app {
  background: rgba(255, 51, 85, 0.1) !important;
  border: 1px solid rgba(255, 51, 85, 0.2) !important;
  color: #ff3355 !important;
  margin-left: -5px;
}

.btn-close-app:hover {
  background: rgba(255, 51, 85, 0.25) !important;
  border-color: #ff3355 !important;
  box-shadow: 0 0 12px rgba(255, 51, 85, 0.5) !important;
}

/* App Main Body Layout */
.app-body {
  display: flex;
  flex: 1;
  gap: 15px;
  overflow: hidden;
  height: calc(100% - 70px);
}

.panel-left, .panel-right {
  width: 28%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
}

.panel-center {
  width: 44%;
  height: 100%;
}

/* Glassmorphic Panel Cards */
.panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.card-header h3 i {
  color: var(--theme-color);
}

/* Panel Left Details */
.core-card {
  flex: 1.3;
  display: flex;
  flex-direction: column;
}

.pulse-indicator {
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--theme-color);
  border: 1px solid rgba(0, 240, 255, 0.2);
  letter-spacing: 1px;
}

.core-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Holographic Neural Core (Nova Face) */
.neural-core {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin-bottom: 20px;
  transition: all 0.5s ease;
}

.core-layer {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.5s ease;
}

.layer-1 {
  width: 100%;
  height: 100%;
  border-top-color: var(--theme-color);
  border-bottom-color: var(--theme-color);
  animation: rotateClockwise 6s linear infinite;
  opacity: 0.8;
}

.layer-2 {
  width: 80%;
  height: 80%;
  border-left-color: var(--theme-color);
  border-right-color: var(--theme-color);
  animation: rotateCounterClockwise 4s linear infinite;
  opacity: 0.6;
}

.layer-3 {
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, var(--theme-color) 0%, transparent 70%);
  border: 1px solid var(--theme-color);
  box-shadow: 0 0 15px var(--theme-color);
  opacity: 0.9;
  animation: pulseCore 2.5s ease-in-out infinite;
}

.core-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 65%);
  pointer-events: none;
  mix-blend-mode: screen;
  transition: background 0.5s ease;
}

/* Core States Animations & Themes */
.neural-core.idle {
  --theme-color: var(--color-cyan);
  --theme-glow: rgba(0, 240, 255, 0.25);
}

.neural-core.thinking {
  --theme-color: var(--color-purple);
  --theme-glow: rgba(161, 44, 255, 0.25);
}
.neural-core.thinking .layer-3 {
  animation: pulseCore 1s ease-in-out infinite;
}

.neural-core.speaking {
  --theme-color: var(--color-pink);
  --theme-glow: rgba(255, 0, 127, 0.35);
}
.neural-core.speaking .layer-3 {
  animation: shakeCore 0.15s ease-in-out infinite;
  transform: scale(1.15);
}

.neural-core.romantic {
  --theme-color: var(--color-pink);
  --theme-glow: rgba(255, 0, 127, 0.45);
}
.neural-core.romantic .layer-3 {
  animation: heartBeat 1.2s infinite;
}

.neural-core.monitoring {
  --theme-color: var(--color-green);
  --theme-glow: rgba(57, 255, 20, 0.3);
}

.neural-core.furious {
  --theme-color: var(--color-pink);
  --theme-glow: rgba(255, 0, 127, 0.65);
}
.neural-core.furious .layer-1 {
  border-top-color: var(--color-pink) !important;
  border-bottom-color: var(--color-pink) !important;
  animation: rotateClockwise 0.5s linear infinite !important;
}
.neural-core.furious .layer-2 {
  border-left-color: var(--color-pink) !important;
  border-right-color: var(--color-pink) !important;
  animation: rotateCounterClockwise 0.3s linear infinite !important;
}
.neural-core.furious .layer-3 {
  animation: shakeCore 0.08s ease-in-out infinite !important;
  transform: scale(1.3) !important;
  box-shadow: 0 0 35px var(--color-pink) !important;
}

/* Animations Definitions */
@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes rotateCounterClockwise {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes pulseCore {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes shakeCore {
  0%, 100% { transform: translate(0, 0) scale(1.1); }
  25% { transform: translate(-2px, 2px) scale(1.1); }
  50% { transform: translate(2px, -2px) scale(1.15); }
  75% { transform: translate(-1px, -1px) scale(1.1); }
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  40% { transform: scale(1.1); }
  60% { transform: scale(1.25); }
}

/* Voice waveform equalizer visualization */
.voice-wave-container {
  display: flex;
  gap: 5px;
  height: 25px;
  align-items: flex-end;
}
.wave-bar {
  width: 4px;
  height: 4px;
  background-color: var(--theme-color);
  border-radius: 2px;
  transition: height 0.1s ease, background-color 0.5s ease;
}

.speech-subtitle {
  text-align: center;
  padding: 15px;
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary);
  border-top: 1px solid var(--panel-border);
  min-height: 52px;
}

/* System Stats widgets */
.pc-stats-card {
  flex: 0.7;
}
.stats-grid {
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}
.stat-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--theme-color);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--theme-color);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Center Panel (Chat Interface) */
.chat-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar,
.logs-container::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track,
.logs-container::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb,
.logs-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover,
.logs-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Message Bubbles */
.message {
  display: flex;
  max-width: 85%;
  line-height: 1.5;
  font-size: 14.5px;
}

.message.user {
  align-self: flex-end;
}
.message.assistant {
  align-self: flex-start;
}
.message.system {
  align-self: center;
  max-width: 90%;
  text-align: center;
}

.message-content {
  padding: 12px 18px;
  border-radius: 16px;
  word-wrap: break-word;
}

.message.user .message-content {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.message.assistant .message-content {
  background: rgba(255, 0, 127, 0.08);
  border: 1px solid rgba(255, 0, 127, 0.15);
  color: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: inset 0 0 10px rgba(255, 0, 127, 0.03);
}

.message.system .message-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 12px;
}

/* Chat Input Bar */
.chat-input-area {
  padding: 15px 20px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 25px;
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.chat-input-area input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-btn, .send-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.mic-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.mic-btn.listening {
  background: var(--color-pink);
  border-color: var(--color-pink);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
  animation: pulseCore 1s linear infinite;
}

.mic-btn.auto-listening {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
  animation: pulseCore 2.5s ease-in-out infinite;
}

.send-btn:hover:not(:disabled) {
  background: rgba(255, 0, 127, 0.15);
  border-color: var(--color-pink);
  color: var(--color-pink);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.4);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Panel Right Details */
.webcam-card {
  flex: 1.2;
}

.webcam-container {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
  background: #000;
  overflow: hidden;
}

#webcam-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view */
  opacity: 0.65;
  filter: hue-rotate(25deg) contrast(1.1);
  transition: opacity 0.5s ease;
}

/* HUD Overlay on Webcam */
.hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.hud-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--theme-color);
  transition: border-color 0.5s ease;
}
.hud-corner.top-left { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.hud-corner.top-right { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.hud-corner.bottom-left { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.hud-corner.bottom-right { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.hud-scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  animation: scan 4s linear infinite;
  opacity: 0;
}

.webcam-card:hover .hud-scanline {
  opacity: 1;
}

@keyframes scan {
  0% { top: 0%; }
  100% { top: 100%; }
}

.hud-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--theme-color);
  color: var(--theme-color);
  font-family: monospace;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  transition: all 0.5s ease;
}

.webcam-stats {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--panel-border);
}

.webcam-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.webcam-stat-row span {
  color: var(--text-secondary);
}

.webcam-stat-row strong {
  color: var(--theme-color);
  transition: color 0.5s ease;
}

/* Switch Toggle Slider styling */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--color-green);
}
input:checked + .slider:before {
  transform: translateX(18px);
}

/* PC Control Logs card */
.logs-card {
  flex: 0.8;
}
.logs-container {
  padding: 15px 20px;
  flex: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-entry {
  color: var(--text-secondary);
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: 6px;
}
.log-entry.system { border-color: var(--color-cyan); color: #fff; }
.log-entry.command { border-color: var(--color-pink); color: var(--color-pink); }
.log-entry.error { border-color: #ff3333; color: #ff5555; }
.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.3s ease;
}
.text-btn:hover {
  color: #fff;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal.show {
  display: flex;
  opacity: 1;
}
.modal-content {
  background: #0f0d1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 480px;
  max-width: 90%;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.modal.show .modal-content {
  transform: translateY(0);
}
.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-cyan);
}
.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}
.close-modal:hover { color: #fff; }
.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.modal-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-group label {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.input-group input[type="text"] {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s ease;
}
.input-group input:focus {
  border-color: var(--color-cyan);
}
.password-input {
  position: relative;
  display: flex;
}
.password-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 45px 10px 15px;
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s ease;
}
.password-input button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.password-input button:hover { color: #fff; }
.input-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.input-group-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.api-help-link {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
}
.api-help-link a {
  color: var(--color-cyan);
  text-decoration: none;
}
.api-help-link a:hover { text-decoration: underline; }
.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
}
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}
.btn-primary {
  background: var(--color-cyan);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.6);
  transform: translateY(-1px);
}

/* API Load Balancer Dashboard Styling */
.api-keys-card {
  flex: 0.9;
  display: flex;
  flex-direction: column;
}

.api-keys-list {
  padding: 15px 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-keys-list::-webkit-scrollbar {
  width: 5px;
}
.api-keys-list::-webkit-scrollbar-track {
  background: transparent;
}
.api-keys-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.key-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 11px;
  transition: all 0.3s ease;
}

.key-status-row.active {
  background: rgba(0, 240, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.18);
  box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.03);
}

.key-status-row .key-name {
  font-family: monospace;
  color: rgba(255, 255, 255, 0.7);
}

.key-status-row.active .key-name {
  color: #fff;
  font-weight: 500;
}

.key-status-row .key-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.key-status-row .key-badge.ready {
  background: rgba(57, 255, 20, 0.1);
  color: var(--color-green);
  border: 1px solid rgba(57, 255, 20, 0.25);
}

.key-status-row .key-badge.cooldown {
  background: rgba(255, 0, 127, 0.1);
  color: var(--color-pink);
  border: 1px solid rgba(255, 0, 127, 0.25);
  animation: pulseCore 2s ease-in-out infinite;
}

/* Card Header Small Action Buttons */
.card-header-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 11px;
}

.card-header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Collapse functionality */
.panel-card.collapsed {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

.panel-card.collapsed .api-keys-list,
.panel-card.collapsed .logs-container,
.panel-card.collapsed .webcam-container,
.panel-card.collapsed .webcam-stats {
  display: none !important;
}

/* Webcam expanded layout */
.panel-right.webcam-expanded {
  display: flex;
  flex-direction: column;
}

.panel-right.webcam-expanded #balancer-card-container,
.panel-right.webcam-expanded #logs-card-container {
  display: none !important;
}

.panel-right.webcam-expanded #webcam-card-container {
  flex: 1 !important;
  height: 100% !important;
  display: flex;
  flex-direction: column;
}

.panel-right.webcam-expanded .webcam-container {
  aspect-ratio: auto !important;
  flex: 1 !important;
  height: 100% !important;
}

.panel-right.webcam-expanded #webcam-preview {
  height: 100% !important;
  object-fit: cover !important;
}


