/* global.css - Mobile-Optimized Version */

/* ──────────────────────────────────────────────────────────────────────────
   VARIABLES & GLOBAL RESET - Adjusted for Mobile-First
────────────────────────────────────────────────────────────────────────── */
:root {
  /* Space.css Theme Variables - These are the primary source of truth */
  --primary-bg: linear-gradient(135deg, #4c1d95, #6d28d9, #8b5cf6);
  --container-bg: white;
  --sidebar-bg: #f3e8ff;
  --sidebar-border: #d8b4fe;
  --header-bg: linear-gradient(to right, #8b5cf6, #c084fc);
  --text-dark: #4b0082;
  --text-light: #6b21a8;
  --accent: #0ea5e9; /* Accent for speaking indicator */
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --note-bg: #fff9c4; /* Existing note background for sticky note */
  --note-shadow: rgba(0,0,0,.15);
  --placeholder-text: #9ca3af;

  /* Additional general UI variables, derived or kept for consistency with shared components */
  --ff-base: 'Segoe UI', sans-serif; /* Consistent font family */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --card-shadow-light: 0 4px 10px rgba(0, 0, 0, .06);
  --card-shadow-medium: 0 8px 20px rgba(0, 0, 0, .10);
  --inner-shadow: inset 0 1px 3px rgba(0, 0, 0, .05);
  --focus-shadow: 0 0 0 3px rgba(0, 0, 0, .15);

  /* Fluid sizing variables - adjusted for responsiveness */
  --fluid-spacing-sm: calc(0.5rem + 0.5vw); /* ~8px to 14px */
  --fluid-spacing-md: calc(1rem + 1vw);    /* ~16px to 28px */
  --fluid-input-padding-y: calc(0.4rem + 0.2vw); /* ~6px to 8px */
  --fluid-input-padding-x: calc(0.6rem + 0.4vw); /* ~10px to 14px */
  --fluid-input-font-size: calc(0.8rem + 0.1vw); /* ~13px to 14.5px */
  --fluid-btn-padding-y: calc(0.45rem + 0.3vw); /* ~7px to 10px */
  --fluid-btn-padding-x: calc(0.8rem + 0.6vw); /* ~12px to 20px */
  --fluid-btn-font-size: calc(0.85rem + 0.15vw); /* ~13.5px to 15.5px */

  /* Tabs */
  --tabs-height: 40px;
  --tabs-margin-bottom: 15px;

  /* Utility colors */
  --clr-warm-red: var(--danger);
  --clr-warm-orange: #f97316;
  --clr-warm-yellow: #facc15;

  /* Soft translucent versions for utility colors */
  --clr-red-ghost: rgba(239, 68, 68, .1);
  --clr-orange-ghost: rgba(249, 115, 22, .08);
  --clr-yellow-ghost: rgba(250, 204, 21, .08);

  /* Tertiary colors for blobs */
  --clr-tertiary-orange: rgba(249, 115, 22, 0.2);
  --clr-tertiary-yellow: rgba(250, 204, 21, 0.2);
  --clr-tertiary-blue: rgba(76, 29, 149, 0.2);
}

/* Universal box-sizing, font, and reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--ff-base, 'Segoe UI', sans-serif);
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--sidebar-border) transparent; /* Firefox */
}

/* Custom scrollbar for Webkit browsers (global) */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* Added for horizontal scrollbars */
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--sidebar-border);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

/* HTML and Body basic styling for full-page layout */
html {
  font-size: 0.85rem; /* Base font size, will adjust with media queries */
  height: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll on HTML */
}

body {
    height: 100vh;
    min-width: unset; /* REMOVED: min-width for mobile responsiveness */
    overflow: hidden; /* Prevent body scroll */
    background: var(--primary-bg);
    display: flex;
    flex-direction: column; /* Changed to column for mobile */
    align-items: center;
    justify-content: flex-start; /* Align to start for vertical flow */
    position: relative;
    color: var(--text-dark);
    transition: background 0.5s ease, color 0.5s ease;
}

/* Main Application Container for overall layout control */
#mainAppContainer {
    position: relative;
    background: var(--container-bg);
    width: 100vw; /* Use full width on mobile */
    max-width: 100vw; /* Ensure it doesn't exceed viewport width */
    height: 100vh; /* Use full height on mobile */
    max-height: 100vh; /* Ensure it doesn't exceed viewport height */
    display: flex;
    border-radius: 0; /* No border-radius on full screen mobile */
    overflow: hidden;
    box-shadow: none; /* No shadow on full screen mobile */
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    top: auto;
    left: auto;
    transform: none;
}

