/* === styles.css === */

/* -----------------------------------------
   1) БАЗОВЫЕ СБРОСЫ / ОБЩИЕ СТИЛИ
------------------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  width: 100%;
  height: 100%;
  color: #fff;
}

/* -----------------------------------------
   2) ОБЩИЕ ФОНЫ ДЛЯ СТРАНИЦ (body классы)
------------------------------------------*/

/* index.html */
.main-gradient {
  background: linear-gradient(130deg, #000000, #A64AF6);
  min-height: 100vh;
  color: white;
}

/* choose-generation.html */
.choose-gradient {
  background: linear-gradient(145deg, #2D1F4C, #7B2CD6) fixed;
  background-attachment: fixed;
  min-height: 100vh;
  color: white;
  padding: 2rem 1rem;
}

/* portrait-styles.html */
.portrait-gradient {
  overflow-x: hidden;
  color: white;
  min-height: 100vh;
}

/* -----------------------------------------
   3) АНИМАЦИЯ «МОНЕТА»
------------------------------------------*/
@keyframes coinRotate {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* -----------------------------------------
   4) БАЛАНС МОНЕТ (coins-balance)
------------------------------------------*/
.coins-balance {
  position: fixed;
  top: 20px; 
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 0.8rem 1.2rem;
  display: flex; 
  align-items: center; 
  gap: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  z-index: 99;
}
.coins-balance:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}
.coin-icon {
  font-size: 1.2rem;
  animation: coinRotate 2s infinite linear;
}
.coin-amount {
  font-weight: 600;
  font-size: 1.1rem;
}

/* -----------------------------------------
   5) ГЛАВНАЯ СТРАНИЦА (index.html)
------------------------------------------*/
.main-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
.service-name {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.button-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}
.main-button {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1rem 0;
  min-width: 250px;
  position: relative;
  overflow: hidden;
}
.main-button:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}
.main-button .shine-effect {
  position: absolute;
  top: 0; 
  left: 0;
  width: 50px; 
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: skewX(-15deg);
  animation: shine 3s infinite;
  opacity: 0;
}
@keyframes shine {
  0%   { transform: translateX(-100%) skewX(-15deg); opacity: 0; }
  20%  { opacity: 0.3; }
  100% { transform: translateX(200%) skewX(-15deg); opacity: 0; }
}
.rules-button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  text-decoration: underline;
}
.rules-button:hover {
  color: white;
}

/* -----------------------------------------
   6) СТРАНИЦА ВЫБОРА ГЕНЕРАЦИИ (choose-generation.html)
------------------------------------------*/
.choose-gradient .container {
  max-width: 800px;
  margin: 0 auto;
  padding-top: 70px; /* был у вас 70px */
  padding-bottom: 2rem;
  position: relative;
  z-index: 1;
}
.choose-gradient .header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 1rem;
}
.choose-gradient .title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}
.choose-gradient .subtitle {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
  padding: 0 1rem;
}
/* Сетка опций — вертикальная */
.choose-gradient .options-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.8rem;
  margin-bottom: 2rem;
}
/* Карточки */
.choose-gradient .option-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.choose-gradient .option-card:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}
.choose-gradient .option-icon {
  font-size: 2.5rem;
  margin-bottom: 1.2rem;
}
.choose-gradient .option-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: white;
}
.choose-gradient .option-description {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.choose-gradient .premium-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #FFD700;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
  z-index: 1;
}
.choose-gradient .age-restricted {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 107, 107, 0.9);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1;
}
/* Кнопка «Назад» на choose-generation.html */
.choose-gradient .back-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}
.choose-gradient .back-button:active {
  background: rgba(255, 255, 255, 0.2);
}

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

