/* ===== ОБЩИЕ СТИЛИ ===== */
body, div, header, main, footer, section, p, h1, h2, h3, a, button, input {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background: #f3f3f3;
  color: #111;
}

a {
  text-decoration: none;
}

.auth-box {
  max-width: 400px;
  margin: 50px auto;
  background: #fff;
  padding: 30px 25px;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  text-align: center;
  transition: 0.3s;
}

.auth-box h2 {
  margin-bottom: 25px;
  font-size: 28px;
  color: #111;
}

.auth-box input {
  width: 100%;
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 16px;
  transition: 0.3s;
}

.auth-box input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.auth-box button {
  width: 100%;
  padding: 14px;
  background: #000;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.auth-box button:hover {
  opacity: 0.85;
}

.auth-box p {
  margin-top: 15px;
  font-size: 14px;
  color: #555;
}

.auth-box a {
  color: #000;
  font-weight: bold;
}


 

/* Иконка чата */
#chatToggle {
  position: fixed;
  left: 20px;
  bottom: 20px;
  background: #000;
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 1000;
}

/* Чат */
#chatContainer {
  position: fixed;
  left: 20px;
  bottom: 90px;
  width: 350px;
  height: 700px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  display: none; /* скрыт изначально */
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  font-family: 'Arial', sans-serif;
}

/* Хедер */
#chatHeader {
  background: #000;
  color: #fff;
  padding: 12px;
  font-weight: bold;
  text-align: center;
  font-size: 16px;
  position: relative;
}

/* Крестик закрытия */
#chatClose {
  position: absolute;
  right: 12px;
  top: 12px;
  cursor: pointer;
  font-size: 16px;
  color: #fff;
}

/* Сообщения */
#chatMessages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
}

/* Ввод сообщений */
#chatInputWrapper {
  display: flex;
  border-top: 1px solid #ddd;
}

#chatInputWrapper input {
  flex: 1;
  padding: 12px;
  border: none;
  outline: none;
  font-size: 14px;
}

#chatInputWrapper button {
  padding: 12px 16px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

#chatInputWrapper button:hover {
  opacity: 0.85;
}

/* Сообщения */
.chatMessage {
  margin-bottom: 10px;
  word-wrap: break-word;
}

.chatMessage .nick {
  font-weight: bold;
  margin-right: 5px;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 2px 6px;
  border-radius: 5px;
}

.chatMessage .text {
  color: #333;
}

/* Мобильный адаптив */
@media (max-width: 768px) {
  #chatContainer {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%; /* на весь экран */
    border-radius: 0;
  }

  #chatToggle {
    bottom: 20px;
  }
}




/* ===== HEADER / МЕНЮ ===== */
.header {
  background: #111;
  color: #fff;
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.header h1 {
  font-size: 28px;
  font-weight: bold;
}

.header nav {
  display: flex;
  gap: 15px;
}

.header nav a {
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: 0.3s;
}

.header nav a:hover {
  background: #222;
}

.header nav a.logout {
  background: #ff3b3b;
}

.header nav a.logout:hover {
  background: #ff1e1e;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(120deg, #f6f6f6, #e0e0e0);
}

.hero h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.hero p {
  font-size: 18px;
  margin-bottom: 20px;
}

.subscribe-btn {
  padding: 12px 24px;
  background: #000;
  color: #fff;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.subscribe-btn:hover {
  opacity: 0.85;
}

/* ===== КАРТОЧКИ ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card button {
  width: 80%;
  margin: 15px 0;
  padding: 12px;
  border: none;
  background: black;
  color: white;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.card button:hover {
  opacity: 0.85;
}

/* ===== ФОРМА АВТОРИЗАЦИИ ===== */
.auth-box {
  max-width: 400px;
  margin: 80px auto;
  background: #fff;
  padding: 30px 25px;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  text-align: center;
  transition: 0.3s;
}

.auth-box h2 {
  margin-bottom: 25px;
  font-size: 28px;
  color: #111;
}

.auth-box input {
  width: 100%;
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 16px;
  transition: 0.3s;
}

.auth-box input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.auth-box button {
  width: 100%;
  padding: 14px;
  background: #000;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.auth-box button:hover {
  opacity: 0.85;
}

.auth-box p {
  margin-top: 15px;
  font-size: 14px;
  color: #555;
}

.auth-box a {
  color: #000;
  font-weight: bold;
}

/* ===== ФУТЕР ===== */
footer {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  font-size: 14px;
}


.card button.disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

.participants-count {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

/* Для блока последних участников */
.participants-count {
  font-size: 14px;
  color: #ccc;
  margin-top: 5px;
}
 
/* ===== МЕДИА-ЗАПРОСЫ ===== */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 10px;
  }

  .header nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h2 {
    font-size: 26px;
  }

  .hero p {
    font-size: 16px;
  }

  .card img {
    height: 180px;
  }

  .auth-box {
    margin: 50px 20px;
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  .card img {
    height: 150px;
  }

  .subscribe-btn {
    width: 90%;
  }

  .auth-box input, .auth-box button {
    font-size: 14px;
    padding: 12px;
  }
}


.chat-layout {
  display: flex;
  height: calc(100vh - 80px);
}

.chat-list {
  width: 280px;
  background: #111;
  color: #fff;
  overflow-y: auto;
}

.chat-list div {
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid #222;
}

.chat-list div:hover {
  background: #222;
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#chatMessages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: none;
}

.chat-input button {
  padding: 10px 20px;
  border: none;
  background: black;
  color: white;
  cursor: pointer;
}

/* ===== КАРТОЧКИ ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 карточки на ПК */
  gap: 20px;
  padding: 20px;
}

.card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.card button {
  width: 80%;
  margin: 15px 0;
  padding: 12px;
  border: none;
  background: black;
  color: white;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.card button:hover {
  opacity: 0.85;
}

/* ===== МЕДИА-ЗАПРОСЫ ===== */

/* Планшет */
@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, 1fr); /* 2 карточки */
  }
}

/* Телефон */
@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr; /* 1 карточка */
  }

  .card img {
    height: 180px;
  }
}

/* ===== BODY + WRAPPER ===== */
body, html {
  height: 100%;
  margin: 0;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* чтобы футер был снизу */
}

/* ===== КОНТЕНТ ===== */
.content {
  flex: 1; /* занимает всё пространство между хедером и футером */
}

/* ===== ФУТЕР ===== */
.footer {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  transition: transform 0.3s ease;
}



/* ===== СКРИПТ ДЛЯ ПРИЯТНОГО СКРЫТИЯ ===== */
window.addEventListener('scroll', () => {
  const footer = document.querySelector('.footer');
  if (window.scrollY > 50) {
    footer.style.transform = 'translateY(100%)'; /* скрываем футер вниз */
  } else {
    footer.style.transform = 'translateY(0)'; /* показываем футер */
  }
});
