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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  min-height: 100vh;
  padding: 40px 20px;
}

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

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  background: linear-gradient(90deg, #e94560, #f39c12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   ВКЛАДКИ
   ============================================ */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 15px;
  background: rgba(255,255,255,0.05);
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.tab-btn.active {
  background: linear-gradient(90deg, #e94560, #f39c12);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(233,69,96,0.3);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* ============================================
   БЛОКИ И ПОЛЯ
   ============================================ */
.block {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

textarea, select, input[type="text"], input[type="range"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}

textarea { min-height: 160px; resize: vertical; }

/* ============================================
   КНОПКИ
   ============================================ */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 0.2s;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  flex: 1;
}
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.2); }

.main-btn {
  padding: 18px;
  background: linear-gradient(90deg, #e94560, #f39c12);
  color: #fff;
  font-size: 1.05rem;
  flex: 1;
  width: 100%;
}
.main-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(233,69,96,0.4); }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
}

.hidden { display: none; }

/* ============================================
   ПЛЕЕР И РЕЗУЛЬТАТ
   ============================================ */
#player { width: 100%; margin: 15px 0; }

#download {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  transition: 0.2s;
}
#download:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   ПРОГРЕСС-БАР
   ============================================ */
.progress-label {
  font-weight: 600;
  margin-bottom: 10px;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e94560, #f39c12);
  width: 0%;
  transition: width 0.4s ease;
}
.progress-time {
  font-size: 0.85rem;
  color: #aaa;
  text-align: right;
}

/* ============================================
   ИСТОРИЯ
   ============================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 10px;
}
.history-item {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.08);
}
.history-item:hover { background: rgba(255,255,255,0.08); }
.history-item .h-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.history-item .h-meta {
  font-size: 0.8rem;
  color: #aaa;
}
.history-empty {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

/* Стили для выпадающего списка языков программирования */
#codeLanguage option {
  color: #ff4d4d; /* Красный текст для доступных языков */
  background-color: #1a1a2e; /* Темный фон для читаемости */
  font-weight: 600;
}

#codeLanguage optgroup {
  color: #aaa; /* Серый цвет для заголовков групп */
  font-weight: bold;
  font-style: normal;
  background-color: #16213e;
}
