/* Main Styles */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --success-color: #4CAF50;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --border-color: #ddd;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    color: var(--dark-text);
    background-color: var(--light-bg);
  }
  
  .container {
    max-width: 1000px;
    margin: 0 auto;
  }
  
  /* Header Styles */
  h1, h2 {
    color: #2c3e50;
    margin-bottom: 20px;
  }
  
  h1 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
  }
  
  /* Meeting Information */
  .meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .meeting-info {
    padding: 15px;
    background: #e8f4fe;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
  }
  
  .meeting-info p {
    margin: 5px 0;
  }
  
  /* Device Selection */
  .device-selection {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
  }
  
  .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .device-group {
    margin-bottom: 15px;
  }
  
  .device-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
  }
  
  select, button {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 16px;
  }
  
  .control-button {
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
  }
  
  .control-button:hover {
    background: var(--primary-dark);
  }
  
  .control-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
  }
  
  /* Status Indicators */
  .status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    background: #ccc;
  }
  
  .status-indicator.active {
    background: var(--success-color);
  }
  
  /* Language Selection */
  .language-preference-container {
    background: #f0f8ff;
    padding: 15px;
    border-radius: var(--border-radius);
    border-left: 4px solid #1890ff;
  }
  
  .language-select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
  }
  
  /* Status Panel */
  .status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
  }
  
  .language-badge {
    display: inline-block;
    background: #e1f5fe;
    border: 1px solid #81d4fa;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px;
    font-size: 0.8em;
  }
  
  .detected-language {
    font-weight: bold;
    color: #0066cc;
    transition: color 0.5s;
  }
  
  .detected-language.highlight {
    color: #ff6600;
  }
  
  /* Button Groups */
  .toggle-button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
  }
  
  .toggle-button-group button {
    flex: 1;
    margin: 0;
  }
  
  /* Video Elements */
  .video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
  }
  
  #publisher, #subscriber {
    width: 100%;
    min-height: 240px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #eee;
    box-shadow: var(--card-shadow);
  }
  
  /* Captions */
  #captions {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    border-radius: var(--border-radius);
    max-width: 80%;
    max-height: 30vh;
    overflow-y: auto;
    z-index: 1000;
    line-height: 1.5;
    transition: opacity 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  }
  
  #captions.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  #captions strong {
    color: #ffcc00;
    font-weight: bold;
  }
  
  /* Transcript Stream */
  #streamText {
    overflow-y: scroll;
    height: 305px;
    padding: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
  }
  
  #streamText p {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  /* Connection Overlay */
  .connecting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
  }
  
  .connecting-spinner {
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 5px solid #fff;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .connecting-text {
    font-size: 24px;
    font-weight: bold;
  }
  
  /* Responsive Adjustments */
  @media (max-width: 768px) {
    .settings-grid {
      grid-template-columns: 1fr;
    }
    
    #captions {
      max-width: 95%;
      font-size: 16px;
    }
  }