/* Desktop/Tablet styles for mainAppContainer */
@media (min-width: 768px) { /* md breakpoint */
    #mainAppContainer {
        width: 95vw;
        max-width: 1400px;
        height: 90vh;
        max-height: 900px; /* Re-add max-height for larger screens */
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    body {
        justify-content: center; /* Center vertically on larger screens */
    }
}

/* Link and interactive element reset */
a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: var(--ff-base);
  outline: none;
  border: none;
}

/* Accessibility helper class */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   BACKGROUND BLOBS & GLOWS
   Hidden on mobile by default for performance and cleaner layout.
────────────────────────────────────────────────────────────────────────── */
.spotlight,
.white-ring,
.blob {
  display: none; /* Hide blobs on mobile by default */
}

@media (min-width: 768px) { /* Show blobs on larger screens */
  .spotlight,
  .white-ring,
  .blob {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.08;
    filter: blur(50px);
    animation: floatBlob 20s ease-in-out infinite alternate;
    display: block; /* Show them on desktop */
  }

  .spotlight1 {
    top: 10vh;
    left: 15vw;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--text-dark) 0%, transparent 70%);
  }

  .spotlight2 {
    bottom: 8vh;
    right: 18vw;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation-delay: 5s;
  }

  .white-ring {
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
    animation: pulseRing 18s infinite alternate;
  }

  .white-ring1 {
    top: 20vh;
    right: 10vw;
    width: 160px;
    height: 160px;
  }

  .white-ring2 {
    bottom: 15vh;
    left: 12vw;
    width: 180px;
    height: 180px;
    animation-delay: 7s;
  }

  /* Blobs adjusted to very subtle transparent tertiary accents */
  .blob1 {
    background: rgba(249, 115, 22, 0.2);
    top: 5vh;
    left: 5vw;
    width: 140px;
    height: 140px;
    animation-delay: 0s;
  }

  .blob2 {
    background: rgba(250, 204, 21, 0.2);
    bottom: 10vh;
    right: 8vw;
    width: 180px;
    height: 180px;
    animation-delay: 10s;
  }

  .blob3 {
    background: rgba(76, 29, 149, 0.2);
    top: 40vh;
    right: 20vw;
    width: 110px;
    height: 110px;
    animation-delay: 20s;
  }
} /* End media query for blobs */

/* Keyframe animations for background elements */
@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.15; }
  70% { box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); } /* Used in participant speaking */
  100% { transform: scale(1.05); opacity: 0.2; }
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2vw, -4vh); }
}

/* ──────────────────────────────────────────────────────────────────────────
   GLOBAL HEADER - Aligned with space.css .main-header
────────────────────────────────────────────────────────────────────────── */
header.global-header {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  padding: 8px 15px; /* Adjusted padding for mobile */
  background: var(--header-bg);
  color: white;
  display: flex;
  flex-direction: column; /* Stack elements vertically on mobile */
  justify-content: center; /* Center content */
  align-items: center; /* Center content */
  box-shadow: none;
  z-index: 20;
  flex-shrink: 0;
  height: auto;
  border-radius: 0; /* No border-radius on mobile header */
}

.header-left {
  display: flex;
  flex-direction: row; /* Keep logo and tagline side-by-side */
  align-items: center;
  gap: 10px; /* Gap between logo and tagline */
  margin-bottom: 10px; /* Space below header-left on mobile */
  flex-shrink: 0;
}

.logo-img {
  width: 80px; /* Smaller logo on mobile */
  max-width: 80px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.03));
}

.tagline-text {
  font-size: 0.7rem; /* Smaller font for tagline on mobile */
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  margin-top: 0; /* Reset margin */
  max-width: 150px; /* Allow wider tagline */
  line-height: 1.3;
  text-align: left;
  margin-left: 0;
  white-space: normal; /* Allow wrapping */
  overflow: visible; /* Allow visible overflow if necessary */
  text-overflow: unset; /* Remove ellipsis */
}

/* Styles for Name and Email inputs in header */
.header-user-inputs {
  display: flex;
  flex-direction: column; /* Stack inputs vertically on mobile */
  align-items: center;
  gap: 8px; /* Adjusted gap */
  padding: 0; /* No padding on mobile */
  flex-shrink: 1;
  min-width: 0;
  width: 100%; /* Full width for input groups */
}