/* -----------------------------------------
   7) СТРАНИЦА "СТИЛИЗАЦИЯ ПОРТРЕТОВ" (portrait-styles.html)
------------------------------------------*/
.choose-gradient .backBtn2 {
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}
.choose-gradient .backBtn2:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Анимированный фон */
.background-container {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(130deg, #000000, #A64AF6);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Летающие стикеры */
.sticker {
  position: absolute;
  font-size: 32px;
  opacity: 0;
  transform: translateY(100vh) rotate(0deg);
  animation: floatSticker 12s linear infinite, fadeInOut 2s ease forwards;
}
@keyframes floatSticker {
  0%   { transform: translateY(100vh) rotate(0deg); }
  50%  { transform: translateY(20vh) rotate(180deg); }
  100% { transform: translateY(-20vh) rotate(360deg); }
}
@keyframes fadeInOut {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}
.header-offset {
  padding-top: 40px;
}
.header {
  text-align: center;
  padding: 2rem 1rem;
}
.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Категории */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}
.category-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 1.5rem;
  width: 180px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
}
.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}
.category-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.category-name {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Галерея (свайп-карточки) */
/* Gallery Section */
/* Gallery Section */
.gallery-section {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  text-align: center;
  z-index: 10;
  background: linear-gradient(130deg, #000000, #A64AF6);
}

.gallery-section.active {
  display: block;
}

/* Cards Container */
.cards-container {
  position: fixed;
  width: 90%;
  max-width: 400px;
  height: 75vh;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -40%);
  margin: 0 auto;
  touch-action: none;
  -webkit-overflow-scrolling: none;
}

/* Individual Cards */
.card {
  position: absolute;
  top: 50px; /* Added space for title */
  left: 0;
  width: 100%;
  height: calc(100% - 50px); /* Adjusted height to account for title */
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.4s ease, opacity 0.4s ease;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.card-title {
  position: absolute;
  width: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  padding: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generate Button */
.generate-btn {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 15px 40px;
  width: 80%;
  max-width: 300px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.generate-btn:active {
  transform: translateX(-50%) scale(0.98);
}

/* Back Button */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-button:active {
  background: rgba(255, 255, 255, 0.2);
}




/* Кнопка «Назад» на portrait-styles.html */
/* ВОССТАНАВЛИВАЕМ ПРЕЖНИЙ ВИД (справа вверху) */
.portrait-gradient #backButton,
.portrait-gradient .back-button {
  position: fixed;
  top: 20px; 
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 10;
}
.portrait-gradient #backButton:hover,
.portrait-gradient .back-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* -----------------------------------------
   8) СЕКЦИЯ ЗАГРУЗКИ (uploadSection)
------------------------------------------*/
/* ==============================================
   НОВЫЕ СТИЛИ ДЛЯ .upload-section (адаптивно)
============================================== */
/* Обновленные стили для секции загрузки (.upload-section) */
.upload-section {
  display: none;                 /* по умолчанию скрыто */
  min-height: 100vh;            /* займём всю высоту экрана */
  background: linear-gradient(145deg, #2D1F4C, #7B2CD6) fixed;  /* при желании можно убрать */
}

.upload-section.active {
  display: block;
}

.upload-container {
  /* Внутренний контейнер, где лежит шапка, кнопки и превью */
  padding: 1.5rem;
  min-height: 100vh;            /* чтобы растягиваться по высоте */
  display: flex;                /* основа flex */
  flex-direction: column;       /* чтобы "Продолжить" уехала вниз */
}

/* Заголовок в секции загрузки */
.upload-container .header {
  text-align: center;
  margin-top: 3.5rem;  /* делаем отступ сверху, если нужно разместить кнопку "Назад" */
  margin-bottom: 2rem;
}

.upload-container .title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.upload-container .subtitle {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.4;
}

/* Кнопки выбора (Файлы / Камера) */
.upload-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;         /* расстояние между кнопками */
  margin: 1rem 0;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 16px;
  padding: 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 1.5rem; /* размер эмоджи/иконки */
}

.btn-text {
  text-align: left;
  flex: 1;
}

.btn-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.btn-subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Превью-фото */
.preview-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  flex: 1;           /* растягиваем, чтобы занять свободное пространство */
}

.preview-item {
  aspect-ratio: 1;                           /* квадратное соотношение */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.preview-placeholder {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 1rem;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Кнопка «Продолжить» (внизу экрана) */
.continue-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 1rem;
  border-radius: 16px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;       /* сдвигаем кнопку вниз, оставляя сверху пространство */
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.continue-btn:not(:disabled):active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.25);
}

/* Адаптация на планшетах/десктопах: показываем 3 превью в ряд */
@media (min-width: 768px) {
  .upload-container {
    max-width: 600px;
    margin: 0 auto;
  }
  .preview-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
  
  /* Стили для художественной генерации */
.preview-item.full-width {
  grid-column: 1 / -1;
  aspect-ratio: 16/9;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.art-settings {
  margin: 2rem 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
}

.setting-group {
  margin-bottom: 1rem;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Стилизация чекбокса */
.setting-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  -webkit-appearance: none;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  margin-right: 8px;
}

.setting-group input[type="checkbox"]:checked {
  background: #A64AF6;
  border-color: #A64AF6;
}

.setting-group input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
  
  
  




/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #663399, #4B0082);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  transform: scale(1.1); /* Увеличиваем размер всего содержимого */
}

.loading-screen .progress-bar {
  height: 14px; /* Увеличиваем высоту прогресс-бара */
  width: 95%; /* Немного увеличиваем ширину */
  max-width: 440px; /* Увеличиваем максимальную ширину */
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 2rem; /* Увеличиваем отступ */
  overflow: hidden;
}

.loading-screen .progress-fill {
  height: 100%;
  background: linear-gradient(to right, #FF69B4, #9370DB);
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s;
}

.loading-screen .progress-text {
  font-size: 3rem; /* Увеличиваем размер шрифта */
  font-weight: bold;
  color: white;
  text-align: center;
  margin-bottom: 1.5rem; /* Увеличиваем отступ */
}

.loading-screen .loading-text {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-weight: 500;
  font-size: 1.2rem; /* Увеличиваем размер текста */
}

/* Emoji container остается неизменным */
.emoji-container {
  position: fixed;
  inset: 0;
}

.emoji {
  position: absolute;
  animation: float 5s linear forwards;
}

/* Анимация float остается неизменной */
@keyframes float {
  from {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  to {
    transform: translateY(-100vh);
    opacity: 0;
  }
}



  
}
