:root {
  --bg-primary: #0b0d10;
  --bg-secondary: #13171e;
  --bg-tertiary: #1b202a;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --success-color: #10b981;
  --success-hover: #059669;
  
  --glass-bg: rgba(19, 23, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  background-color: #fff;
  padding-top:5%;
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styles */
.sidebar {
  width: 320px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 700;
}

select {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:focus {
  border-color: var(--primary-color);
}

/* Buttons */
button {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #242b38;
}

.btn-danger {
  background-color: var(--danger-color);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Status Badge */
.status-badge {
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.status-badge.stopped {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.status-badge.running {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* Helpers */
.input-helper-group {
  display: flex;
  gap: 8px;
}

.input-helper-group input {
  flex-grow: 1;
  padding: 10px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 13px;
}

.input-helper-group input:focus {
  border-color: var(--primary-color);
}

.keyboard-buttons {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.kbd-btn {
  flex-grow: 1;
  padding: 8px 10px;
  font-size: 11px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 6px;
}

.kbd-btn:hover {
  background-color: #242b38;
  color: #fff;
}

.hint-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}

/* Main Workspace */
.workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Browser Header */
.browser-header {
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.nav-controls {
  display: flex;
  gap: 8px;
}

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
}

.nav-btn:hover {
  background-color: #242b38;
}

.address-bar {
  flex-grow: 1;
  max-width: 600px;
  height: 36px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.secure-icon {
  font-size: 12px;
  color: var(--success-color);
}

.address-bar input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-size: 13px;
}

.title-bar {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: auto;
  font-weight: 500;
}

/* Screencast Viewer Area */
.viewer-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px;
  position: relative;
  background-color: #080a0c;
}

.screen-wrapper {
  position: relative;
  width: 100%;
  /* max-width: 420px; */
  aspect-ratio: 1280 / 840;
  background-color: #fff;
  /* border-radius: 12px; */
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#screencast-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: crosshair;
  transition: opacity 0.3s;
}

#screencast-image.inactive {
  opacity: 0.15;
}

/* Loading Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.overlay p {
  font-weight: 500;
  font-size: 15px;
  color: #fff;
}

/* Active profile details */
.active-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 8px;
}

.active-profile-info span {
  color: var(--text-secondary);
}

.active-profile-info strong {
  color: #fff;
  word-break: break-all;
}

/* Direct auto-login form */
.direct-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.direct-login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.direct-login-form input {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.direct-login-form input:focus {
  border-color: var(--primary-color);
}

.direct-login-form button {
  margin-top: 4px;
}

/* Log Console & Command Input Styles */
.console-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-console {
  height: 160px;
  background-color: #080a0c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.log-console::-webkit-scrollbar {
  width: 4px;
}

.log-console::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.log-line {
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

.log-line.system {
  color: var(--primary-color);
  font-weight: bold;
}

.log-line b {
  color: #fff;
  font-weight: 600;
}

.log-line code {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  color: #fca5a5;
  font-family: monospace;
}

.log-cmd {
  color: var(--success-color);
  font-weight: bold;
}

.cmd-group {
  margin-top: 4px;
}

.cmd-group input {
  font-family: 'Courier New', Courier, monospace;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width:420px;
    height:640px;
    max-width: 90%;
    position: relative;
    animation: popupShow 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.popup-content h2 {
    margin-bottom: 12px;
}

.popup-content p {
    margin-bottom: 20px;
}

#confirmBtn {
    padding: 10px 20px;
    border: none;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

#confirmBtn:hover {
    background: #1d4ed8;
}

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