/* Main CSS file for StreamerU */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #0e0e10;
  color: #efeff1;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #9146ff;
  margin-bottom: 20px;
  font-size: 2.5rem;
  text-shadow: 0 0 10px rgba(145, 70, 255, 0.5);
}

.main-content {
  display: flex;
  gap: 20px;
}

.config-section {
  flex: 1;
  max-width: 350px;
}

.content-section {
  flex: 2;
}

.stream-configuration {
  background-color: #18181b;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #dedee3;
}

.form-group input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #2c2c35;
  background-color: #0e0e10;
  color: #efeff1;
  font-size: 14px;
}

button {
  background-color: #9146ff;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #772ce8;
}

button:disabled {
  background-color: #53535f;
  cursor: not-allowed;
}

.video-chat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.video-recorder-container {
  background-color: #18181b;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background-color: #0e0e10;
}

.camera-feed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.camera-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #53535f;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.controls-container {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-controls {
  display: flex;
  gap: 10px;
}

.control-button {
  flex: 1;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
}

.camera-button {
  background-color: #9146ff;
}

.camera-button:hover {
  background-color: #772ce8;
}

.camera-button.active {
  background-color: #53535f;
}

.record-button {
  background-color: #ff4a4a;
}

.record-button:hover:not(:disabled) {
  background-color: #e03c3c;
}

.record-button.recording {
  background-color: #e03c3c;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.settings-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.quality-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quality-selector select {
  padding: 5px;
  border-radius: 4px;
  background-color: #18181b;
  color: #efeff1;
  border: 1px solid #2c2c35;
}

.chat-container {
  background-color: #18181b;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chat-stream-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 10px 15px;
  background-color: #1f1f23;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2c2c35;
}

.chat-title {
  font-weight: bold;
}

.chat-viewer-count {
  background-color: #ff4a4a;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.chat-messages {
  flex: 1;
  padding: 10px 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  word-break: break-word;
}

.chat-badges {
  display: flex;
  gap: 4px;
  margin-right: 5px;
}

.chat-badge {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: bold;
}

.gift-badge {
  background-color: #ff4a80;
  color: white;
}

.chat-username {
  margin-right: 5px;
  font-weight: bold;
}

.chat-content {
  color: #dedee3;
}

.subscriber-event {
  margin: 5px 0;
  padding: 5px 10px;
  background-color: rgba(145, 70, 255, 0.2);
  border-radius: 4px;
  text-align: center;
}

.subscriber-event-message {
  color: #dedee3;
  font-weight: bold;
}

.gift-subscription-event {
  margin: 5px 0;
  padding: 5px 10px;
  background-color: rgba(255, 74, 128, 0.2);
  border-radius: 4px;
  text-align: center;
}

.gift-event-message {
  color: #dedee3;
  font-weight: bold;
}

.user-chat-input {
  display: flex;
  padding: 10px;
  background-color: #1f1f23;
  border-top: 1px solid #2c2c35;
}

.user-chat-input input {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #2c2c35;
  background-color: #0e0e10;
  color: #efeff1;
  margin-right: 10px;
}

.user-chat-input button {
  background-color: #9146ff;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.subscriber-counter {
  background-color: #18181b;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.counter-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.counter-label {
  font-size: 14px;
  color: #dedee3;
}

.counter-value {
  font-size: 24px;
  font-weight: bold;
  color: #9146ff;
}

.counter-goal {
  font-size: 12px;
  color: #53535f;
}

.progress-bar {
  height: 8px;
  background-color: #2c2c35;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.progress {
  height: 100%;
  background-color: #9146ff;
  width: 50%;
  transition: width 0.3s ease;
}

.subscriber-mode-toggle {
  background-color: #18181b;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.subscriber-mode-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.subscriber-mode-toggle input[type="checkbox"] {
  margin-right: 10px;
  width: 16px;
  height: 16px;
}

.script-display {
  background-color: #18181b;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.script-content {
  background-color: #0e0e10;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  min-height: 100px;
  max-height: 200px;
  overflow-y: auto;
}

.script-navigation {
  display: flex;
  gap: 10px;
}

.script-navigation button {
  flex: 1;
}

#full-screen-btn {
  width: 100%;
  margin-top: 10px;
  background-color: #2c2c35;
}

#full-screen-btn:hover {
  background-color: #3a3a47;
}

