/* Base layout */
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }
  
  /* Controls */
  button {
    margin: 5px;
    padding: 10px;
  }
  
  /* Info text */
  #info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
  }

  #youText {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: bold;
    font-style: italic;
    color: #5CBDF2;
  }
  
  /* Nav */
  #navContainer {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  
  /* Small status text */
  #msg {
    margin-left: 8px;
    font-size: 0.9em;
  }
  
  :root {
    --bg: #F3F4F6;
    --fg: #1B2F6E;
    --text: #0f172a;
    --muted: #475569;
    --card: #F3F4F6;
    --primary: #5CBDF2;
    --primary-600: #3AA8E5;
    --secondary: #ffffff;
    --secondary-600: #f1f5f9;
    --ring: rgba(92,189,242,0.25);
    --danger: #ef4444;
    --danger-600: #dc2626;
  }
  
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Global overflow prevention */
body, main, section, div, header, footer, nav {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Prevent any element from being wider than viewport */
* {
  max-width: 100%;
}

/* Enhanced text wrapping for all text elements */
p, h1, h2, h3, h4, h5, h6, span, div, li, blockquote {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
  
.container {
  width: 100%;
  max-width: 100vw;
  padding: 0 clamp(8px, 4vw, 16px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}
  
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100vw;
  background: var(--primary);
  backdrop-filter: saturate(1.2) blur(6px);
  box-sizing: border-box;
  overflow: hidden;
}
  
.header-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin: 8px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
  
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-left: clamp(4px, 2vw, 10px);
  flex-shrink: 0;
}
  
.nav {
  display: flex;
  gap: clamp(4px, 2vw, 8px);
  margin-right: clamp(4px, 2vw, 10px);
  padding-right: clamp(4px, 2vw, 13px);
  flex-shrink: 1;
  min-width: 0;
}
  
.hero {
  width: 80%;
  padding: 68px 0 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero h1 {
  margin: 0 0 12px 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.2;
}

.subhead {
  margin: 30px 0;
  max-width: 80%;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
}

.cta {
  margin-top: 6vh;
  margin-bottom: 6vh;
}

#ctaButton {
  padding: 18px 22px;
  font-size: 20px;
}

.trust-minis {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 16px;
  flex-wrap: wrap;
}
  
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 0 28px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
  
  .feature {
    padding: 16px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
  }
  
  .feature h3 {
    margin: 0 0 8px;
    font-size: 18px;
  }
  
  .feature p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
  }
  
  .how-it-works {
    padding: 40px 0;
    text-align: center;
  }
  
  .how-it-works h2 {
    margin: 0 0 24px;
    font-size: 32px;
  }
  
  .steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .steps li {
    padding: 16px;
    border: 1px solid #F9FAFB;
    border-radius: 12px;
    box-shadow: 0 0 12px #F9FAFB;
    background: var(--card);
    text-align: left;
  }
  
  .steps strong {
    color: var(--primary);
  }
  
  .testimonial {
    padding: 40px 0;
    text-align: center;
    background: var(--card);
    border-top: 1px solid #F9FAFB;
  }
  
  .testimonial blockquote {
    margin: 0 auto;
    max-width: 600px;
    font-size: 20px;
    font-style: italic;
    color: var(--text);
    line-height: 1.5;
  }
  
  .testimonial cite {
    display: block;
    margin-top: 16px;
    color: var(--muted);
    font-size: 16px;
  }
  
.site-footer {
  width: 100%;
  max-width: 100vw;
  padding: 20px 0;
  border-top: 1px solid var(--bg);
  background: var(--primary);
  color: #F9FAFB;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  overflow: hidden;
}
  
