/* ========================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ======================================== */

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

:root {
  --primary-color: #4CAF50;
  --primary-dark: #45a049;
  --secondary-color: #2196F3;
  --secondary-dark: #1976D2;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --bg-color: #f5f5f5;
  --text-color: #333;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  max-width: 600px;
  width: 100%;
  padding: 40px;
}

/* ========================================
   ХЕДЕР И ФУТЕР
   ======================================== */

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.subtitle {
  color: #666;
  font-size: 1.1em;
}

.rooms-meta {
  margin-top: 8px;
  color: #777;
  font-size: 0.95em;
}

footer {
  text-align: center;
  margin-top: 40px;
  color: #999;
  font-size: 0.9em;
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

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

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

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

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

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

.btn-success:hover {
  background: #218838;
}

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

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 18px 32px;
  font-size: 18px;
}

/* ========================================
   ФОРМЫ И ПОЛЯ ВВОДА
   ======================================== */

.form-container {
  background: var(--bg-color);
  padding: 25px;
  border-radius: var(--border-radius);
  margin-top: 20px;
  animation: fadeIn 0.5s ease;
}

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

.input-group {
  position: relative;
  margin: 15px 0;
}

input[type="text"] {
  width: 100%;
  padding: 14px;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-copy {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.btn-copy:hover {
  background: var(--secondary-dark);
  transform: translateY(-50%) scale(1.1);
}

/* ========================================
   ПОДСКАЗКИ И СООБЩЕНИЯ
   ======================================== */

.hint {
  color: #666;
  font-size: 0.9em;
  margin-top: 10px;
  line-height: 1.5;
}

/* Блок действий после создания комнаты */
.room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
}

@media (max-width: 480px) {
  .room-actions {
    grid-template-columns: 1fr;
  }
}

/* История комнат */
.history-section {
  margin-top: 30px;
}

.history-section h2 {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: var(--text-color);
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--border-radius);
  background: #f8f9fa;
  border-left: 4px solid var(--secondary-color);
}

.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item-title {
  font-weight: 600;
  color: #333;
}

.history-item-meta {
  font-size: 0.85em;
  color: #777;
}

.history-item button {
  white-space: nowrap;
}

.status-message {
  padding: 12px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  font-weight: 500;
  display: none;
}

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

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

.status-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ========================================
   КЛАССЫ ПОМОЩНИКИ
   ======================================== */

.hidden {
  display: none !important;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

@media (max-width: 480px) {
  .action-buttons {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 20px;
  }
  
  header h1 {
    font-size: 2em;
  }
}