/* Titan Live - Professional Broadcast Software UI */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.titan-live {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #2a2a2a;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

/* Top Bar */
.top-bar {
  background: #1e1e1e;
  border-bottom: 2px solid #2ca95b;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}

.logo .live {
  color: #2ca95b;
}

.service-name {
  font-size: 14px;
  color: #999;
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.service-name-input {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px 12px;
  color: #2ca95b;
  font-size: 14px;
  font-weight: bold;
  width: 300px;
  text-align: center;
  transition: all 0.2s;
}

.service-name-input:focus {
  outline: none;
  border-color: #2ca95b;
  background: #2a2a2a;
}

.service-name-input:hover {
  border-color: #555;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-cancel {
  background: #444;
  color: #e0e0e0;
}

.btn-cancel:hover {
  background: #555;
}

.btn-save {
  background: #2ca95b;
  color: #fff;
}

.btn-save:hover {
  background: #25924d;
}

/* Main Container */
.main-container {
  display: flex;
  height: calc(100vh - 60px);
}

/* Sidebar Navigation */
.sidebar {
  width: 80px;
  background: #1e1e1e;
  border-right: 1px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
}

.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px;
  color: #888;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.tab-link:hover {
  background: #252525;
  color: #e0e0e0;
}

.tab-link.active {
  background: #2a2a2a;
  border-left-color: #2ca95b;
  color: #2ca95b;
}

.tab-link .icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.tab-link .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

h2 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 20px;
  border-bottom: 2px solid #3a3a3a;
  padding-bottom: 10px;
}

h3 {
  font-size: 16px;
  color: #2ca95b;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

h4 {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 10px;
  margin-top: 15px;
}

h5 {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
  margin-top: 12px;
}

/* Form Styles */
.form-section {
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
}

.form-group.checkbox-group {
  display: flex;
  align-items: center;
}

.form-group.checkbox-group label {
  margin-bottom: 0;
}

.form-control {
  width: 100%;
  max-width: 500px;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: #2ca95b;
}

input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  margin-top: 20px;
}

.unit {
  margin-left: 8px;
  color: #888;
  font-size: 13px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: #2ca95b;
  color: #fff;
}

.btn-primary:hover {
  background: #25924d;
}

.btn-secondary {
  background: #444;
  color: #e0e0e0;
  margin-top: 10px;
}

.btn-secondary:hover {
  background: #555;
}

.btn-add {
  background: #444;
  color: #e0e0e0;
  margin-top: 20px;
}

.btn-add:hover {
  background: #555;
}

.btn-icon {
  background: #2a2a2a;
  color: #888;
  border: 1px solid #444;
  padding: 4px 10px;
  margin: 2px;
  font-size: 16px;
  border-radius: 3px;
}

.btn-icon:hover {
  background: #353535;
  color: #2ca95b;
  border-color: #2ca95b;
}

.btn-add-muxer {
  background: #333;
  color: #e0e0e0;
  margin: 5px;
  border: 1px solid #444;
}

.btn-add-muxer:hover {
  background: #444;
  border-color: #2ca95b;
}

/* Probe Result */
.probe-result {
  margin-top: 20px;
  padding: 15px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  min-height: 80px;
}

.probe-status {
  font-size: 13px;
  color: #2ca95b;
  font-weight: 600;
  margin-bottom: 10px;
}

.probe-details {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
}

/* Tracks Container - Two Column Layout */
.tracks-container {
  display: flex;
  gap: 20px;
  height: calc(100vh - 150px);
}

/* Tracks Sidebar - Left Column */
.tracks-sidebar {
  width: 320px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.section-header {
  background: #2ca95b;
  color: #fff;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px 6px 0 0;
}

.subsection-header {
  background: #252525;
  color: #888;
  padding: 8px 15px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
}

.mapping-config {
  padding: 15px;
  border-bottom: 1px solid #2a2a2a;
}

.mapping-item {
  background: #2a2a2a;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
}

.mapping-item:hover {
  background: #353535;
}

.tracks-list {
  padding: 15px;
}

.track-section {
  margin-bottom: 20px;
}

.track-header {
  background: #252525;
  color: #2ca95b;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 8px;
}

.track-item {
  padding: 10px 12px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #ccc;
}

.track-item:hover {
  background: #353535;
  border-color: #444;
}

.track-item.active {
  background: #2ca95b;
  color: #fff;
  border-color: #2ca95b;
  font-weight: 600;
}

.track-buttons {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

/* Track Config Panel - Right Column */
.track-config-panel {
  flex: 1;
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 0;
  overflow-y: auto;
}

.config-header {
  background: #2ca95b;
  color: #fff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px 6px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.track-config {
  display: none;
  padding: 20px;
}

.track-config.active {
  display: block;
}

.config-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #3a3a3a;
}

.config-section:last-child {
  border-bottom: none;
}

.config-subsection {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
}

/* Logo Items */
.logo-list {
  margin-bottom: 15px;
}

.logo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 20px;
}

.logo-text {
  flex: 1;
  font-size: 13px;
  color: #ccc;
}

/* Muxers */
.muxer-list {
  margin-bottom: 30px;
}

.muxer-item {
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.muxer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #3a3a3a;
}

.muxer-header h3 {
  margin: 0;
}

.muxer-config {
  padding-top: 10px;
}

.muxer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Output Section */
.output-section {
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 20px;
  max-width: 900px;
}

.output-main,
.output-backup {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #3a3a3a;
}

/* Services List */
#services_list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.service-card {
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  background: #3a3a3a;
  border-color: #2ca95b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.service-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.service-card-header h4 {
  margin: 0;
  color: #2ca95b;
  flex: 1;
}

