@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,400;1,500;1,700;1,900&display=swap');
@import url('variables.css');

* {
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

html, body {
  font-family: 'Roboto', sans-serif;
  background: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  margin: 0; padding: 0;
  height: 100%; overflow: hidden;
}

/* Контейнер главной страницы */
.main-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
  text-align: center;
  color: #5B4D31;
}

.main-container p {
  margin: 8px 0;
  font-weight: 500;
}

/* Список тестов */
.tests-list {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
}

/* Кнопки тестов */
.test-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  color: #ffffff;
  background-color: var(--button-bg-color);
  border-radius: 15px;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.test-button:hover {
  transform: scale(1.02);
  background-color: var(--menu-hover-bg-color);
}

.test-icon {
  font-size: 30px;
  margin-right: 15px;
}

.test-name {
  flex-grow: 1;
  text-align: left;
}

.test-count {
  font-size: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 10px;
  border-radius: 10px;
}

/* Стили для остальных страниц (не изменяйте, если они рабочие) */

.test-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100vh; /* чтобы занять всю высоту экрана */
  opacity: 0; /* плавное появление */
  transition: opacity 0.5s ease;
  padding: 10px;
}

.test-header {
  text-align: center;
  margin-top: 10px;
}

.test-header h2 {
  font-size: 95%;
  color: #8F7C4D;
}

.test-header h3 {
  font-size: 90%;
  font-weight: 300;
  color: #8F7C4D;
}

.test-content {
  flex-grow: 1; /* центрируем по вертикали */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.test-content h2 {
  color: #5B4D31;
}

.test-footer {
  margin-bottom: 10px;
}

/*
#test-container, #result-container {
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hidden {
  display: none;
}
*/

#progress-container {
  width: 90vw;
  height: 10px;
  background: #ddd;
  border-radius: 10px;
  overflow: hidden;
}

#progress-bar {
  height: 10px;
  width: 0;
  background: #FFCC73;
  border-radius: 10px;
  transition: width 0.3s ease;
}

#question-container {
  margin-bottom: 20px;
}

#buttons-container {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-top: 20px;
}

#battery-container {
  width: 80px;
  height: 150px;
  border: 3px solid #DDD;
  border-radius: 12px;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
}


#battery-level {
  width: 100%;
  height: 0;
  position: absolute;
  bottom: 0;
  background: green;
  transition: height 1s ease, background-color 1s ease;
}

#result-message {
  font-size: 16px;
  padding: 20px;
  color: #5B4D31;
}

.answer-btn {
  padding: 15px 40px;
  border-radius: 30px;
  border: none; 
  color: #fff;
  cursor: pointer; 
  font-size: 16px; 
  transition: transform 0.3s ease;
  background: #3380FF;
  font-weight: 600;
  /* Можно разные цвета для Да/Нет, если хочешь */
}

.slide-left {
  animation: slide-left 0.6s ease;
}
.slide-right {
  animation: slide-right 0.6s ease;
}
@keyframes slide-left {
  from { transform: translateX(-100%); } 
  to   { transform: translateX(0); }
}
@keyframes slide-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.progress-jerk {
  animation: jerk 0.5s;
}

@keyframes jerk {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(1.04); }
  50% { transform: scaleX(1); }
  75% { transform: scaleX(1.02); }
  100% { transform: scaleX(1); }
}

#result-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  color: #8F7C4D;
}

#battery-container {
  width: 100px;
  height: 200px;
  border: 3px solid #333;
  border-radius: 10px;
  margin: 20px auto;
  position: relative;
}

#battery-level {
  position: absolute;
  top: 0;  /* !!! чтобы красное шло сверху */
  width: 100%;
  height: 0;
  transition: height 1s ease, background-color 1s ease;
}

.hidden {
  display: none;
  opacity: 0;
}

/* Лоадер (если нужен) */
.loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.7);
  z-index: 9999;
  display: flex; justify-content: center; align-items: center;
}
.loader.hidden {
  display: none;
}

.back-button {
  margin-top: 20px;
  text-decoration: none;
  font-size: 18px;
  color: #3498db;
}

