/**
 * PeerTube Translation Dashboard CSS
 * Modern, responsive Design mit Terminal-Ansicht
 */

:root {
  --primary: #3498db;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-secondary: #7f8c8d;
  --border: #dfe6e9;
  --terminal-bg: #1e1e1e;
  --terminal-text: #d4d4d4;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

header h1 {
  font-size: 28px;
  margin-bottom: 15px;
  color: var(--text);
}

.health-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.status-indicator.status-ok {
  background: var(--success);
}

.status-indicator.status-degraded {
  background: var(--warning);
}

.status-indicator.status-error {
  background: var(--error);
}

/* Sections */
.section {
  display: none;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 20px;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--text);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.help-text {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #27ae60;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-secondary {
  background: var(--text-secondary);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #636e72;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

.btn-icon:hover {
  color: white;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Info Box */
.info-box {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-box h3 {
  margin-bottom: 15px;
  font-size: 18px;
  color: var(--text);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  font-weight: 600;
  color: var(--text);
}

.info-row .value {
  color: var(--text-secondary);
}

.info-row .value.available {
  color: var(--success);
}

.info-row .value.unavailable {
  color: var(--error);
}

/* Warning Box (Override-Hinweis) */
.warning-box {
  background: #fff3cd;
  border: 2px solid var(--warning);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.warning-box strong {
  color: #856404;
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
}

.warning-box p {
  margin: 10px 0;
  color: #856404;
  line-height: 1.5;
}

.warning-box .small {
  font-size: 13px;
  color: #6c757d;
  margin-top: 12px;
}

.warning-box code {
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
}

/* Progress */
.progress-container {
  margin: 20px 0 30px 0;
}

.progress-bar {
  width: 100%;
  height: 40px;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 15px;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.progress-text {
  text-align: center;
  margin-top: 12px;
  font-weight: bold;
  font-size: 20px;
  color: var(--text);
}

.progress-details {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Terminal */
.terminal {
  background: var(--terminal-bg);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.terminal-header {
  background: #323232;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
}

.terminal-output {
  padding: 15px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  color: var(--terminal-text);
  height: 350px;
  overflow-y: auto;
  line-height: 1.5;
}

.terminal-line {
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-info {
  color: #61afef;
}

.terminal-success {
  color: #98c379;
}

.terminal-warning {
  color: #e5c07b;
}

.terminal-error {
  color: #e06c75;
}

/* Result */
.result-success,
.result-error,
.result-warning {
  text-align: center;
  padding: 20px;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.result-success h3 {
  color: var(--success);
  margin-bottom: 15px;
}

.result-error h3 {
  color: var(--error);
  margin-bottom: 15px;
}

.result-warning h3 {
  color: var(--warning);
  margin-bottom: 15px;
}

.result-success p,
.result-error p,
.result-warning p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.info-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 15px;
  font-style: italic;
}

.result-details {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row .label {
  font-weight: 600;
}

.result-row code {
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  text-align: left;
}

.error-message code {
  color: var(--error);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  word-break: break-word;
}

.error-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 15px;
}

.backup-info {
  margin-top: 20px;
  text-align: left;
}

.backup-info strong {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
}

.backup-info p {
  margin-bottom: 8px;
  color: var(--text);
}

.backup-info code {
  display: block;
  background: white;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  overflow-x: auto;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    max-width: 100%;
  }
  
  .section {
    padding: 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .terminal-output {
    height: 250px;
    font-size: 12px;
  }
}

/* Delete Section Styling */
.delete-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.delete-section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--error);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* Job Check Section Styling */
.job-check-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.job-check-section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--info);
}

.btn-info {
  background: var(--info);
  color: white;
}

.btn-info:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

/* Job Status Result Box */
.job-status-result {
  margin-top: 25px;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
}

.job-status-result h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.job-status-result.status-ready {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.job-status-result.status-ready h4 {
  color: var(--success);
}

.job-status-result.status-waiting {
  border-color: var(--warning);
  background: rgba(241, 196, 15, 0.1);
}

.job-status-result.status-waiting h4 {
  color: var(--warning);
}

.job-status-result.status-warning {
  border-color: var(--warning);
  background: rgba(230, 126, 34, 0.1);
}

.job-status-result.status-warning h4 {
  color: #e67e22;
}

.job-status-result.status-error {
  border-color: var(--error);
  background: rgba(231, 76, 60, 0.1);
}

.job-status-result.status-error h4 {
  color: var(--error);
}

.job-status-info {
  margin-bottom: 15px;
}

.job-status-info p {
  margin: 8px 0;
  font-size: 14px;
}

.job-status-info strong {
  color: var(--text-primary);
}

.job-status-warnings {
  margin-top: 15px;
  padding: 12px;
  background: rgba(241, 196, 15, 0.15);
  border-left: 4px solid var(--warning);
  border-radius: 4px;
}

.job-status-warnings h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--warning);
}

.job-status-warnings ul {
  margin: 0;
  padding-left: 20px;
}

.job-status-warnings li {
  margin: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.job-details {
  margin-top: 15px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 4px;
  font-size: 13px;
}

.job-details h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text-primary);
}

.job-details ul {
  margin: 0;
  padding-left: 20px;
}

.job-details li {
  margin: 5px 0;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
}
