/* FlinchCast Main Stylesheet - Version 2 */

/* Base Styles */
:root {
  --primary-color: #6200ee;
  --primary-variant: #3700b3;
  --secondary-color: #03dac6;
  --background: #121212;
  --surface: #1e1e1e;
  --error: #cf6679;
  --on-primary: #ffffff;
  --on-secondary: #000000;
  --on-background: #ffffff;
  --on-surface: #ffffff;
  --on-error: #000000;
  --border-color: #333333;
  --text-primary: rgba(255, 255, 255, 0.87);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-disabled: rgba(255, 255, 255, 0.38);
  --card-border-radius: 16px;
  --shadow-main: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

html, body {
  
  font-family: -apple-system, BlinkMacSystemFont, "Orbitron", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background);
  color: var(--on-background);
  line-height: 1.6;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  z-index: -2;
}

#vanta-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: 2.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  z-index: 1;
}

header {
  text-align: center;
  padding: 2rem 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

footer {
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
  color: var(--text-disabled);
  font-size: 0.875rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--on-background);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background-color: var(--primary-variant);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--on-secondary);
}

.btn-secondary:hover {
  background-color: #00b5a3;
}

.btn-danger {
  background-color: var(--error);
  color: var(--on-error);
}

.btn-danger:hover {
  background-color: #b55a68;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(98, 0, 238, 0.1);
}

/* Auth Container */
.auth-container {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  box-shadow: var(--shadow-main);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.tab-content {
  display: none;
}

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

/* Error message */
.error-message {
  background-color: rgba(207, 102, 121, 0.1);
  color: var(--error);
  border-left: 4px solid var(--error);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
}

/* Success message */
.success-message {
  background-color: rgba(3, 218, 198, 0.1);
  color: var(--secondary-color);
  border-left: 4px solid var(--secondary-color);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
}

/* Host Interface */
.host-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  gap: 1.5rem;
}

.host-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--surface);
  padding: 1.25rem;
  border-radius: var(--card-border-radius);
  box-shadow: var(--shadow-main);
  margin-bottom: 1rem;
}

.host-main {
  display: flex;
  gap: 1.5rem;
}

.video-container {
  flex: 2;
  background-color: #000;
  border-radius: var(--card-border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-main);
  aspect-ratio: 16 / 9;
  min-height: 400px;
  position: relative;
}

.queue-container {
  flex: 1;
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
  max-height: 600px;
  overflow-y: auto;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Caller Interface */
.caller-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  gap: 1.5rem;
}

.caller-video {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-main);
  aspect-ratio: 16 / 9;
  min-height: 400px;
  position: relative;
}

.caller-status {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
  margin-bottom: 1rem;
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-online {
  background-color: #4CAF50;
}

.status-waiting {
  background-color: #FFC107;
}

.status-offline {
  background-color: #F44336;
}

/* Queue List */
.queue-list {
  list-style: none;
}

.queue-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.queue-info {
  display: flex;
  flex-direction: column;
}

.queue-name {
  font-weight: 500;
}

.queue-position {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.queue-action {
  display: flex;
  gap: 0.5rem;
}

/* Chat Container */
.chat-container {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  box-shadow: var(--shadow-main);
  margin-top: 1.5rem;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 300px;
}

.chat-header {
  background-color: var(--primary-color);
  color: var(--on-primary);
  padding: 0.75rem 1rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-toggle {
  background: none;
  border: none;
  color: var(--on-primary);
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--on-background);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.chat-send {
  background-color: var(--primary-color);
  color: var(--on-primary);
  border: none;
  border-radius: 8px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  position: relative;
  word-wrap: break-word;
}

.message-sender {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-disabled);
  margin-top: 0.25rem;
  text-align: right;
}

.message-sent {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: var(--on-primary);
  border-bottom-right-radius: 4px;
}

.message-received {
  align-self: flex-start;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--on-background);
  border-bottom-left-radius: 4px;
}

/* Fullscreen button */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container:hover .video-controls,
.caller-video:hover .video-controls {
  opacity: 1;
}

.video-control-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: white;
  transition: background-color 0.2s;
}

.video-control-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.video-control-btn svg {
  width: 20px;
  height: 20px;
}

/* Media Queries */
@media (max-width: 992px) {
  .host-main {
    flex-direction: column;
  }

  .chat-container {
    order: 3;
  }
}

@media (max-width: 768px) {
  .host-main {
    flex-direction: column;
  }
  
  .video-container, .queue-container {
    width: 100%;
  }
  
  .controls {
    justify-content: center;
  }
  
  .host-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 1.5rem;
  }
  
  .btn {
    width: 100%;
  }
  
  .controls {
    flex-direction: column;
  }
  
  .queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .queue-action {
    width: 100%;
    justify-content: space-between;
  }
}

/* Video Elements */
.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
}

.video-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: var(--background);
  color: var(--text-secondary);
  font-size: 1.25rem;
}

/* Show Status */
.show-status {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.show-status.online {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
}

.show-status.offline {
  background-color: rgba(244, 67, 54, 0.1);
  color: #F44336;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
}

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

/* Daily.co container */
.daily-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem;
  border-radius: 12px;
  background-color: var(--surface);
  box-shadow: var(--shadow-main);
  z-index: 1000;
  max-width: 300px;
  transition: transform 0.3s, opacity 0.3s;
  transform: translateY(-100%);
  opacity: 0;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification-info {
  border-left: 4px solid var(--primary-color);
}

.notification-success {
  border-left: 4px solid var(--secondary-color);
}

.notification-error {
  border-left: 4px solid var(--error);
}

/* Chat Toggle */
.chat-collapsed {
  height: 60px;
  overflow: hidden;
}

.chat-expanded {
  height: 300px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.w-100 {
  width: 100%;
}

/* FlinchCast Version 2 - Additional Styles */

/* Active Callers Section */
.active-callers-container {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
  margin-top: 1.5rem;
}

.active-callers-list {
  list-style: none;
}

.active-caller-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.active-caller-info {
  display: flex;
  flex-direction: column;
}

.active-caller-name {
  font-weight: 500;
  display: flex;
  align-items: center;
}

.active-caller-name::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #4CAF50;
  margin-right: 0.5rem;
}

.active-caller-action {
  display: flex;
  gap: 0.5rem;
}

/* Small Buttons */
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Grid Layout for Multiple Callers */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid-item {
  background-color: var(--surface);
  border-radius: var(--card-border-radius);
  overflow: hidden;
  position: relative;
}

.grid-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-item-name span {
  display: flex;
  align-items: center;
}

.grid-item-name .status-indicator {
  margin-right: 0.5rem;
}

/* Status Badge for Ejected, Muted, etc. */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.status-badge.muted {
  background-color: rgba(244, 67, 54, 0.1);
  color: #F44336;
}

.status-badge.video-off {
  background-color: rgba(255, 152, 0, 0.1);
  color: #FF9800;
}

/* Daily.co Video Styles for Multiple Participants */
.daily-container.multi-caller {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .daily-container.multi-caller {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .daily-container.multi-caller.three-plus {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Overrides for call buttons */
.call-buttons-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.call-button {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  border: none;
  color: var(--on-background);
  transition: background-color 0.2s;
}

.call-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.call-button.active {
  background-color: var(--primary-color);
  color: var(--on-primary);
}

.call-button.danger {
  background-color: var(--error);
  color: var(--on-error);
}

.call-button svg {
  width: 24px;
  height: 24px;
}

/* Version badge */
.version-badge {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: var(--on-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 1000;
}