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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1a1a1a;
  color: #ffffff;
  overflow-x: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 250px;
  background-color: #2d2d2d;
  padding: 20px;
  border-right: 2px solid #404040;
}

.sidebar-header h2 {
  color: #00ccff;
  margin-bottom: 30px;
  text-align: center;
  font-size: 1.5em;
}

.nav-menu {
  list-style: none;
}

.nav-menu li {
  margin-bottom: 10px;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  color: #cccccc;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: #404040;
  color: #00ccff;
}

.nav-link.active {
  background-color: #00ccff;
  color: #1a1a1a;
  font-weight: bold;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page h1 {
  color: #00ccff;
  margin-bottom: 30px;
  font-size: 2.5em;
  text-align: center;
}

/* Live Feeds - User Grid */
.user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  width: 100%;
  height: 80vh;
}

.user-card {
  position: relative;
  background-color: #2d2d2d;
  border: 2px solid #404040;
  display: flex;
  flex-direction: column;
}

.video-container,
.audio-container,
.text-container {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.user-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.flag-image {
  width: 120px;
  height: 80px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.waveform-canvas {
  width: 100%;
  height: 100px;
  background-color: #1a1a1a;
  border-radius: 4px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-display {
  flex: 1;
  background-color: #1a1a1a;
  border-radius: 8px;
  margin: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-welcome {
  color: #888888;
  font-style: italic;
  text-align: center;
  font-size: 0.9em;
  padding: 20px;
}

.chat-message {
  background-color: #404040;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #00ccff;
  animation: messageAppear 0.3s ease-out;
  word-wrap: break-word;
}

.chat-message.own {
  background-color: #0066cc;
  border-left-color: #ffffff;
  margin-left: 20px;
}

.chat-message.remote {
  background-color: #2d4a2d;
  border-left-color: #4caf50;
  margin-right: 20px;
}

.chat-message .sender {
  font-size: 0.8em;
  color: #cccccc;
  margin-bottom: 4px;
}

.chat-message .text {
  color: #ffffff;
  font-size: 1em;
}

.chat-message .timestamp {
  font-size: 0.7em;
  color: #888888;
  text-align: right;
  margin-top: 4px;
}

@keyframes messageAppear {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.chat-input-container {
  display: flex;
  padding: 10px;
  gap: 8px;
  background-color: #2d2d2d;
  border-top: 1px solid #404040;
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  background-color: #1a1a1a;
  border: 2px solid #404040;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.9em;
}

.chat-input:focus {
  outline: none;
  border-color: #00ccff;
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn {
  padding: 8px 16px;
  background-color: #00ccff;
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.chat-send-btn:hover {
  background-color: #0099cc;
}

.chat-send-btn:disabled {
  background-color: #666666;
  cursor: not-allowed;
}

.placeholder-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.pulse-ring {
  width: 80px;
  height: 80px;
  border: 4px solid #00ccff;
  border-radius: 50%;
  animation: pulse 2s infinite;
  margin-bottom: 20px;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.waiting-text {
  color: #cccccc;
  font-size: 1.1em;
}

.user-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #00ccff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: bold;
}

/* User Controls */
.user-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px;
  background-color: #404040;
  gap: 8px;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background-color: #555555;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1em;
}

.control-btn:hover {
  background-color: #00ccff;
  transform: scale(1.1);
}

.control-btn.active {
  background-color: #ff6b6b;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  height: 80vh;
}

.chart-card {
  background-color: #2d2d2d;
  border: 2px solid #404040;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  color: #00ccff;
  margin-bottom: 15px;
  text-align: center;
}

.metric-chart {
  flex: 1;
  background-color: #1a1a1a;
  border-radius: 4px;
}

/* Compression Testing */
.compression-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #2d2d2d;
  border-radius: 8px;
}

.benchmark-btn {
  padding: 12px 24px;
  background-color: #00ccff;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.benchmark-btn:hover {
  background-color: #0099cc;
}

.algorithm-list {
  display: flex;
  gap: 15px;
}

.algorithm-list label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #cccccc;
  cursor: pointer;
}

.benchmark-results {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  height: 60vh;
}

.benchmark-chart {
  background-color: #2d2d2d;
  border-radius: 8px;
  border: 2px solid #404040;
}

.top-performers {
  background-color: #2d2d2d;
  border: 2px solid #404040;
  border-radius: 8px;
  padding: 20px;
}

.top-performers h3 {
  color: #00ccff;
  margin-bottom: 15px;
  text-align: center;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Settings */
.settings-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: #2d2d2d;
  padding: 30px;
  border-radius: 8px;
  border: 2px solid #404040;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  margin-bottom: 8px;
  color: #00ccff;
  font-weight: bold;
}

.setting-group input {
  width: 100%;
  padding: 10px;
  background-color: #1a1a1a;
  border: 2px solid #404040;
  border-radius: 4px;
  color: #ffffff;
  font-size: 1em;
}

.setting-group input:focus {
  outline: none;
  border-color: #00ccff;
}

.save-btn {
  width: 100%;
  padding: 12px;
  background-color: #00ccff;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1em;
  transition: background-color 0.3s ease;
}

.save-btn:hover {
  background-color: #0099cc;
}

/* WebRTC Sequence */
.sequence-diagram {
  background-color: #2d2d2d;
  border: 2px solid #404040;
  border-radius: 8px;
  padding: 30px;
  height: 80vh;
  overflow-y: auto;
}

.sequence-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sequence-step {
  background-color: #404040;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #00ccff;
}

.sequence-step.completed {
  border-left-color: #4caf50;
  background-color: #2d4a2d;
}

.sequence-step h4 {
  color: #00ccff;
  margin-bottom: 8px;
}

.sequence-step p {
  color: #cccccc;
  margin-bottom: 5px;
}

/* Roadmap */
.roadmap-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  height: 80vh;
}

.roadmap-section {
  background-color: #2d2d2d;
  border: 2px solid #404040;
  border-radius: 8px;
  padding: 25px;
}

.roadmap-section h3 {
  color: #00ccff;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.4em;
}

.roadmap-section ul {
  list-style: none;
}

.roadmap-section li {
  padding: 8px 0;
  color: #cccccc;
  font-size: 1.1em;
}

/* Log Overlay */
.log-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.log-overlay.hidden {
  display: none;
}

.log-content {
  background-color: #2d2d2d;
  border: 2px solid #00ccff;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #404040;
}

.log-header h3 {
  color: #00ccff;
}

.close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px;
}

.close-btn:hover {
  color: #ff6b6b;
}

.log-body {
  padding: 20px;
  color: #cccccc;
  line-height: 1.6;
}

.log-item {
  margin-bottom: 10px;
  padding: 8px;
  background-color: #404040;
  border-radius: 4px;
}

.log-item strong {
  color: #00ccff;
}

/* Responsive Design */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .nav-menu li {
    margin-bottom: 0;
  }
  
  .user-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    height: auto;
    min-height: 80vh;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    height: auto;
  }
  
  .roadmap-content {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, auto);
    height: auto;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Animation for muted states */
.user-card.muted .user-video {
  filter: grayscale(100%);
}

.user-card.muted .streaming-text {
  animation-play-state: paused;
}

.user-card.paused .user-video,
.user-card.paused .streaming-text {
  animation-play-state: paused;
}

.user-card.inactive {
  opacity: 0.5;
}