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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

/* Login Screen */
.screen {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  min-width: 360px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-box h1 {
  color: #e94560;
  margin-bottom: 8px;
  font-size: 24px;
}

.login-box p {
  color: #888;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #0f3460;
  border-radius: 8px;
  background: #1a1a2e;
  color: #fff;
  font-size: 16px;
  margin-bottom: 16px;
  outline: none;
}

.login-box input:focus {
  border-color: #e94560;
}

.login-box button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #e94560;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover {
  background: #c73652;
}

.error {
  color: #e94560;
  margin-top: 12px;
  font-size: 14px;
}

/* Toolbar */
#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  padding: 6px 12px;
  height: 44px;
  z-index: 100;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.toolbar-center {
  display: flex;
  gap: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  display: inline-block;
}

.status-dot.disconnected {
  background: #e94560;
}

.tab-btn {
  padding: 6px 16px;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #0f3460;
  color: #fff;
  border-color: #e94560;
}

.tab-btn:hover {
  color: #fff;
}

.toolbar-right label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #888;
}

.toolbar-right input[type="range"] {
  width: 80px;
  accent-color: #e94560;
}

.toolbar-right button {
  padding: 4px 10px;
  border: 1px solid #0f3460;
  border-radius: 4px;
  background: transparent;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 16px;
}

.toolbar-right button:hover {
  background: #0f3460;
}

.clip-sync-btn {
  background: #4caf50 !important;
  color: #fff !important;
  border-color: #4caf50 !important;
  animation: clip-pulse 1s ease-in-out 3;
  font-size: 12px !important;
  padding: 4px 10px !important;
  cursor: pointer;
}

.clip-sync-btn:hover {
  background: #388e3c !important;
}

.clip-sync-btn.copied {
  background: #0f3460 !important;
  border-color: #0f3460 !important;
  animation: none;
}

@keyframes clip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Tab content */
.tab-content {
  display: none;
  width: 100%;
  height: calc(100vh - 44px);
  overflow: auto;
}

.tab-content.active {
  display: block;
}

/* Canvas - MUST fill viewport, no exceptions */
#canvasContainer {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  cursor: default;
  overflow: hidden;
}

#remoteCanvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  image-rendering: auto;
  /* Size set dynamically by fitCanvas() in app.js */
}

#remoteStream {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
}

/* File Transfer */
.file-panel {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.file-section {
  margin-bottom: 32px;
}

.file-section h2 {
  color: #e94560;
  margin-bottom: 12px;
  font-size: 18px;
}

.drop-zone {
  border: 2px dashed #0f3460;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #e94560;
  background: rgba(233, 69, 96, 0.05);
}

.drop-zone p {
  color: #888;
  margin-bottom: 8px;
}

.drop-zone .hint {
  font-size: 12px;
  color: #666;
}

#uploadProgress {
  margin-top: 12px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #16213e;
  border-radius: 6px;
  margin-bottom: 6px;
}

.progress-item .name {
  flex: 1;
  font-size: 14px;
}

.progress-bar {
  width: 200px;
  height: 6px;
  background: #0f3460;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #e94560;
  transition: width 0.3s;
}

.progress-item .percent {
  font-size: 12px;
  color: #888;
  width: 40px;
  text-align: right;
}

.small-btn {
  padding: 4px 12px;
  border: 1px solid #0f3460;
  border-radius: 4px;
  background: transparent;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 12px;
  margin-bottom: 8px;
}

.small-btn:hover {
  background: #0f3460;
}

.file-list {
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #0f3460;
  font-size: 14px;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item .file-name {
  flex: 1;
}

.file-item .file-size {
  color: #888;
  margin-right: 16px;
  font-size: 12px;
}

.file-item .file-date {
  color: #666;
  font-size: 12px;
}

/* Guide */
.guide-section {
  background: #16213e;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #0f3460;
}

.guide h3 {
  color: #4caf50;
  margin: 16px 0 8px;
  font-size: 15px;
}

.guide h3:first-child {
  margin-top: 0;
}

.guide ol {
  padding-left: 24px;
  line-height: 1.8;
  color: #ccc;
  font-size: 14px;
}

.guide kbd {
  background: #0f3460;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid #1a3a6e;
}

/* Clipboard */
.clipboard-panel {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.clipboard-panel h2 {
  color: #e94560;
  margin-bottom: 8px;
}

.clipboard-panel p {
  color: #888;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.paste-area {
  width: 100%;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  background: #16213e;
  border: 2px solid #0f3460;
  border-radius: 8px;
  padding: 16px;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.paste-area:focus {
  border-color: #e94560;
}

.paste-area:empty::before {
  content: attr(placeholder);
  color: #555;
}

.paste-area table {
  border-collapse: collapse;
  margin: 8px 0;
}

.paste-area td, .paste-area th {
  border: 1px solid #0f3460;
  padding: 4px 8px;
}

.clipboard-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.clipboard-actions button {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.clipboard-actions button:hover {
  background: #c73652;
}

.clipboard-actions .secondary-btn {
  background: #0f3460;
}

.clipboard-actions .secondary-btn:hover {
  background: #1a3a6e;
}

#clipboardStatus {
  margin-top: 8px;
  font-size: 13px;
  color: #4caf50;
}

/* Fullscreen */
:fullscreen #toolbar {
  position: fixed;
  top: -44px;
  left: 0;
  right: 0;
  transition: top 0.3s;
  z-index: 1000;
}

:fullscreen #toolbar:hover,
:fullscreen #toolbar.visible {
  top: 0;
}

:fullscreen .tab-content {
  height: 100vh !important;
}

:fullscreen #canvasContainer {
  height: 100vh;
}