.header-user-inputs .user-input-group {
  flex-direction: column; /* Stack label and input vertically */
  align-items: flex-start; /* Align label/input to start */
  gap: 2px; /* Reduced gap */
  width: 90%; /* Constrain width for inputs */
  margin-bottom: 0;
  position: relative;
  flex-shrink: 1;
  min-width: 0;
}

.header-user-inputs .user-input-group label {
  margin-bottom: 0px;
  white-space: nowrap;
  font-size: 0.75rem; /* Smaller font for labels on mobile */
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.header-user-inputs .user-input-group .input-field {
  width: 100%; /* Full width for inputs */
  padding: 6px 10px; /* Adjusted padding */
  font-size: 0.8rem; /* Adjusted font size for inputs */
  font-weight: 500;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--inner-shadow);
  background-color: var(--container-bg);
  transition: all 0.2s ease;
  color: var(--text-dark);
}

.header-user-inputs .user-input-group .input-field:focus {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: var(--focus-shadow), var(--inner-shadow);
  background-color: var(--container-bg);
}

.header-user-inputs .user-input-group .input-hint {
  font-size: 0.55rem; /* Smaller font for hints on mobile */
  color: rgba(255, 255, 255, 0.8);
  position: static; /* Remove absolute positioning */
  width: auto;
  text-align: left;
  white-space: normal; /* Allow wrapping */
  overflow: visible;
  text-overflow: unset;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.header-user-inputs .user-input-group .input-field:focus+.input-hint {
  opacity: 0; /* Keep this behavior */
}

.header-edit-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px; /* Adjusted gap */
  align-items: center;
  margin-left: 0; /* Reset margin */
  margin-top: 10px; /* Add margin top for spacing from inputs */
  flex-shrink: 0;
  width: 90%; /* Constrain width to align with inputs */
  justify-content: center; /* Center buttons */
}

.header-edit-buttons .btn-primary,
.header-edit-buttons .btn-secondary {
  font-size: 0.8rem; /* Adjusted font size */
  padding: 5px 10px; /* Adjusted padding */
  border-radius: 4px; /* Adjusted border-radius */
}

