/* Enhanced RTMP Tweak Modal Styles - COMPREHENSIVE VERSION */

.tweak-modal {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tweak-modal.show {
  opacity: 1;
  visibility: visible;
}

.tweak-modal-content {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  margin: 2% auto;
  padding: 2rem;
  border: 2px solid #444;
  border-radius: 16px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  color: #e0e0e0;
}

.tweak-modal-content h3 {
  color: #4fc3f7;
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  text-align: center;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

.tweak-modal-content h4 {
  color: #81c784;
  margin: 1.5rem 0 1rem 0;
  font-size: 1.3rem;
  border-bottom: 2px solid #333;
  padding-bottom: 0.5rem;
}

.tweak-modal-content h5 {
  color: #ffb74d;
  margin: 1rem 0 0.5rem 0;
  font-size: 1.1rem;
}

.tweak-modal-content h6 {
  color: #f06292;
  margin: 0.8rem 0 0.4rem 0;
  font-size: 1rem;
}

/* System Monitor Section */
.system-monitor-section {
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #444;
}

.system-status {
  min-height: 200px;
}

.system-loading, .system-error {
  text-align: center;
  padding: 2rem;
  font-size: 1.1rem;
  color: #aaa;
}

.system-error {
  color: #f44336;
}

/* Stream Health Dial Styles */
.stream-health-section {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #333;
}

.health-dial-container {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.health-dial {
  position: relative;
  width: 120px;
  height: 60px;
  margin-bottom: 1rem;
}

.dial-background {
  width: 120px;
  height: 60px;
  border: 6px solid #333;
  border-bottom: none;
  border-radius: 120px 120px 0 0;
  position: relative;
  background: linear-gradient(90deg, #f44336 0%, #ff9800 50%, #4caf50 100%);
  border-width: 3px;
}

.dial-needle {
  position: absolute;
  top: 54px;
  left: 57px;
  width: 3px;
  height: 45px;
  background: #fff;
  transform-origin: bottom center;
  transition: transform 0.5s ease;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

.dial-center {
  position: absolute;
  top: 48px;
  left: 54px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #333;
}

.dial-score {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 1.1rem;
}

.dial-labels {
  position: absolute;
  top: 45px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #888;
}

.health-details {
  flex: 1;
}

.health-metric {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Enhanced GPU and System Cards */
.gpu-section, .cuda-section, .system-section {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #444;
}

.gpu-card {
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.gpu-metrics, .system-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.gpu-metric, .system-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
}

.gpu-metric .label, .system-metric .label {
  font-weight: bold;
  color: #bbb;
}

.gpu-metric .value, .system-metric .value {
  color: #e0e0e0;
  font-weight: bold;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  transition: width 0.3s ease;
}

.cuda-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}

.cuda-metric {
  padding: 0.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  border-left: 3px solid #4fc3f7;
}

/* Stream Settings Section */
.stream-settings-section {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #444;
}

.stream-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #333;
  padding-bottom: 1rem;
}

.stream-tab {
  padding: 0.8rem 1.2rem;
  background: #333;
  border: none;
  border-radius: 8px 8px 0 0;
  color: #bbb;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.stream-tab:hover {
  background: #444;
  color: #e0e0e0;
}

.stream-tab.active {
  background: #4fc3f7;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.stream-settings {
  min-height: 400px;
}

.stream-panel {
  display: none;
}

.stream-panel.active {
  display: block;
}

.universal-toggle {
  background: rgba(255,193,7,0.1);
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.universal-toggle label {
  color: #ffc107;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.rtmp-settings-form {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #555;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #e0e0e0;
}

.form-control {
  padding: 0.75rem;
  background: #2e2e2e;
  border: 2px solid #444;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #4fc3f7;
  box-shadow: 0 0 0 0.2rem rgba(79, 195, 247, 0.25);
}

.form-group small {
  margin-top: 0.4rem;
  color: #aaa;
  font-size: 0.85rem;
  line-height: 1.3;
}

/* Refresh Button */
.refresh-btn {
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.refresh-btn:hover {
  background: linear-gradient(135deg, #388e3c, #66bb6a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Form Actions */
.form-actions {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #333;
}

.form-actions button {
  background: linear-gradient(135deg, #1976d2, #2196f3);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-actions button:hover {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: #888;
  transition: color 0.3s ease;
  z-index: 1;
}

.modal-close:hover {
  color: #f44336;
  transform: scale(1.1);
}

/* Animations */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Notification Styles */
.rtmp-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10001;
  font-weight: bold;
  animation: slideIn 0.3s ease;
}

.notification-success {
  background: #1f8f1f;
  color: white;
}

.notification-error {
  background: #8f1f1f;
  color: white;
}

.notification-info {
  background: #1f5f8f;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tweak-modal-content {
    width: 95%;
    margin: 5% auto;
    padding: 1rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .health-dial-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .cuda-info {
    grid-template-columns: 1fr;
  }
  
  .stream-tabs {
    flex-direction: column;
  }
}
/* Tweak popup button spacing */
#tweak-popup-btn {
    margin: 10px;
}
