@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark: #07080c;
  --bg-card: rgba(15, 17, 30, 0.7);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 229, 255, 0.2);
  
  --primary: #7F00FF;
  --primary-glow: rgba(127, 0, 255, 0.3);
  --secondary: #00e5ff;
  --secondary-glow: rgba(0, 229, 255, 0.3);
  
  --text-main: #f0f3ff;
  --text-muted: #7983ad;
  
  --success: #00ff88;
  --danger: #ff007f;
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(127, 0, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(0, 229, 255, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* Ensures footer sticks to the bottom */
  overflow-x: hidden;
  padding: 2rem 1rem 0 1rem;
}

/* Header & Logo styling */
.logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.logo-header img {
  height: 80px;
  width: auto;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

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

h1 {
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 40%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
  text-align: center;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
  text-align: center;
}

p {
  color: var(--text-muted);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.5;
}

.subtitle {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Containers */
.app-container {
  width: 100%;
  max-width: 460px;
  margin: auto;
}

.wide-container {
  width: 100%;
  max-width: 860px;
  margin: auto;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  padding: 2.2rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(127, 0, 255, 0.03);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.15);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 229, 255, 0.05);
}

/* Forms & Selects */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input[type="text"], select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

input[type="text"]:focus, select:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--secondary);
  box-shadow: 0 0 12px var(--secondary-glow);
}

/* Language selector grid */
.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #9d4edd 100%);
  color: #fff;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(127, 0, 255, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

/* Role Selector Grid */
.role-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.role-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.role-card:hover {
  background: rgba(127, 0, 255, 0.03);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(127, 0, 255, 0.1);
}

.role-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

/* Guide view layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media(min-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* Live Session Controls */
.session-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.9rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.session-code-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-badge {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(0, 229, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  letter-spacing: 0.05em;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.dot.active {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-green 1.5s infinite;
}

.dot.danger {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse-red 1.5s infinite;
}

/* Microphone Pulsing Button */
.mic-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

.mic-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #8f00ff 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: 0 8px 20px var(--primary-glow);
  position: relative;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

.mic-btn:hover {
  transform: scale(1.05);
}

.mic-btn.recording {
  background: linear-gradient(135deg, var(--danger) 0%, #ec4899 100%);
  box-shadow: 0 8px 25px rgba(255, 0, 127, 0.35);
}

.mic-btn.recording::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid var(--danger);
  opacity: 1;
  animation: wave 1.5s infinite linear;
}

.mic-status-text {
  margin-top: 1.25rem;
  font-weight: 500;
  font-size: 1rem;
}

/* QR Code Section container */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 1rem;
  margin-top: 1.5rem;
  gap: 0.5rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qr-box img {
  border: 6px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.qr-box img:hover {
  transform: scale(1.03);
}

.qr-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Live Logs / Transcription Scroll Area */
.log-panel {
  display: flex;
  flex-direction: column;
  height: 300px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 1.1rem;
  margin-top: 1rem;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.log-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.log-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.log-scroll::-webkit-scrollbar {
  width: 5px;
}

.log-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.08);
  border-radius: 3px;
}

.log-entry {
  animation: fade-in-up 0.3s ease forwards;
  background: rgba(255, 255, 255, 0.015);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border-left: 3px solid var(--secondary);
}

.log-entry.guide-self {
  border-left-color: var(--primary);
}

.log-entry .time {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.log-entry .msg {
  font-size: 0.92rem;
  line-height: 1.4;
}

/* Sidebar lists (Attendees) */
.sidebar-panel {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 1.25rem;
  height: fit-content;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}

.stat-row:last-child {
  border-bottom: none;
}

/* Audio Player Overlay for Attendees */
.overlay-alert {
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--secondary-glow);
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  text-align: center;
}

/* Footer elements */
.app-footer {
  text-align: center;
  margin-top: 3.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
  width: 100%;
}

.app-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.app-footer strong {
  color: var(--secondary);
  font-weight: 600;
}

/* Animations */
@keyframes wave {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 0, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