.mini-links {
  display: flex;
  gap: clamp(8px, 4vw, 16px);
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}
  
  .mini-links a {
    color: #F9FAFB;
    text-decoration: none;
  }
  
  .mini-links a:hover {
    color: var(--primary);
  }
  
  .fineprint {
    text-align: center;
    font-size: 14px;
  }
  
  /* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 3px var(--bg);
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
  
  .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 9px #F9FAFB;
  }
  
  .btn:active {
    transform: translateY(0);
  }
  
  .btn-primary {
    background: var(--primary);
    color: #fff;
  }
  
  .btn-primary:hover { background: var(--primary-600); }
  
  .btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid #e5eaf0;
  }
  
  .btn-ghost:hover {
    background: var(--bg);
    border-color: var(--primary);
  }
  
  .btn-danger {
    background: var(--danger);
    color: #fff;
  }
  .btn-danger:hover { background: var(--danger-600); }
  
  .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }
  
  .btn[disabled]:hover, .btn[aria-disabled="true"]:hover { box-shadow: none; }
  
  .btn-lg { 
    padding: 14px 18px; 
    font-size: 16px; 
  }
  
  .btn-block { width: 100%; }
  
  #headerLoginBtn {
    background: var(--secondary);
    color: var(--primary);
  }

  #headerLoginBtn:hover {
    background: var(--primary);
    color: var(--secondary);
  }
  
  #newVideoButton {
    margin-top: 20px;
    justify-content: center;
  }
  
  #saveAccountButton {
    width: 160px;
  }
  
  /* Linklike buttons */
  .linklike {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
  }
  
  /* Modal */
  .modal {
    position: fixed;
    inset: 0;
    z-index: 200; /* above teleprompter */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
  }
  .modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
  }
.modal__content {
  position: relative;
  width: min(560px, 95vw);
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 40px);
  background: var(--secondary);
  border-radius: 16px;
  border: 1px solid var(--secondary);
  padding: clamp(8px, 3vw, 18px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  /* Add text wrapping and overflow handling */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
  
  /* Ensure pre elements in modals wrap properly */
  .modal__content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Make modal body scrollable when content is too long */
  .modal__content .stack {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding-right: 8px;
  }
  
  /* Custom scrollbar for modal content */
  .modal__content .stack::-webkit-scrollbar {
    width: 6px;
  }
  
  .modal__content .stack::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .modal__content .stack::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }
  
  .modal__content .stack::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
  .modal__close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
  }

  .modal__container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 60px;
  }
  
  #registerForm, #loginForm {
    display: block;
  }
  
  #registerForm h2, #loginForm h2 {
    margin: 4px 0 10px;
    text-align: center;
  }
  
  #regForm, #loginFormEl {
    display: grid;
    gap: 10px;
  }
  #regForm label, #loginFormEl label {
    display: grid;
    gap: 6px;
    font-size: 14px;
  }
  #regForm input, #loginFormEl input, #regForm select {
    padding: 10px 12px;
    border: 1px solid #d9e0e7;
    border-radius: 10px;
  }
  #regForm input:focus, #loginFormEl input:focus, #regForm select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
  }
  .auth-switch {
    text-align: center;
    margin: 8px 0 2px;
    color: var(--muted);
    font-size: 14px;
  }

  
  
  /* Dashboard layout */
  .dashboard {
    /* display: grid; */
    gap: 16px;
    padding: 28px 0 28px;
    width: 100%;
  }
  
.card {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 2px solid var(--secondary);
  border-radius: 12px;
  background: var(--card);
  padding: clamp(8px, 3vw, 16px);
  box-shadow: 0 4px 12px var(--secondary);
  box-sizing: border-box;
  overflow: hidden;
}
  
  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  .card-title { margin: 0; }
  .card-subtitle { margin: 4px 0 0; color: var(--muted); }
  
  .quick-actions { display: grid; gap: 10px; justify-items: start; }
  
  #welcomeCard {
    position: relative;
  }
  
.welcomeCardInner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(70%, calc(100vw - 80px));
  max-width: calc(100% - 40px);
  text-align: center; /* Center text content */
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
  
  .welcomeItem {
    margin-top: 20px;
  }

  .blogButton {
    background: var(--secondary);
    color: var(--primary);
    border: 1px solid var(--secondary);
    border-radius: 6px;
    padding: 6px 9px;
    text-decoration: none;
  }
  
  .obItem {
    display: flex;
    align-items: center;
    justify-content: start;
  }
  
  .aboveManagePlayback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20pm 0 12px 0;
  }
  
  #newRoomCard {
    /* display controlled by .card-visible/.card-hidden */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 0 12px var(--secondary);
  }
  
  #newRoomCard.card-visible { display: flex; }
  
  .roomFormDiv {
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: center;
    margin-top: 40px;
  }
  
  .roomFormHeaderDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60%;
  }
  
  .roomFormLabel {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-right: 12px;
  }
  
  /* Inputs */
