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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: rgba(18, 18, 26, 0.7);
  --accent-color: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.45);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --glass-border: rgba(255, 255, 255, 0.08);
  --success-color: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger-color: #ef4444;
  --panel-radius: 16px;
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 10, 15, 0.5);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #a5b4fc, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 6px;
  box-shadow: 0 0 12px var(--accent-glow);
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
}

.status-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger-color);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: all 0.3s ease;
}

.status-dot.connected {
  background: var(--success-color);
  box-shadow: 0 0 10px var(--success-glow);
}

main {
  flex: 1;
  display: flex;
  padding: 2rem;
  gap: 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Glassmorphism Panel */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  border-radius: var(--panel-radius);
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  display: flex;
  flex-direction: column;
}

.control-panel {
  width: 380px;
  gap: 1.5rem;
  flex-shrink: 0;
}

.viewport-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  background: rgba(0, 0, 0, 0.4);
}

.viewport-panel:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.viewport-panel:fullscreen #remote-screen {
  border-radius: 0 !important;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p.description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.6);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

/* Viewport stream styling */
#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  cursor: crosshair;
  display: none;
}

.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
  max-width: 400px;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 2rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; box-shadow: 0 0 20px var(--accent-glow); }
  100% { transform: scale(1); opacity: 0.8; }
}

.console-log {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.log-entry {
  color: #38bdf8;
}
.log-entry.info { color: #9ca3af; }
.log-entry.success { color: #34d399; }
.log-entry.error { color: #f87171; }

.room-actions {
  display: flex;
  gap: 0.5rem;
}

/* Tooltip controls for desktop input */
.toolbar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 26, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: auto;
}

.toolbar-item {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

/* Dashboard styles */
.dashboard-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.computers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.computer-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.computer-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

.computer-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent-color);
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: all 0.3s ease;
}

.computer-card:hover .computer-icon {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.computer-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.computer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--success-color);
  font-weight: 500;
}

.computer-status .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success-glow);
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--success-glow); }
  100% { transform: scale(1); opacity: 0.8; }
}

.no-computers-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  border: 2px dashed var(--glass-border);
  border-radius: var(--panel-radius);
  text-align: center;
  gap: 1rem;
  width: 100%;
}

.no-computers-state .empty-icon {
  font-size: 3.5rem;
  opacity: 0.5;
}

/* Modal styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #111119;
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalShow {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #a5b4fc, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Session container layout */
.session-container {
  width: 100%;
  display: flex;
  gap: 2rem;
  min-height: calc(100vh - 160px);
}

.session-sidebar {
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

.session-sidebar h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #a5b4fc;
}
