/* ===== MAKERHUB - telegrammultilanguage.css ===== */
/* Sidebar styles handled by sidebar.js — DO NOT add sidebar CSS here */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2AABEE;
  --primary-dark: #e6b800;
  --primary-light: rgba(42, 171, 238, 0.15);
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --bg-primary: #ffffff;
  --bg-secondary: #fafbfc;
  --bg-tertiary: #f5f6f7;
  --border-light: #e9ecef;
  --border-medium: #dee2e6;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 40px;
  --spacing-2xl: 48px;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --error-bg: #fee2e2;
  --error-border: #ef4444;
  --error-text: #991b1b;
  --success-bg: #d1fae5;
  --success-border: #10b981;
  --success-text: #065f46;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ==================== MAIN CONTENT ==================== */
/* margin-left: 260px matches sidebar.js sidebar width */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.content-wrapper {
  padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-xl);
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-2xl);
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: var(--spacing-xs);
  line-height: 1.2;
}

.page-description {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.5;
}

/* ==================== TRANSLATION GRID ==================== */
.translation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

.translation-section {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.section-title i {
  color: var(--primary);
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

.form-help {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==================== LANGUAGE GRID ==================== */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.language-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
}

.language-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.language-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.language-checkbox {
  accent-color: var(--primary);
}

.flag {
  font-size: 18px;
}

/* ==================== BUTTONS ==================== */
.add-source-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-primary);
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.add-source-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 197, 24, 0.3);
}

.save-config-btn {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  margin-top: var(--spacing-xl);
}

.save-config-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* ==================== SOURCE CHANNEL ==================== */
.source-channel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  position: relative;
}

.source-channel:first-child .remove-source {
  display: none !important;
}

.remove-source {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.remove-source:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ==================== MAPPINGS ==================== */
.translation-mappings {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-2xl);
}

.mapping-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.mapping-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
}

.mapping-arrow {
  color: var(--primary);
  font-size: 18px;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-content {
  text-align: center;
  color: white;
  padding: var(--spacing-2xl);
  background: #1a2f45;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.loading-content i {
  color: var(--primary);
  margin-bottom: var(--spacing-md);
}

.loading-content p {
  margin-top: var(--spacing-md);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

/* ==================== FEEDBACK MESSAGES ==================== */
.message-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9998;
  max-width: 400px;
  display: none;
}

.error-message,
.success-message {
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  animation: slideIn 0.3s ease-out;
  box-shadow: var(--shadow-md);
}

.error-message {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.success-message {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.close-error,
.close-success {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-error:hover,
.close-success:hover {
  opacity: 1;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ==================== VALIDATION ==================== */
.form-input.invalid {
  border-color: var(--error-border) !important;
  background: rgba(239, 68, 68, 0.05);
}

.validation-error {
  display: block;
  color: var(--error-text);
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

/* ==================== ACTIVE TRANSLATIONS ==================== */
.active-translations-section {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-sm);
  margin-top: var(--spacing-2xl);
}

.translation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  transition: all 0.2s ease;
}

.translation-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.translation-item.paused {
  opacity: 0.6;
  background: var(--bg-tertiary);
}

.translation-info { flex: 1; }

.channel-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.translation-details {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.translation-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.btn-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.btn-action:hover {
  border-color: var(--border-medium);
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

.btn-pause:hover { color: var(--warning); border-color: var(--warning); }
.btn-resume { color: var(--success); }
.btn-resume:hover { background: rgba(16, 185, 129, 0.1); border-color: var(--success); }
.btn-delete:hover { color: var(--danger); border-color: var(--danger); background: rgba(239, 68, 68, 0.05); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 80px var(--spacing-md) var(--spacing-md);
  }

  .translation-grid {
    grid-template-columns: 1fr;
  }

  .language-grid {
    grid-template-columns: 1fr;
  }

  .message-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}
/* ==================== TARGET CHANNEL DISPLAY ==================== */
.target-channel {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  font-family: 'SF Mono', Monaco, monospace;
}
