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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.section {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

/* Авторизация */
#auth-section {
  max-width: 450px;
  margin: 50px auto;
  text-align: center;
}

#auth-section h1 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 2.5em;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1em;
}

.step {
  text-align: center;
}

.step h2 {
  margin-bottom: 20px;
  color: #555;
  font-size: 1.3em;
}

.step input {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.step input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Кнопки */
.btn-primary,
.btn-secondary,
.btn-success {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 5px;
  font-weight: 600;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #5a6fd8;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
}

button:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Terms checkbox */
.terms-container {
  margin: 20px 0;
  text-align: center;
}

.terms-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  user-select: none;
}

.terms-label input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.terms-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.terms-link:hover {
  text-decoration: underline;
}

.checkmark {
  margin-left: 5px;
}

/* Bio checkbox */
.bio-checkbox-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #667eea;
  user-select: none;
  font-weight: 600;
  padding: 8px 12px;
  border: 2px solid #667eea;
  border-radius: 8px;
  transition: all 0.3s;
  background: white;
}

.bio-checkbox-label:hover {
  background: rgba(102, 126, 234, 0.1);
}

.bio-checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.bio-checkbox-label input[type="checkbox"]:checked + .checkmark {
  color: #667eea;
}

/* Загрузка */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loading {
  text-align: center;
  margin: 20px 0;
}

/* Результат */
#result {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
}

.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Главная панель */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.header h1 {
  color: #667eea;
  font-size: 1.8em;
}

.logout-btn {
  padding: 10px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

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

/* Табы */
.tabs {
  display: flex;
  margin-bottom: 25px;
  border-bottom: 2px solid #eee;
  gap: 5px;
}

.tab-btn {
  padding: 15px 25px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.tab-btn:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

/* Контролы */
.controls {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  align-items: center;
}

.controls select,
.controls input {
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
}

.controls input[type="number"] {
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  width: 220px;
}

.controls input {
  flex: 1;
  min-width: 250px;
}

.controls select:focus,
.controls input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.controls input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Статистика */
.stats {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-number {
  font-size: 28px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Списки */
.list {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
}

.list-item {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
  background: white;
  margin: 1px;
}

.list-item:hover {
  background: #f8f9fa;
  transform: translateX(5px);
}

.list-item:last-child {
  border-bottom: none;
}

.item-info {
  flex: 1;
}

.item-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1.1em;
  color: #333;
}

.item-details {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.item-actions {
  display: flex;
  gap: 10px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-small:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

.btn-small.btn-primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-small.btn-primary:hover {
  background: #5a6fd8;
}

/* Статусы участников */
.status-online {
  color: #28a745;
  font-weight: bold;
}
.status-recently {
  color: #ffc107;
  font-weight: bold;
}
.status-offline {
  color: #6c757d;
}
.status-unknown {
  color: #dc3545;
}

/* Progress Bar */
.progress-container {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

/* Disable interactions during loading */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-overlay .spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #667eea;
}

/* Адаптивность */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .controls {
    flex-direction: column;
  }

  .controls input {
    min-width: auto;
  }

  .stats {
    justify-content: space-around;
    gap: 15px;
  }

  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .tabs {
    flex-direction: column;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .item-actions {
    width: 100%;
    justify-content: center;
  }
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 0.5s ease-out;
}

/* Скроллбар */
.list::-webkit-scrollbar {
  width: 8px;
}

.list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
