:root {
  --bg-color: #f8fafb;
  --white: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 40px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-status {
  font-size: 14px;
  color: var(--text-muted);
}

/* Layout */
.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
  display: none; /* Скрыто изначально, как на скрине */
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Dropzone */
.dropzone {
  background: var(--white);
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.icon-circle {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.dropzone h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dropzone p {
  margin-bottom: 24px;
}

#fileInput {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-outline {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f1f5f9;
}

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

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

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

/* Editor Section (Track) */
.editor-header {
  margin-bottom: 20px;
}

.track-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.track-info {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-left: 36px;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.track-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.track-controls-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 10px;
}

.waveform-wrapper {
  flex-grow: 1;
  background: var(--primary-light);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e0e7ff;
}

.track-controls-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: var(--primary-light);
  color: var(--primary);
  transition: 0.2s;
}

.icon-btn:hover {
  background: #e0e7ff;
  transform: scale(1.05);
}

.icon-btn.success-btn {
  background: #d1fae5;
  color: var(--success);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--white);
  margin: 15vh auto;
  padding: 30px;
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  position: relative;
}

.modal-header h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.modal-header p {
  margin-bottom: 20px;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.close:hover {
  color: var(--text-main);
}

.status-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  z-index: 2000;
  transition: all 0.25s ease;
}

.status-popup.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.status-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-icon {
  width: 18px;
  height: 18px;
}

/* spinner */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.g_id_signin {
  display: flex;
  justify-content: center;
}
.danger-btn {
  background: var(--danger-light);
  color: var(--danger);
}

.danger-btn:hover {
  background: #fee2e2;
}

/* Обертка для всей страницы с боковым меню */
.app-layout {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* Основной контент (заменяет старый .container по ширине) */
.main-content {
  flex: 1;
  min-width: 0; /* Чтобы избежать переполнения flex-элемента */
}

/* Стили для бокового меню истории */
.sidebar {
  width: 300px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;

  position: sticky;
  top: 80px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.sidebar h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.history-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-date {
  font-size: 11px;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: 0.2s;
}

.history-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}

/* Стили для секций треков */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 30px 0 10px 0;
  color: var(--text-main);
}

.section-title:first-child {
  margin-top: 0;
}

/* Центрирование кнопок действий (Enhance / New Enhancement) */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
}

.rating-widget {
  margin-top: 48px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.rating-title {
  color: #334155;
  font-weight: 500;
  margin-bottom: 12px;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.star {
  width: 32px;
  height: 32px;
  fill: #cbd5f5;
  transition: all 0.2s ease;
  cursor: pointer;
}

.star.active {
  fill: #facc15;
  transform: scale(1.1);
}