/* Desktop/Tablet styles for header */
@media (min-width: 768px) { /* md breakpoint */
    header.global-header {
        padding: 5px 20px;
        flex-direction: row; /* Back to row layout */
        justify-content: space-between;
        border-bottom-left-radius: var(--radius-lg);
        border-bottom-right-radius: var(--radius-lg);
    }
    .header-left {
        flex-direction: column; /* Stack logo and tagline */
        align-items: flex-start;
        gap: 0;
        margin-bottom: 0;
    }
    .logo-img {
        width: 120px;
        max-width: 120px;
    }
    .tagline-text {
        font-size: 11px;
        margin-top: 2px;
        max-width: 120px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-user-inputs {
        flex-direction: row;
        gap: 10px;
        padding: 2px 5px;
        width: auto;
        justify-content: flex-start;
    }
    .header-user-inputs .user-input-group {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        width: auto;
    }
    .header-user-inputs .user-input-group label {
        font-size: 0.8rem;
    }
    .header-user-inputs .user-input-group .input-field {
        width: 100px;
        padding: 3px 6px;
        font-size: 0.75rem;
    }
    .header-user-inputs .user-input-group .input-hint {
        font-size: 0.6rem;
        position: absolute;
        bottom: -14px;
        left: 0;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-edit-buttons {
        gap: 4px;
        margin-left: 5px;
        margin-top: 0;
        width: auto;
        justify-content: flex-start;
    }
    .header-edit-buttons .btn-primary,
    .header-edit-buttons .btn-secondary {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Tab Buttons for Toggling Sections */
.section-tabs {
  display: flex;
  justify-content: center;
  gap: 6px; /* Reduced gap for mobile */
  margin-bottom: 10px; /* Reduced margin for mobile */
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  background-color: transparent;
  padding: 0 10px; /* Add some horizontal padding */
}

.tab-btn {
  padding: 8px 12px; /* Adjusted padding for mobile */
  font-size: 0.85rem; /* Adjusted font size for mobile */
  font-weight: 600;
  background: var(--sidebar-bg);
  color: var(--text-dark);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: none;
  box-shadow: none;
  flex-grow: 1;
  max-width: 100%; /* Allow full width on mobile */
  text-align: center;
}

.tab-btn:hover {
  background: var(--sidebar-border);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  color: var(--text-dark);
}

.tab-btn[aria-selected="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
  border: 1px solid rgba(0, 0, 0, .05);
}

@media (min-width: 768px) { /* md breakpoint */
    .section-tabs {
        gap: 8px;
        margin-bottom: var(--tabs-margin-bottom);
        padding: 0;
    }
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.95rem;
        max-width: 180px;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   WRAPPER & MAIN LAYOUT
────────────────────────────────────────────────────────────────────────── */
.wrapper {
  position: relative;
  background: var(--container-bg);
  width: 100vw; /* Full width for mobile */
  max-width: 100vw;
  height: calc(100vh - 70px); /* Adjust height for header/footer on mobile */
  max-height: unset; /* Remove max height on mobile */
  display: flex;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  top: auto;
  left: auto;
  transform: none;
}

/* Parent container should have proper spacing and layout structure */
.main-layout-container {
  display: flex;
  flex-flow: column nowrap; /* Stack columns vertically on mobile */
  gap: 15px; /* Reduced gap for mobile */
  align-items: stretch;
  justify-content: flex-start; /* Align to start for vertical flow */
  padding: 10px; /* Reduced padding for mobile */
  flex: 1;
  overflow-y: auto; /* Allow vertical scrolling for main content on mobile */
  overflow-x: hidden; /* Prevent horizontal scroll */
  background: transparent;
  border-radius: none;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
  position: relative;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--sidebar-border) transparent; /* Firefox */
}

.main-layout-container::-webkit-scrollbar {
    width: 8px;
}
.main-layout-container::-webkit-scrollbar-track {
    background: transparent;
}
.main-layout-container::-webkit-scrollbar-thumb {
    background-color: var(--sidebar-border);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

/* Desktop/Tablet styles for wrapper and main-layout-container */
@media (min-width: 768px) { /* md breakpoint */
    .wrapper {
        width: 95vw;
        max-width: 1400px;
        height: 90vh;
        max-height: 900px;
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    .main-layout-container {
        flex-flow: row nowrap; /* Back to row layout */
        gap: 20px;
        justify-content: space-between;
        padding: 20px;
        overflow: hidden; /* No scrollbar on desktop for this container */
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   FOOTER
────────────────────────────────────────────────────────────────────────── */
footer.ticker-enhanced {
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8px 10px; /* Adjusted padding for mobile */
  background-color: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  color: var(--text-dark);
  text-align: center;
  font-size: 0.75rem; /* Adjusted font size for mobile */
  font-weight: 500;
  z-index: 20;
  box-shadow: none;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  height: auto;
  gap: 10px; /* Reduced gap for mobile */
}

.ticker-content {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0;
}

.ticker-content span {
  display: inline-block;
  padding: 0 8px;
}

.powered-by-text {
  font-weight: 600;
  color: var(--text-dark);
  text-shadow: none;
}

/* Animations for premium feel */
@keyframes softNudgeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes subtlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.005); }
  100% { transform: scale(1); }
}

/* ─── Mini utility helpers ─────────────────────────── */

/* Badges / pills */
.badge-red {
  background: var(--danger);
  color: white;
}

.badge-orange {
  background: var(--clr-warm-orange);
  color: white;
}

.badge-yellow {
  background: var(--clr-warm-yellow);
  color: var(--text-dark);
}

/* Ghost pills (subtle) */
.pill-red {
  background: rgba(239, 68, 68, .1);
  color: var(--danger);
}

.pill-orange {
  background: rgba(249, 115, 22, .08);
  color: var(--clr-warm-orange);
}

.pill-yellow {
  background: rgba(250, 204, 21, .08);
  color: #3d3d3d;
}

/* Divider accent (thin coloured line) */
.divider-orange {
  border-top: 3px solid var(--clr-warm-orange);
}

/* Button variations */
.btn-warning {
  background: var(--clr-warm-orange);
  color: white;
  box-shadow: 0 3px 8px rgba(249, 115, 22, .2);
}

.btn-warning:hover {
  background: #fb923c;
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 3px 8px rgba(239, 68, 68, .2);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

/* Softer border for invalid email */
.input-error {
  border: 1px solid #fca5a5 !important;
  background-color: #fff1f2;
  box-shadow: none;
}

/* Gentle hint message */
#emailError {
  font-size: 0.72rem;
  color: #b91c1c;
  margin-top: 2px;
  display: block;
  opacity: 0.85;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

/* Subtle section highlight */
.section-tip {
  border-left: calc(0.25rem + 0.25vw) solid var(--clr-warm-yellow);
  padding: var(--fluid-spacing-sm);
  border-radius: var(--radius-sm);
  background: var(--clr-yellow-ghost);
}

/* Font Awesome Icons */
i.fas,
i.fas::before,
i.fab,
i.fab::before,
i.far,
i.far::before {
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900;
}