input {
  border: 1px solid var(--primary);
  border-radius: 6px;
  box-shadow: 0 0 4px var(--secondary);
  min-height: 22px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
  
  textarea {
    border: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 0 4px var(--secondary);
  }
  
  .roomFormInput {
    border: 2px solid var(--primary);
  }
  
  /* Simple utilities */
  .row { display: flex; align-items: center; gap: 4px; }
  .row.wrap { flex-wrap: wrap; }
  .row.gap { gap: 8px; }
  .stack { 
    /* display: grid;  */
    gap: 6px; 
  }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Enhanced responsive breakpoints */
@media (max-width: 768px) { 
  .features { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .nav {
    flex-direction: column;
    gap: 4px;
  }
  
  .btn-lg {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .hero h1 {
    font-size: clamp(20px, 6vw, 28px);
  }
}

@media (max-width: 320px) {
  .container {
    padding: 0 4px;
  }
  
  .btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}
  
  /* Lists */
  .list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
  .list-item {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    padding: 10px; 
    box-shadow: 0 0 12px var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: 10px;
  }
  .list-item .title { font-weight: 600; }
  
  .list-item:hover {
    box-shadow: 0 0 16px var(--secondary);
    border: 2px solid var(--secondary);
  }
  
  .obListItem {
    display: flex; 
    align-items: center; 
    justify-content: start;
    gap: 10px; 
    padding: 10px; 
    box-shadow: 0 0 12px var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: 10px;
  }
  
  .vidList{
    /* border: 1px solid var(--bg); */
    box-shadow: 0 0 12px #F9FAFB;
    border: 1px solid #F9FAFB;
  }
  
  .vidListLI{
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 10px; 
    padding: 10px; 
    box-shadow: 0 0 12px #F9FAFB;
    border: 1px solid #F9FAFB;
    border-radius: 10px;
  }
  
  
  .meta { color: var(--muted); font-size: 14px; }
  
  /* Badges */
  .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid #e5eaf0;
  }
  .badge-public { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
  .badge-private { background: #f1f5f9; color: #334155; }
  
  /* Recorder */
  #preview, #playback {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    background: #000;
    margin: 14px 0 6px 0;
  }
  
  #vidQualityInfo {
    margin-top: 2px;
    font-size: 14px;
    color: #1E3A8A;
  }
  
  /* Forms in dashboard */
#videoTitleInput {
  padding: 10px 12px;
  border: 1px solid #d9e0e7;
  border-radius: 10px;
  width: min(70%, calc(100vw - 100px));
  max-width: 100%;
  box-sizing: border-box;
}
  #videoTitleInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
  }
  
  
  /* Empty state */
  .empty-state {
    text-align: center;
    color: var(--muted);
    padding: 12px 0;
  }
  
  /* Upload progress area */
  .upload-progress { margin-top: 10px; font-size: 14px; color: var(--muted); }
  
  /* Brand icon sizing */
  .brand .logo {
    width: 66px;
    height: 66px;
    object-fit: contain; /* This ensures the image scales properly */
  }
  
  /* Display utilities */
  .hidden { display: none !important; }
  .visible { display: block !important; }
  
  /* Modal states */
  .modal.hidden { display: none; }
  .modal.visible { display: block; }
  
  /* Form states */
  .form-hidden { display: none; }
  .form-visible { display: block; }
  
  /* Card states */
  .card-hidden { display: none; }
  .card-visible { display: block; }
  
  /* Onboarding card minimized state */
  
#onboardCard {
  margin-top: 50px;
  width: min(70%, calc(100vw - 40px));
  max-width: 100%;
  box-sizing: border-box;
}
  
  #onboardingList {
    margin-top: 20px;
  }
  
  .card-minimized {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }
  
  .card-minimized .card-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  .card-expanded {
    max-height: none;
    transition: max-height 0.3s ease-in-out;
  }
  
  .card-expanded .card-content {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
  }
  
  /* Button states */
  .btn-hidden { display: none; }
  .btn-visible { display: inline-flex; }