.gift-animation-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.gift-event {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff4a80;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInOut 5s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.gift-title {
  font-size: 24px;
  font-weight: bold;
  color: #ff4a80;
  margin-bottom: 10px;
}

.gift-icon {
  font-size: 48px;
  margin-bottom: 10px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.gift-message {
  font-size: 18px;
  color: white;
  text-align: center;
}

.gift-confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #ff4a80;
  animation: confetti 3s ease-in-out forwards;
}

@keyframes confetti {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.floating-gift {
  position: absolute;
  left: 0;
  animation: floatRight 8s linear forwards;
}

@keyframes floatRight {
  0% { transform: translateX(-50px); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  90% { transform: translateX(calc(100vw - 50px)); opacity: 1; }
  100% { transform: translateX(100vw); opacity: 0; }
}

.gift-emoji {
  font-size: 36px;
  animation: spin 2s infinite linear;
}

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

.fullscreen-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 9999;
  display: none;
}

.in-fullscreen .fullscreen-container {
  display: block;
}

.fullscreen-layout {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.fullscreen-video-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.fullscreen-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fullscreen-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #53535f;
  background-color: #0e0e10;
}

.fullscreen-chat-container {
  position: absolute;
  background-color: rgba(24, 24, 27, 0.8);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.fullscreen-chat-container.position-right {
  top: 20px;
  right: 20px;
  width: 300px;
  height: calc(100% - 40px);
}

.fullscreen-chat-container.position-left {
  top: 20px;
  left: 20px;
  width: 300px;
  height: calc(100% - 40px);
}

.fullscreen-chat-container.position-bottom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, calc(100% - 40px));
  height: 200px;
}

.fullscreen-chat-header {
  padding: 10px 15px;
  background-color: rgba(31, 31, 35, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2c2c35;
}

.fullscreen-chat {
  flex: 1;
  padding: 10px 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fullscreen-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
}

.overlay-position-controls {
  display: flex;
  gap: 5px;
}

.position-button {
  background-color: rgba(44, 44, 53, 0.8);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.position-button:hover {
  background-color: rgba(58, 58, 71, 0.8);
}

.fullscreen-exit-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: rgba(255, 74, 74, 0.8);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 1001;
}

.fullscreen-exit-button:hover {
  background-color: rgba(224, 60, 60, 0.8);
}

.camera-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 14, 16, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  z-index: 10;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.camera-error h3 {
  color: #ff4a4a;
  margin-bottom: 10px;
}

.error-actions {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.retry-button {
  background-color: #9146ff;
}

.fallback-button {
  background-color: #2c2c35;
}

.error-help {
  max-width: 400px;
  text-align: left;
  font-size: 14px;
  color: #dedee3;
}

.error-help ol {
  margin-top: 5px;
  padding-left: 20px;
}

.recording-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.recording-dot {
  width: 12px;
  height: 12px;
  background-color: #ff4a4a;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.recording-time {
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.download-button {
  background-color: #00b5ad;
  margin-top: 10px;
}

.download-button:hover {
  background-color: #00a19a;
}

.secondary-controls {
  margin-top: 10px;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  
  .config-section {
    max-width: 100%;
  }
  
  .fullscreen-chat-container.position-right,
  .fullscreen-chat-container.position-left {
    width: 250px;
  }
  
  .fullscreen-chat-container.position-bottom {
    height: 150px;
  }
}


/* Camera Loading Animation */
.camera-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(24, 24, 27, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #333;
  border-top: 4px solid #9146ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

.camera-loading p {
  color: #efeff1;
  font-size: 16px;
  margin: 0;
  text-align: center;
}


/* Speech Recognition Styles */
.speech-recognition-toggle {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #2c2c35;
  border-radius: 6px;
}

.speech-recognition-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  color: #dedee3;
}

.speech-recognition-toggle input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
}

.speech-status {
  margin-top: 8px;
  padding: 5px 10px;
  background-color: rgba(255, 0, 0, 0.1);
  border: 1px solid #ff4444;
  border-radius: 4px;
  font-size: 12px;
}

#speech-indicator {
  color: #ff4444;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}



/* Overlay Mode Styles */
.overlay-mode-controls {
  margin-bottom: 10px;
}

.overlay-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #efeff1;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  background-color: rgba(24, 24, 27, 0.8);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.overlay-mode-toggle:hover {
  background-color: rgba(31, 31, 35, 0.8);
}

.overlay-mode-toggle input[type="checkbox"] {
  margin: 0;
  margin-right: 5px;
}

/* Overlay mode indicator */
.overlay-mode-indicator {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* Enhanced chat styling for overlay mode */
.fullscreen-chat-container.overlay-active {
  background: transparent !important;
  box-shadow: none !important;
}

.fullscreen-chat-container.overlay-active .chat-message {
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(5px);
  border-radius: 4px;
  padding: 6px 10px;
  margin: 2px 0;
}

.fullscreen-chat-container.overlay-active .fullscreen-chat-header {
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(10px);
}

