/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #000;
  color: #eee;
  overflow: hidden;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Player container - fullscreen by default */
.player-container {
  background-color: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
}

.player-container.windowed {
  position: fixed;
  top: 0;
  left: 0;
  width: 60vw;
  height: 100vh;
  z-index: 100;
}

.player-placeholder {
  color: #666;
  text-align: center;
  padding: 20px;
}

.player-placeholder p {
  font-size: 1.5rem;
}

/* Media content */
.media-content {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-content.video {
  background-color: #000;
}

.media-content.image {
  background-color: #000;
}

.media-content.placeholder {
  opacity: 0.7;
}

/* Control Panel - shown when ESC is pressed */
.control-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(26, 26, 46, 0.95);
  z-index: 2000;
  overflow-y: auto;
}

.control-panel .app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #16213e;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e94560;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Screen ID display */
.screen-id-label {
  color: #888;
  font-size: 14px;
}

.screen-id-value {
  color: #8ec5fc;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  background-color: #0f3460;
  border-radius: 6px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background-color: #e94560;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #ff6b6b;
}

.btn-secondary {
  background-color: #0f3460;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #1a4f8a;
}

.btn-icon {
  padding: 10px 14px;
  background-color: #0f3460;
  color: white;
  font-size: 18px;
}

.btn-icon:hover {
  background-color: #1a4f8a;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  background-color: #0f3460;
  color: #aaa;
}

.btn-small:hover {
  background-color: #1a4f8a;
  color: white;
}

/* Log panel - standalone in control panel */
.log-panel-standalone {
  flex: 1;
  background-color: #16213e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #0f3460;
  flex-shrink: 0;
}

.log-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #aaa;
}

.log-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* Log entries */
.log-entry {
  padding: 4px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.03);
}

.log-time {
  color: #666;
  margin-right: 8px;
}

.log-message {
  word-break: break-word;
}

.log-info .log-message {
  color: #8ec5fc;
}

.log-warn .log-message {
  color: #ffd93d;
}

.log-error .log-message {
  color: #ff6b6b;
}

.log-success .log-message {
  color: #6bcb77;
}

/* Scrollbar */
.log-container::-webkit-scrollbar {
  width: 8px;
}

.log-container::-webkit-scrollbar-track {
  background: #0f3460;
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
  background: #1a4f8a;
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
  background: #2a6fba;
}

/* Playing state indicator */
body.playing .header {
  border-left: 4px solid #6bcb77;
}

/* ESC hint overlay */
.esc-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #888;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.esc-hint.visible {
  opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .controls {
    flex-wrap: wrap;
  }

  .screen-id-value {
    font-size: 12px;
    padding: 6px 12px;
  }
}
