/* Live Brief Container Styles - Inline Content (Not Modal) */

.live-brief-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  position: relative;
  z-index: 10 !important; /* Higher than hero-content z-index: 2 */
}

.live-brief-container.fade-in {
  opacity: 1 !important;
  visibility: visible !important;
}

.live-brief-container[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Override hero-content fade-out for live-brief-container */
.hero-content.fade-out .live-brief-container {
  opacity: 1 !important;
  visibility: visible !important;
}

.live-brief-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* Same as typing mode */
  padding: 0;
  margin-bottom: 1rem; /* Same as typing mode */
  width: 100%;
  /* Removed border-bottom */
}

.live-brief-title {
  margin: 0;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  order: 2; /* Title comes after toggle */
}

.live-brief-header .mode-toggle-container {
  order: 1; /* Toggle comes first */
}

/* Question detail in Live Brief - same style as typing mode */
.live-brief-header .question-detail {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #cccccc;
  text-align: center;
  line-height: 1.5;
  margin-top: 12px;
  opacity: 0.9;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  order: 3; /* Question detail comes after title */
}

/* Mode Toggle Switch */
.mode-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0; /* Same as typing-mode-toggle */
}

.mode-label {
  color: #FF6B35; /* Orange color for both sides */
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease, background 0.3s ease;
  user-select: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.mode-label:hover {
  color: #FF8551; /* Lighter orange on hover */
  background: rgba(255, 107, 53, 0.1);
}

.mode-label.active {
  color: #FF6B35; /* Keep orange for active */
  font-weight: 600;
}

.mode-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.mode-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #FF6B35; /* Orange background always */
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-toggle-switch input:checked + .toggle-slider {
  background-color: #FF6B35; /* Keep orange when checked */
}

.mode-toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.mode-toggle-switch:hover .toggle-slider {
  background-color: #FF8551; /* Lighter orange on hover */
}

.mode-toggle-switch input:checked:hover + .toggle-slider {
  background-color: #FF8551;
}

.live-brief-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 1rem); /* Reduced gap */
  align-items: center;
  padding: 1rem 0; /* Reduced padding */
}

/* Prompt removed - no longer needed */

/* Microphone Container with Ripple Animation */
.live-brief-microphone-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md, 1rem) 0; /* Reduced padding */
  min-height: 150px; /* Reduced min-height */
  order: 2; /* Microphone comes before prompt */
}

.live-brief-microphone-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.live-brief-microphone-icon {
  position: relative;
  z-index: 10;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FF6B35; /* Orange color */
  border-radius: 50%;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  cursor: pointer;
  user-select: none;
}

.live-brief-microphone-icon:hover {
  background: #FF8551; /* Lighter orange on hover */
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
}

.live-brief-microphone-icon:active {
  transform: scale(0.95);
}

.live-brief-microphone-wrapper.recording .live-brief-microphone-icon {
  background: #FF6B35; /* Keep orange when recording */
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6);
  transform: scale(1.1);
}

.live-brief-microphone-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

/* Ripple Rings */
.live-brief-ripple-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 2px solid #FF6B35; /* Orange color */
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.live-brief-microphone-wrapper.recording .live-brief-ripple-ring {
  opacity: 0.6;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Adjust ripple intensity based on amplitude */
.live-brief-microphone-wrapper.recording .live-brief-ripple-ring {
  border-color: #FF6B35; /* Orange color */
  animation: ripple 2s ease-out infinite;
  animation-duration: calc(2s / (1 + var(--amplitude, 0.5)));
}

.live-brief-summary-container {
  width: 100%;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
  padding: var(--spacing-lg, 1.5rem);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md, 0.5rem);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
}

.live-brief-summary-text {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding-bottom: 1.5rem; /* Space for language indicator */
}

.live-brief-language-indicator {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: lowercase;
  user-select: none;
}

.live-brief-summary-text:not(:empty) {
  opacity: 1;
}

.live-brief-footer {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md, 1rem);
  padding: var(--spacing-lg, 1.5rem) 0 0 0;
  /* Removed border-top */
  margin-top: 1.5rem;
}

.live-brief-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-md, 0.5rem);
  border: none;
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium, 500);
  cursor: pointer;
  transition: all var(--transition-normal, 0.3s ease);
  min-width: 100px;
}

.live-brief-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.live-brief-btn-primary {
  background: #FF6B35;
  color: #ffffff;
}

.live-brief-btn-primary:hover:not(:disabled) {
  background: #FF8551;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.live-brief-btn-primary:disabled {
  background: #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.6;
}

.live-brief-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.live-brief-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.live-brief-btn-stop {
  background: #FF6B35; /* Changed from red to orange */
  color: #ffffff;
}

.live-brief-btn-stop:hover:not(:disabled) {
  background: #FF8551; /* Lighter orange on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.live-brief-error {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--danger-color, #dc3545);
  color: var(--text-white, #ffffff);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-md, 0.5rem);
  z-index: 100001;
  box-shadow: var(--shadow-lg, 0 6px 16px rgba(0, 0, 0, 0.15));
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .live-brief-container {
    padding: 1.5rem;
  }
  
  .live-brief-header {
    padding: 0;
    margin-bottom: 1.5rem; /* Same as typing mode */
    flex-direction: column;
    align-items: center; /* Same as typing mode */
    gap: 1.5rem; /* Same as typing mode */
    width: 100%;
  }
  
  .live-brief-title {
    font-size: 1.5rem;
  }
  
  .live-brief-header .question-detail {
    font-size: 14px;
    margin-top: 8px;
  }
  
  .live-brief-switch-to-typing {
    align-self: flex-end;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  
  .live-brief-body {
    padding: 1.5rem 0;
  }
  
  .live-brief-microphone-container {
    min-height: 150px;
    padding: 1rem 0;
  }
  
  .live-brief-microphone-wrapper {
    width: 100px;
    height: 100px;
  }
  
  .live-brief-microphone-icon {
    width: 70px;
    height: 70px;
  }
  
  .live-brief-microphone-icon svg {
    width: 35px;
    height: 35px;
  }
  
  .live-brief-summary-container {
    min-height: 120px;
    max-height: 250px;
  }
  
  .live-brief-footer {
    padding: 1rem 0 0 0;
    flex-wrap: wrap;
  }
  
  .live-brief-btn {
    flex: 1;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .live-brief-container {
    padding: 1rem;
  }
  
  .live-brief-header {
    flex-direction: column;
    align-items: center; /* Same as typing mode */
    gap: 1.25rem; /* Same as typing mode */
    margin-bottom: 1.25rem; /* Same as typing mode */
    width: 100%;
  }
  
  .live-brief-switch-to-typing {
    align-self: flex-end;
  }
  
  .live-brief-footer {
    flex-direction: column;
  }
  
  .live-brief-btn {
    width: 100%;
  }
}
