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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 2.5rem;
  font-weight: 700;
}

.status-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-label {
  font-weight: 600;
  color: #555;
}

.status-value {
  font-weight: 700;
  color: #2c3e50;
}

.status-value.connected {
  color: #27ae60;
}

.status-value.disconnected {
  color: #e74c3c;
}

.status-value.online {
  color: #27ae60;
}

.status-value.offline {
  color: #e74c3c;
}

.status-value.permission {
  color: #f39c12;
  animation: pulse 2s infinite;
}

.connection-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e74c3c;
  animation: pulse 2s infinite;
  transition: background-color 0.3s ease;
}

.indicator-dot.connected {
  background: #27ae60;
  animation: none;
}

.indicator-dot.connecting {
  background: #f39c12;
  animation: pulse 1s infinite;
}

#connection-text {
  font-weight: 600;
  color: #2c3e50;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.screen-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.loading {
  text-align: center;
  color: #666;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.screen-canvas {
  max-width: 100%;
  max-height: 600px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.screen-canvas:hover {
  transform: scale(1.02);
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.control-group {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.frame-rate-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 25px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.frame-rate-controls label {
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
}

.slider {
  width: 150px;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

#frame-rate-value {
  font-weight: 700;
  color: #2c3e50;
  min-width: 60px;
  text-align: center;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.btn-small:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.6);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.btn-outline {
  background: transparent;
  color: #2c3e50;
  border: 2px solid #2c3e50;
}

.btn-outline:hover:not(:disabled) {
  background: #2c3e50;
  color: white;
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

.info-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.info-panel h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  text-align: center;
  font-size: 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-label {
  font-weight: 600;
  color: #555;
}

.info-value {
  font-weight: 700;
  color: #2c3e50;
}

footer {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* Fullscreen styles */
.screen-container:fullscreen {
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.screen-container:fullscreen .screen-canvas {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.screen-container:fullscreen .controls,
.screen-container:fullscreen .info-panel,
.screen-container:fullscreen header,
.screen-container:fullscreen footer {
  display: none;
}

/* Fallback for older browsers */
.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen .screen-canvas {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
      padding: 10px;
  }

  header h1 {
      font-size: 2rem;
  }

  .status-bar {
      gap: 15px;
  }

  .status-item {
      padding: 6px 12px;
      font-size: 14px;
  }

  .controls {
      gap: 10px;
  }

  .btn {
      padding: 10px 20px;
      font-size: 14px;
  }

  .info-grid {
      grid-template-columns: 1fr;
  }
}

/* Animation for connection status */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.status-value.connecting {
  animation: pulse 1s infinite;
  color: #f39c12;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  animation: slideIn 0.3s ease-out;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-info {
  background-color: #2196F3;
}

.notification-success {
  background-color: #4CAF50;
}

.notification-error {
  background-color: #f44336;
}

.notification-warning {
  background-color: #ff9800;
}

@keyframes slideIn {
  from {
      transform: translateX(100%);
      opacity: 0;
  }
  to {
      transform: translateX(0);
      opacity: 1;
  }
} 

/* Tooltip styles */
[title] {
  position: relative;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
}

[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  margin-bottom: -5px;
} 

/* Fullscreen indicator */
.fullscreen-indicator {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10001;
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.fullscreen-indicator.show {
  display: block;
}

@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px);
  }
  to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
  }
} 

/* Permission dialog styles */
.permission-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-out;
}

.permission-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.permission-content h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.permission-content p {
  color: #555;
  margin-bottom: 10px;
  line-height: 1.5;
}

.permission-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.permission-buttons .btn {
  min-width: 120px;
} 

.status-success {
  color: #28a745 !important;
}

.status-error {
  color: #dc3545 !important;
}

.status-info {
  color: #17a2b8 !important;
}

.status-warning {
  color: #ffc107 !important;
} 