/* Global styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background-color: #121212;
  color: #ffffff;
  line-height: 1.6;
  height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Full-screen TV layout */
.full-screen {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* Main page overlay (golden ratio: bottom-right) */
.overlay {
  position: absolute;
  bottom: 10%;
  right: 10%;
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 20px;
  padding: 25px;
  width: 350px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.overlay .profile-pic {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #ffffff;
}

.overlay button {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 15px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #007bff, #00d4ff);
  color: #ffffff;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.overlay button:hover {
  background: linear-gradient(135deg, #0056b3, #00aaff);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.5);
}

#qrCode {
  margin-top: 25px;
  display: none;
}

/* Host page grid */
.host-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;   /* Main show twice as wide as guest videos */
  grid-template-rows: 2fr 1fr;      /* Top row taller */
  gap: 20px;
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
}

.host-grid > div {
  background-color: #2c2c2c;
  border-radius: 10px;
  padding: 15px;
  overflow: hidden;
}

.host-grid > div:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.host-grid h2 {
  margin: 0 0 10px;
  font-size: 1.5em;
}

/* Main show video */
#mainShow {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Guest video section */
#guestStream {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columns */
  grid-template-rows: 1fr 1fr;    /* 2 rows */
  gap: 10px;
  justify-items: center;
  align-items: center;
  height: 100%;
  position: relative;
  background: #2c2c2c;
  border-radius: 10px;
  padding: 10px;
}

.guest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 10px;
}

.guest-container {
  position: relative;
  width: 160px;
  height: 160px;
}

.guest-video {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  background: #000;
  border: 2px solid #333;
}

.guest-avatar {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
  background-color: #ccc;
}

/* Waitlist container */
.waitlist-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.waitlist-container h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #ffffff;
}

/* Waitlist and questions */
#waitlist, #questions {
  max-height: 80%;
  overflow-y: auto;
  width: 100%;
  max-width: 400px;
  padding: 0 10px;
  box-sizing: border-box;
}

.waitlist-entry, .question-entry {
  background-color: #3a3a3a;
  padding: 10px;
  margin: 5px 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  color: #ddd;
}

.waitlist-entry img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
}

.logo {
  position: relative;
  top: 20px;
  margin: 50px;
  width: 200px;
  height: auto;
  z-index: 1000;
}


#inviteBtn {
  position: relative;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #007bff, #00d4ff);
  color: #ffffff;
  cursor: pointer;
  margin-top: 10px;
}

#inviteBtn:hover {
  position: relative;
  background: linear-gradient(135deg, #0056b3, #00aaff);
}

/* Video preview */
.video-preview {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: block;
}

.phone-simulator {
  width: 390px; /* iPhone 14 width */
  height: 844px; /* iPhone 14 height */
  margin: 40px auto;
  border: 16px solid #333;
  border-radius: 40px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
}

.waitlist-container {
  flex: 1;
  overflow-y: auto;
  background: #111; /* match your app's background */
  color: white;
  padding: 20px;
}


/* Button Group Layout */
.button-group {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.loading-bars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buttons-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Loading Bar Styles */
.loading-bar {
  width: 100%;
  text-align: center;
  color: white;
  font-size: 22px;
  padding-bottom: 20px;

}

.loading-bar p {
  margin: 0 0 5px 0;
  opacity: 0.9;
}

.progress-bar {
  width: 50%;
  left: 50%;
  transform: translateX(-50%);
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress {
  height: 100%;
  background: #007AFF;
  animation: loading 2s infinite linear;
}

.button-loading-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.button-progress {
  height: 100%;
  background: #007AFF;
  animation: buttonLoading 2s infinite linear;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes buttonLoading {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

/* Button Styles */
.record-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  background: #007AFF;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.record-btn i:first-child {
  font-size: 18px;
  margin-right: 8px;
}

.record-btn i:last-child {
  font-size: 16px;
  margin-left: 8px;
}

.button-text {
  flex: 1;
  text-align: center;
  margin: 0 8px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .button-group {
    padding: 10px;
    gap: 10px;
  }

  .record-btn {
    min-width: 160px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .loading-bar p {
    font-size: 12px;
  }
}

/* Fixed Header */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.95));
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease-in-out;
}

.fixed-header.mini {
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.95);
}

.fixed-header.mini .header-logo {
  height: 40px;
  margin: 0;
  transition: all 0.3s ease-in-out;
}

.fixed-header.mini .header-text h1 {
  font-size: 1.4rem;
  margin: 0;
}

.fixed-header.mini .header-text h3 {
  font-size: 0.9rem;
  margin: 2px 0 0 0;
}

.fixed-header.mini .header-stats {
  padding: 6px 12px;
  gap: 15px;
}

.fixed-header.mini .stat-item {
  font-size: 0.85rem;
}

.fixed-header.mini .stat-item i {
  font-size: 1rem;
}

.fixed-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
  transition: all 0.3s ease-in-out;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  height: 75px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.header-logo:hover {
  transform: scale(1.05);
}

.header-text {
  flex: 1;
}

.header-text h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
  background: linear-gradient(45deg, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-text h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
  color: #ffffff;
}


.header-right {
  display: flex;
  align-items: center;
}

.header-stats {
  display: flex;
  gap: 20px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.stat-item i {
  font-size: 1.1rem;
  color: #ffffff;
}

.stat-count {
  font-weight: 600;
  background: linear-gradient(45deg, #007AFF, #00C6FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Adjust main container to account for fixed header */
.waitlist-container {
  padding-top: 90px;
}

/* Mobile adjustments for header */
@media (max-width: 768px) {
  .fixed-header.mini {
    padding: 6px 15px;
  }

  .fixed-header.mini .header-logo {
    height: 35px;
  }

  .fixed-header.mini .header-text h1 {
    font-size: 1.2rem;
  }

  .fixed-header.mini .header-text h3 {
    font-size: 0.8rem;
  }

  .fixed-header.mini .header-stats {
    padding: 4px 10px;
    gap: 12px;
  }

  .fixed-header.mini .stat-item {
    font-size: 0.8rem;
  }

  .waitlist-container {
    padding-top: 140px;
  }
}

@media (max-width: 480px) {
  .fixed-header.mini {
    padding: 5px 12px;
  }

  .fixed-header.mini .header-logo {
    height: 30px;
  }

  .fixed-header.mini .header-text h1 {
    font-size: 1.1rem;
  }

  .fixed-header.mini .header-text h3 {
    font-size: 0.75rem;
  }

  .fixed-header.mini .header-stats {
    padding: 3px 8px;
    gap: 10px;
  }

  .fixed-header.mini .stat-item {
    font-size: 0.75rem;
  }

  .waitlist-container {
    padding-top: 40px;
  }
}

/* Update button styles for new icons */
.record-btn i {
  font-size: 18px;
  margin-right: 8px;
}

/* Adjust video preview spacing */
.video-preview {
  margin: 20px 0;
}

/* Ensure proper spacing between fixed elements */
#waitlist {
  padding-bottom: 80px;
}

/* Button Loading Bar */
.button-loading-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.button-loading-bar {
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.button-progress {
  height: 100%;
  background: #007AFF;
  width: 0%;
  transition: width 0.3s ease;
  animation: buttonLoading 2s infinite linear;
}

@keyframes buttonLoading {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

/* Update button group for better spacing with loading bar */
.button-group {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* Ensure loading bar appears above button */
.button-loading-container {
  z-index: 1001;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .button-loading-bar {
    top: -3px;
    height: 2px;
  }
}