.service-card-body {
  flex: 1;
}

.service-card-body p {
  font-size: 12px;
  color: #aaa;
  margin: 5px 0;
}

.service-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
}

.btn-service-action {
  flex: 1;
  padding: 5px 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #aaa;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-service-action:hover {
  background: #353535;
  border-color: #2ca95b;
  color: #2ca95b;
  transform: scale(1.05);
}

.btn-service-action.btn-start:hover {
  background: #2ca95b;
  color: #fff;
}

.btn-service-action.btn-stop:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

.btn-service-action.btn-delete:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

/* Output Items */
.output-item {
  background: #333;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.output-item.editable {
  background: #2a2a2a;
}

.output-header {
  font-size: 16px;
  color: #2ca95b;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #3a3a3a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 15px;
}

.output-enable-toggle {
  margin-left: auto;
  font-size: 13px;
  color: #aaa;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.output-enable-toggle input[type="checkbox"] {
  cursor: pointer;
}

.output-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.track-info-line {
  background: #333;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #ccc;
  border-left: 3px solid #2ca95b;
}

.track-info-line strong {
  color: #2ca95b;
  margin-right: 8px;
}

.backup-section {
  background: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 15px;
  margin-top: 10px;
}

.backup-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #f39c12;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 15px;
}

.backup-fields {
  padding-top: 10px;
}

.output-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.output-main-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.output-main-info div {
  font-size: 13px;
  color: #ccc;
}

.output-main-info strong {
  color: #2ca95b;
  margin-right: 8px;
}

.tracks-section {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 15px;
}

.tracks-section h4 {
  font-size: 13px;
  color: #2ca95b;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.track-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #252525;
  border: 1px solid #333;
  border-radius: 3px;
  margin-bottom: 6px;
  font-size: 12px;
}

.track-index {
  color: #f39c12;
  font-weight: 600;
  min-width: 70px;
}

.track-spec {
  color: #ccc;
  flex: 1;
}

.backup-info {
  background: #2a2a2a;
  border: 1px solid #444;
  border-left: 3px solid #f39c12;
  border-radius: 4px;
  padding: 15px;
}

.backup-info h4 {
  font-size: 13px;
  color: #f39c12;
  margin: 0 0 10px 0;
  text-transform: uppercase;
}

.backup-info div {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 6px;
}

.backup-info strong {
  color: #f39c12;
  margin-right: 8px;
}

.no-outputs {
  padding: 40px;
  text-align: center;
  color: #888;
  font-size: 14px;
  background: #2a2a2a;
  border: 1px dashed #444;
  border-radius: 6px;
}

.no-tracks {
  padding: 20px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

.subsection-subheader {
  background: #1e1e1e;
  color: #666;
  padding: 6px 15px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mapping-icon {
  margin-right: 8px;
}

.mapping-arrow {
  margin: 0 8px;
  color: #666;
}

.track-icon {
  margin-right: 8px;
  font-size: 14px;
}

.track-info {
  flex: 1;
}

.form-check-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .tracks-sidebar {
    width: 280px;
  }
}
