:root {
  --bg: #0b0b0f;
  --card: #1a1a22;
  --text: #f6f7fb;
  --muted: #8b8d98;
  --primary: #6366f1;
  --accent: #6ce5b1;
  --danger: #ff5c7a;
  --gold: #ffd146;
  --orange: #ff6b35;
  --xl: 1280px;
}

* { box-sizing: border-box; }
html, body { 
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app { min-height: 100dvh; }

/* Page wrapper для корректного layout с Footer */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding-bottom: 0;
}

.container { padding: 16px; }
.container-xl { padding: 16px; max-width: var(--xl); margin: 0 auto; }
.row { display: flex; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3-desktop { grid-template-columns: repeat(2, 1fr); }

.banner {
  position: relative; border-radius: 20px; overflow: hidden; height: 200px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%); margin: 16px 16px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.banner video, .banner img { width: 100%; height: 100%; object-fit: cover; display:block; }
.banner .banner-content { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 2; }
.banner .banner-brand { font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); font-style: italic; }
.banner .banner-promo { display: flex; gap: 8px; }
.banner .banner-icons { display: flex; gap: 8px; }
.banner .banner-icon { background: rgba(255,255,255,.25); backdrop-filter: blur(8px); padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #fff; }
.banner .banner-icon.pro-badge { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.banner .banner-cta { position: absolute; right: 16px; bottom: 16px; background: #fff; color: #1a1a1a; padding: 12px 24px; border-radius: 24px; font-weight: 700; font-size: 14px; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: transform 0.2s; z-index: 2; }
.banner .banner-cta:hover { transform: scale(1.05); }
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.6) 100%); z-index: 1; }

.section-header { display:flex; align-items:center; justify-content:space-between; padding: 20px 16px 12px; }
.section-header h2 { margin: 0; font-size: 20px; font-weight: 800; }
.see-all { color: var(--muted); font-size: 14px; text-decoration: none; font-weight: 600; }
.see-all:hover { color: var(--text); }

.h-scroll { display:flex; gap: 14px; overflow-x:auto; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
.h-scroll::-webkit-scrollbar { display:none; }
.h-scroll > * { scroll-snap-align: start; }

.card {
  position:relative; min-width: 160px; width: 160px; height: 220px; border-radius: 16px; overflow: hidden; background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.2); transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; display:block; }
.card .card-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.8) 100%); display: flex; align-items: center; gap: 10px; }
.card .card-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; flex-shrink: 0; }
.card .card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card .card-title { font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.chip { position:absolute; right:8px; top:8px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); color: #fff; padding: 6px 10px; border-radius: 14px; font-size: 11px; display:flex; gap:6px; align-items:center; }
.chip .price { color: var(--gold); font-weight:700; }

/* Effect Card - точный стиль higgsfield */
.effect-card-wrapper {
  position: relative;
  padding: 4px;
  width: 100%;
  height: 100%;
}

.effect-card-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  z-index: 0;
  transition: filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
}

.effect-card-wrapper:hover .effect-card-inner {
  filter: brightness(0.3);
}

.effect-card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.effect-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, transparent 50%, transparent 100%);
}

@media (min-width: 768px) {
  .effect-card-overlay {
    padding: 20px;
    background: linear-gradient(180deg, transparent 0%, transparent 50%, rgba(0,0,0,.3) 100%);
  }
}

.effect-card-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: auto;
}

@media (min-width: 768px) {
  .effect-card-title {
    text-align: center;
    font-size: 16px;
    margin-bottom: 0;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .effect-card-title {
    font-size: 18px;
    line-height: 1.75;
  }
}

.effect-card-generate-btn {
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(209, 254, 23, 0.2);
  border-radius: 12px;
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(209, 254, 23, 0.05);
  color: rgb(209, 254, 23);
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin-top: auto;
}

@media (min-width: 768px) {
  .effect-card-generate-btn {
    opacity: 0;
  }
  
  .effect-card-wrapper:hover .effect-card-generate-btn {
    opacity: 1;
  }
}

.effect-card-generate-btn:hover {
  background: rgba(209, 254, 23, 0.1);
}

.effect-card-generate-btn:active {
  background: rgba(209, 254, 23, 0.15);
}

.floating-cta { position: sticky; left: 0; right: 0; bottom: 80px; margin: 0 16px; display:flex; justify-content:center; }
.floating-cta .btn-primary { filter: drop-shadow(0 8px 24px rgba(91,124,250,.4)); }

.watermark { position:absolute; right:10px; bottom:10px; background: rgba(0,0,0,.5); color:#fff; padding:4px 8px; border-radius:6px; font-size:12px; }

.toolbar { position: fixed; left: 0; right: 0; bottom: 0; height: 68px; display:flex; background: rgba(11,11,15,.98); backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,0.08); z-index: 100; }
.toolbar a { flex:1; display:flex; flex-direction: column; align-items:center; justify-content:center; gap:4px; color: var(--muted); text-decoration:none; font-weight:600; font-size: 12px; transition: color 0.2s; }
.toolbar a.active { color: var(--orange); }
.toolbar .center { position: relative; }
.toolbar .center .fab { position:absolute; top:-28px; width:60px; height:60px; border-radius:50%; background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color:#fff; display:flex; align-items:center; justify-content:center; font-size:28px; font-weight:800; box-shadow: 0 8px 32px rgba(99,102,241,.5); border: 4px solid var(--bg); }

.titlebar { display:flex; align-items:center; justify-content:space-between; padding: 14px 16px 6px; }
.titlebar h1 { margin:0; font-size: 22px; }
.pro { background: #2440ff; color:#fff; padding:6px 10px; border-radius: 14px; font-weight:700; font-size: 12px; }

.btn-primary, .btn, .btn-outline {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:700; padding: 14px 20px; border-radius: 14px; text-decoration:none; border: none; cursor:pointer;
  transition: all 0.2s; font-size: 15px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color:#fff; box-shadow: 0 4px 16px rgba(99,102,241,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.btn-outline { border:1px solid rgba(255,255,255,.15); color:#fff; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.05); }
.btn { background: #2b2c36; color:#fff; }
.btn:hover { background: #35364a; }

.muted { color: var(--muted); }
.price { color: var(--gold); font-weight: 800; }
.divider { height:1px; background: rgba(255,255,255,.06); margin: 8px 16px; }

.input, .select, .file {
  width:100%; background: #1a1a22; border: 1px solid rgba(255,255,255,.08); color:#fff;
  padding: 12px 14px; border-radius: 12px; outline: none; font-size: 16px;
}
.field { display:flex; flex-direction:column; gap:8px; margin-bottom: 12px; }

.pill { display:inline-flex; align-items:center; gap:6px; background:#1d1e27; padding:6px 10px; border-radius:999px; font-size:12px; }

.result-video { position:relative; border-radius: 16px; overflow:hidden; background:#111; }
.share-row { display:flex; gap:8px; flex-wrap:wrap; }

.notice { background: #14202a; color:#d0efff; border: 1px solid #203040; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

.timer { font-variant-numeric: tabular-nums; }
.section-title-xl { font-size: 42px; font-weight: 900; margin: 16px 0 12px; color: #c4ffc1; }
.pro-cta { background:#2440ff; color:#fff; padding:6px 10px; border-radius:14px; font-weight:700; text-decoration:none; }

.filter-row { display:flex; gap:8px; overflow:auto; padding: 8px 16px; }
.filter-chip { background:#1d1e27; color:#fff; border:1px solid rgba(255,255,255,.08); padding:8px 12px; border-radius:999px; white-space:nowrap; cursor:pointer; font-weight:700; }
.filter-chip.active { background:#2b2c36; border-color:#2b2c36; color:#c4ffc1; }

/* Desktop layout */
.desktop-only { display: none; }
.mobile-only { display: block; }

.header { position: sticky; top: 0; z-index: 10; background: rgba(11,11,15,.95); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); }
.header-top { display:flex; align-items:center; gap:16px; padding: 14px 24px; max-width: var(--xl); margin: 0 auto; }
.header-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 20px; letter-spacing: .5px; }
.header-top .brand-logo { font-size: 24px; }
.header-top .grow { flex: 1; }
.header-link { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; transition: color 0.2s; }
.header-link:hover { color: var(--accent); }

/* Баланс звезд в шапке */
.header-stars-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.15), rgba(234, 179, 8, 0.1));
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-left: 12px;
}
.header-stars-balance:hover {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(234, 179, 8, 0.15));
  transform: scale(1.05);
}
.header-stars-balance .stars-icon {
  font-size: 16px;
  color: #facc15;
}
.header-stars-balance .stars-count {
  font-size: 14px;
  font-weight: 700;
  color: #facc15;
}

.header-btn { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,.05); transition: background 0.2s; }
.header-btn:hover { background: rgba(255,255,255,.1); }
.header-btn-primary { color: #0b0b0f; background: #c4ffc1; text-decoration: none; font-size: 14px; font-weight: 700; padding: 8px 20px; border-radius: 8px; transition: background 0.2s; }
.header-btn-primary:hover { background: #b0eb9f; }
.header-nav { display:flex; gap: 24px; overflow:auto; max-width: var(--xl); margin: 0 auto; padding: 0 24px 14px; align-items: center; }
.header-nav .nav-link-wrapper { position: relative; }
.header-nav .nav-link { color: var(--text); text-decoration:none; font-weight: 500; font-size: 14px; white-space: nowrap; padding-bottom: 2px; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.header-nav .nav-link:hover { border-color: var(--accent); }
.header-nav .nav-link-highlight { color: #c4ffc1; font-weight: 700; }
.header-nav .nav-badge { position: absolute; top: -8px; right: -28px; background: #4ade80; color: #0b0b0f; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }

.hero-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card.hero { height: 260px; min-width: auto; width:auto; border-radius: 16px; }
.card.hero .hero-overlay { position:absolute; inset:0; display:flex; align-items:flex-end; padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,.0) 40%, rgba(0,0,0,.55) 100%); }
.hero-title { font-size: 22px; font-weight: 900; }

.masonry { column-count: 4; column-gap: 16px; }
.masonry .card { width: 100%; height: auto; min-height: 220px; display: inline-block; margin: 0 0 16px; }

/* Tools Grid */
.tools-section { margin: 16px 0 20px; }
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tool-card { 
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; 
  padding: 20px 12px; border-radius: 16px; text-decoration: none; color: #fff; 
  min-height: 120px; box-shadow: 0 4px 16px rgba(0,0,0,.2); transition: transform 0.2s;
}
.tool-card:hover { transform: translateY(-4px); }
.tool-badge { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.25); backdrop-filter: blur(8px); padding: 4px 8px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.tool-icon { font-size: 32px; margin-bottom: 8px; }
.tool-title { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; white-space: pre-line; }

/* Tab Navigation */
.tab-nav { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 12px; }
.tab-nav-tabs { display: flex; gap: 12px; }
.tab-nav-btn { background: transparent; border: none; color: var(--muted); font-size: 20px; font-weight: 700; cursor: pointer; padding: 0; transition: color 0.2s; }
.tab-nav-btn.active { color: #ff6b35; border-bottom: 3px solid #ff6b35; padding-bottom: 4px; }
.tab-nav-more { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.tab-nav-more:hover { color: var(--text); }

/* Promo Banner */
.promo-banner { 
  background: linear-gradient(135deg, #8b5a3c 0%, #6d4c41 100%); 
  border-radius: 16px; padding: 16px 20px; margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.promo-content { display: flex; align-items: center; justify-content: space-between; }
.promo-text { flex: 1; }
.promo-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.promo-subtitle { font-size: 12px; color: rgba(255,255,255,.8); }
.promo-btn { 
  background: #ff5722; color: #fff; border: none; padding: 10px 20px; 
  border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 12px rgba(255,87,34,.4); transition: transform 0.2s;
}
.promo-btn:hover { transform: scale(1.05); }

/* Promo Slider - точный стиль higgsfield */
.promo-slider-higgsfield {
  position: relative;
  width: 100%;
  margin: 20px 0;
}

.promo-slider-container-higgsfield {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 20rem;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.promo-slider-container-higgsfield::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 25rem;
  }
}

@media (min-width: 768px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 30rem;
  }
}

@media (min-width: 1024px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 35rem;
  }
}

@media (min-width: 1280px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 40rem;
  }
}

.promo-slide {
  min-width: 0;
  height: 400px;
  position: relative;
  display: block;
  border-radius: 12px;
  padding: 8px;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.promo-slide:hover {
  color: var(--primary);
}

.promo-slide:active {
  filter: brightness(0.6);
}

.promo-slide-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  z-index: 0;
}

.promo-slide-content {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 16px 20px 24px;
  color: #fff;
  z-index: 2;
  text-align: left;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.7) 100%);
  border-radius: 0 0 8px 8px;
}

.promo-slide-subtitle {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.promo-slide-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.promo-slide-description {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
  line-height: 1.4;
}

.promo-slide-cta {
  display: inline-block;
  background: #fff;
  color: #0b0b0f;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.promo-slide-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.promo-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.promo-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  padding: 0;
}

.promo-slider-dot.active {
  background: #fff;
  transform: scale(1.3);
}

.promo-slider-dot:hover {
  background: rgba(255,255,255,.7);
}

/* Video Effects Section - точный стиль higgsfield */
.video-effects-section {
  margin: 60px 0;
  scroll-margin-top: 56px;
}

@media (min-width: 768px) {
  .video-effects-section {
    scroll-margin-top: 176px;
  }
}

.video-effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  padding: 0;
}

@media (min-width: 640px) {
  .video-effects-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 768px) {
  .video-effects-grid {
    gap: 20px;
  }
}

.video-effects-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.home-screen-1 {
  margin: 20px 0 40px;
}

.home-screen-2 {
  margin: 0 0 40px;
}

@media (min-width: 960px) {
  #app { padding-bottom: 0; }
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .grid-3-desktop { grid-template-columns: repeat(3, 1fr); }
  .banner { height: 280px; margin: 20px auto; max-width: var(--xl); }
  .section-header { padding: 20px 0 12px; max-width: var(--xl); margin: 0 auto; }
  .h-scroll { padding: 0 0 12px; max-width: var(--xl); margin: 0 auto; gap: 16px; }
  .card { min-width: 180px; width: 180px; height: 240px; }
  
  .promo-slider-container-higgsfield {
    max-width: var(--xl);
    margin: 0 auto;
  }

  .promo-slide-content {
    padding: 24px 32px 32px;
  }

  .promo-slide-title {
    font-size: 24px;
  }

  .promo-slide-description {
    font-size: 15px;
  }

  .video-effects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .effect-card-wrapper {
    min-width: 240px;
    height: 320px;
  }

  .home-screen-1 {
    margin: 32px 0 60px;
  }

  .home-screen-2 {
    margin: 0 0 60px;
  }
}

/* Visual Effects Screen - стиль higgsfield.ai */
.visual-effects-screen {
  margin: 40px 0 60px;
  padding: 0;
}

.visual-effects-title-container {
  padding: 20px 16px 24px;
}

.visual-effects-title {
  font-size: 48px;
  font-weight: 900;
  color: #6ce5b1;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .visual-effects-title {
    font-size: 64px;
  }
}

@media (min-width: 960px) {
  .visual-effects-title {
    font-size: 80px;
    padding: 0;
  }
  
  .visual-effects-title-container {
    padding: 40px 0 32px;
  }
}

/* Сетка тегов эффектов */
.visual-effects-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 24px;
}

@media (min-width: 960px) {
  .visual-effects-tags-grid {
    padding: 0 0 32px;
    gap: 12px;
  }
}

.visual-effects-tag {
  background: rgba(26, 26, 34, 0.9);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  color: #f6f7fb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.visual-effects-tag:hover {
  background: rgba(26, 26, 34, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.visual-effects-tag:active {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .visual-effects-tag {
    font-size: 14px;
    padding: 12px 18px;
  }
}

/* Превью эффектов */
.visual-effects-previews {
  padding: 0 16px 24px;
}

@media (min-width: 960px) {
  .visual-effects-previews {
    padding: 0 0 40px;
  }
}

.visual-effects-previews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 640px) {
  .visual-effects-previews-grid {
    gap: 12px;
  }
}

@media (min-width: 960px) {
  .visual-effects-previews-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.visual-effects-preview-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--card);
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.visual-effects-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.visual-effects-preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-effects-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.visual-effects-preview-card:hover .visual-effects-preview-overlay {
  opacity: 1;
}

.visual-effects-preview-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.visual-effects-preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(108, 229, 177, 0.2);
  backdrop-filter: blur(8px);
  color: #6ce5b1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 1;
}

@media (min-width: 640px) {
  .visual-effects-preview-title {
    font-size: 16px;
  }
  
  .visual-effects-preview-badge {
    font-size: 12px;
    padding: 8px 14px;
  }
}
/* ========================================
   PROFILE PAGE STYLES (Appended Nov 19)
   ======================================== */

/* Profile Page Styles */
.profile-page {
  max-width: 960px;
  margin: 0 auto;
  padding-top: 20px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.profile-header-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.profile-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

.profile-header-info {
  flex: 1;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.profile-email {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 4px 0;
}

.profile-username {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.profile-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

/* Generations Grid */
.generations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.generation-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s;
}

.generation-card:hover {
  transform: translateY(-4px);
}

.generation-preview {
  width: 100%;
  height: 160px;
  background: rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.generation-preview video,
.generation-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.2);
}

.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-done {
  background: rgba(108, 229, 177, 0.2);
  color: var(--accent);
}

.status-badge.status-processing {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.status-badge.status-error {
  background: rgba(255, 92, 122, 0.2);
  color: var(--danger);
}

.status-badge.status-queued {
  background: rgba(255, 209, 70, 0.2);
  color: var(--gold);
}

.generation-info {
  padding: 12px;
}

.generation-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.generation-template {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.generation-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Settings Section */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-card {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
}

.settings-card h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
}

.settings-field {
  margin-bottom: 16px;
}

.settings-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.settings-field input {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.settings-field input:focus {
  outline: none;
  border-color: var(--primary);
}

.settings-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 16px;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.form-success {
  color: var(--accent);
  font-size: 12px;
  margin-top: 4px;
}

/* Subscription Card */
.subscription-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  margin-bottom: 16px;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-title {
  font-size: 16px;
  font-weight: 700;
}

.sub-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sub-badge.status-pro {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
}

.sub-badge.status-free {
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}

.sub-expiry {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Credits Card */
.credits-card {
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  padding: 24px;
  border-radius: 12px;
  color: #000;
}

.credits-card h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.8;
}

.credits-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.credits-value {
  font-size: 48px;
  font-weight: 900;
}

.credits-info span {
  font-size: 18px;
  opacity: 0.8;
}

.progress-bar-container {
  height: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Load More Button */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.load-more-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Header Profile Dropdown Styles */
.header-profile {
  position: relative;
}

.profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 1000;
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown-user-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dropdown-user-email {
  font-size: 12px;
  color: var(--muted);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.1);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО КАРТОЧКИ ШАБЛОНА
   ============================================ */

/* Модальное окно на весь экран */
.template-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  padding: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Оверлей-контейнер с прокруткой */
.template-modal-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 120px; /* Отступы для кнопки закрытия и нижней панели */
}

/* Контейнер контента модалки */
.template-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Кнопка закрытия (красивая современная) */
.template-modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
  pointer-events: auto; /* ВАЖНО: кнопка должна быть кликабельной */
  -webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе */
}

.template-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.template-modal-close:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.9); /* Темнее при нажатии */
}

/* SVG иконка крестика */
.template-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: transform 0.2s ease;
  pointer-events: none; /* SVG не должен перехватывать клики */
}

.template-modal-close:hover svg {
  transform: rotate(90deg);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .template-modal-close {
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8); /* Более контрастная на мобильных */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
  
  .template-modal-close svg {
    width: 22px;
    height: 22px;
    stroke-width: 3; /* Толще линии для лучшей видимости */
  }
}

/* Старый класс для совместимости */
.template-modal-close-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.template-modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.template-modal-close-btn:active {
  transform: scale(0.95);
}

/* Контейнер видео - адаптивный под формат */
.template-modal-video-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

/* Видео - адаптивное под формат */
.template-modal-video {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  display: block;
}

/* Для мобильных - больше места для видео */
@media (max-width: 768px) {
  .template-modal-video {
    max-height: 60vh;
    border-radius: 12px;
  }
}

/* Информационная панель под видео */
.template-modal-info {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Название шаблона */
.template-modal-title {
  font-size: 32px;
  font-weight: 700;
  color: white;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

/* Промпт превью */
.template-modal-prompt {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.template-modal-prompt-preview {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
  max-width: 100%;
}

/* Кнопка создания */
.template-modal-create-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-transform: none;
  letter-spacing: 0.02em;
  width: auto;
  min-width: 280px;
}

.template-modal-create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.template-modal-create-btn:active {
  transform: translateY(0);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .template-modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .template-modal-close-btn {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .template-modal-overlay {
    padding: 50px 15px 100px;
  }

  .template-modal-title {
    font-size: 24px;
  }

  .template-modal-prompt {
    font-size: 12px;
    max-width: 90%;
  }

  .template-modal-prompt-preview {
    font-size: 13px;
  }

  .template-modal-create-btn {
    padding: 16px 36px;
    font-size: 16px;
    min-width: 240px;
  }
}

/* ============================================
   ФОРМА ГЕНЕРАЦИИ КОНТЕНТА
   ============================================ */

/* Страница формы генерации */
.generation-form-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50; /* Ниже toolbar (100), но выше обычного контента */
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 100%);
  padding-bottom: 68px; /* Отступ для мобильного toolbar */
}

.generation-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 100px; /* Отступ снизу для скролла */
}

/* Заголовок формы */
.generation-form-header {
  margin-bottom: 30px;
}

/* Кнопка "Назад" */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
  transform: translateX(-2px);
}

.btn-back:active {
  transform: translateX(-1px);
}

.generation-form-header h2 {
  margin: 15px 0 5px;
  color: white;
  font-size: 28px;
  font-weight: 700;
}

.generation-form-header .muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Превью видео в форме */
.generation-preview {
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Превью видео в форме */
.generation-preview-video-container {
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.generation-preview-video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: contain;
}

/* Маленькое превью шаблона слева */
.template-preview-small {
  width: 100%;
  height: 160px; /* Фиксированная высота, компактнее */
  margin-bottom: 0; /* Убрал отступ */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: #000;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.template-preview-title {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px; /* Меньше шрифт */
  font-weight: 600;
  padding: 4px 8px; /* Меньше паддинги */
  border-radius: 6px;
  text-transform: uppercase;
}

.template-preview-video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: cover;
}

/* Плейсхолдер для результата справа */
.generation-result-placeholder {
  width: 100%;
  height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.generation-result-placeholder h3 {
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.generation-result-placeholder p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

/* ============================================
   GENERATION PROGRESS CONTAINER
   ============================================ */
.generation-progress-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.progress-status {
  color: rgba(76, 175, 80, 0.9);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 10px;
  animation: progressAnimation 2s ease-in-out infinite;
  width: 70%;
}

@keyframes progressAnimation {
  0% {
    transform: translateX(-100%);
    opacity: 0.5;
  }
  50% {
    transform: translateX(50%);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0.5;
  }
}

.progress-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 12px;
}

.progress-time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-style: italic;
}

/* ============================================
   GENERATION RESULT CONTAINER
   ============================================ */
.generation-result-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(76, 175, 80, 0.3);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-title {
  color: rgba(76, 175, 80, 0.95);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.result-video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* ============================================
   GENERATION ERROR CONTAINER
   ============================================ */
.generation-error-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 59, 48, 0.05);
  border: 2px solid rgba(255, 59, 48, 0.3);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-title {
  color: rgba(255, 59, 48, 0.95);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.error-message {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin-bottom: 30px;
  max-width: 400px;
}

.btn-retry {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Секция загрузки изображения */
.upload-section {
  width: 100%;
  min-height: 140px; /* Изменил на min-height вместо height */
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0;
  position: relative; /* Добавил для правильного z-index */
}

.upload-section:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.3);
}

.upload-icon {
  font-size: 24px;
  margin-bottom: 6px;
  opacity: 0.5;
  pointer-events: none; /* Не блокирует клики */
}

.upload-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 2px;
  line-height: 1.4;
  pointer-events: none; /* Не блокирует клики */
}

.upload-label {
  pointer-events: none; /* Не блокирует клики */
}

.upload-link {
  color: #c4ffc1;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto; /* Позволяет кликать */
}

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

.upload-subtext {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  pointer-events: none; /* Не блокирует клики */
}

/* Превью загруженного изображения */
.upload-preview {
  position: relative;
  width: 100%;
  min-height: 140px;
  overflow: hidden;
  border-radius: 8px;
}

.upload-preview-image {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
}

.upload-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.upload-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

/* Промпт инпут */
.prompt-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 8px;
}

.prompt-input:focus {
  outline: none;
  border-color: rgba(196, 255, 193, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Адаптивная двухколоночная раскладка для десктопа */
@media (min-width: 960px) {
  .generation-form-content {
    display: grid;
    grid-template-columns: 280px 1fr; /* Уменьшил ширину левой колонки */
    gap: 30px; /* Уменьшил отступ */
    max-width: 1600px;
    margin: 0 auto;
  }

  /* Левая колонка с настройками */
  .generation-form-left {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Уменьшил отступы между элементами */
  }

  /* Правая колонка с результатом */
  .generation-form-right {
    position: sticky;
    top: 20px;
    height: fit-content;
  }

  .generation-result-placeholder {
    height: 80vh; /* Увеличил высоту плеера */
    min-height: 600px;
    background: #000;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .template-preview-video {
    max-height: 160px; /* Уменьшил высоту видео */
    object-fit: cover;
  }
}

.section-title {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Название эффекта */
.effect-title {
  color: white;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: 1px;
}

/* Подсказка для промпта */
.prompt-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Адаптив для мобильных - все подряд */
@media (max-width: 959px) {
  .generation-form-content {
    display: flex;
    flex-direction: column;
  }

  .generation-form-left,
  .generation-form-right {
    width: 100%;
  }

  /* На мобильном видео идет после заголовка эффекта */
  .generation-form-right {
    order: 0;
  }
  
  .effect-title {
    order: -1;
  }

  .effect-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .generation-preview-video-container {
    margin-bottom: 30px;
  }
}

/* Секция промпта */
.generation-prompt-section {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  color: white;
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 500;
}

.prompt-display {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.6;
  min-height: 60px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.form-hint {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

/* Секция добавления деталей */
.generation-addon-section {
  margin-bottom: 25px;
}

.prompt-addon-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
}

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

.prompt-addon-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 5px;
}

/* Секция настроек */
.generation-settings-section {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.section-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

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

.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  outline: none;
  border-color: #667eea;
  background-color: rgba(255, 255, 255, 0.1);
}

.form-select option {
  background: #1a1a2e;
  color: white;
}

/* Информация о стоимости */
.generation-cost-info {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cost-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.cost-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cost-balance {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* Большая кнопка генерации */
.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Адаптив для формы */
@media (max-width: 768px) {
  .generation-form-header h2 {
    font-size: 24px;
  }

  .generation-preview-video {
    max-height: 200px;
  }

  .section-title {
    font-size: 16px;
  }

  .cost-value {
    font-size: 20px;
  }
}


/* ============================================
   ЗАГОЛОВОК ЭФФЕКТА (как на скриншоте)
   ============================================ */

.generation-effect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.generation-effect-title {
  font-size: 24px;
  font-weight: 700;
  color: #b4ff39;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(180, 255, 57, 0.3);
}

.generation-change-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.generation-change-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}


/* ============================================
   МОБИЛЬНАЯ ШАПКА В СТИЛЕ HIGGSFIELD
   Добавлено: 2025-11-20
   ============================================ */

/* Мобильная шапка */
.mobile-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.mobile-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: 56px;
}

/* Логотип слева */
.mobile-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

.mobile-header-logo-icon {
  font-size: 24px;
  line-height: 1;
}

.mobile-header-logo-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* Категория по центру */
.mobile-header-category {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-header-category-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-header-category-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-header-category-arrow {
  font-size: 10px;
  opacity: 0.7;
}

/* Бургер-меню справа */
.mobile-header-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.mobile-header-menu-icon {
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-header-menu-btn:active .mobile-header-menu-icon {
  background: var(--accent);
}

/* ============================================
   НИЖНЕЕ МЕНЮ В СТИЛЕ HIGGSFIELD (5 элементов)
   Обновлено: 2025-11-20
   ============================================ */

/* Обновленная навигация */
.toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  display: flex;
  background: #000;
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.toolbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
  transition: color 0.2s;
  padding: 8px 4px;
  min-width: 0;
}

.toolbar-icon {
  font-size: 24px;
  line-height: 1;
}

.toolbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.toolbar-item.active {
  color: #b4ff39;
}

.toolbar-item.active .toolbar-icon {
  transform: scale(1.1);
}

/* Центральная кнопка-звезда */
.toolbar-center {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-fab {
  position: absolute;
  top: -28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b4ff39 0%, #7dff00 100%);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(180, 255, 57, 0.4);
  border: 4px solid #000;
  transition: transform 0.2s;
  cursor: pointer;
}

.toolbar-fab:active {
  transform: scale(0.95);
}

.toolbar-fab-icon {
  font-size: 28px;
  line-height: 1;
}

/* Адаптивность для планшетов */
@media (min-width: 768px) {
  .mobile-header-container {
    padding: 12px 24px;
  }
  
  .toolbar {
    padding: 0 24px;
  }
}

/* Скрыть мобильную шапку на десктопе */
@media (min-width: 960px) {
  .mobile-header {
    display: none !important;
  }
}


/* ============================================
   FIXES & MODERNIZATION (2025-11-20 Update 2)
   Исправление отображения и улучшение дизайна
   ============================================ */

/* 1. СТРОГОЕ СКРЫТИЕ НА ДЕСКТОПЕ */
@media (min-width: 960px) {
  .mobile-only, 
  .mobile-header, 
  .toolbar {
    display: none !important;
  }
}

/* 2. СОВРЕМЕННАЯ МОБИЛЬНАЯ ШАПКА */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  pointer-events: none; /* Пропускаем клики сквозь контейнер */
}

.mobile-header-glass {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-section {
  display: flex;
  align-items: center;
  flex: 1;
}

.header-section.center { justify-content: center; }
.header-section.right { justify-content: flex-end; }

/* Логотип */
.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

.mobile-logo-icon {
  font-size: 22px;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Центральная пилюля (Context Pill) */
.context-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px 6px 16px;
  border-radius: 100px;
  color: #f6f7fb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.chevron-down {
  font-size: 8px;
  opacity: 0.6;
  margin-top: 1px;
}

/* Бургер-меню (Современное) */
.burger-btn {
  background: none;
  border: none;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  cursor: pointer;
}

.burger-line {
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.burger-line:first-child { width: 24px; }
.burger-line:last-child { width: 16px; }

.burger-btn:active .burger-line {
  width: 24px;
  background-color: var(--accent);
}

/* 3. СОВРЕМЕННОЕ НИЖНЕЕ МЕНЮ */
.toolbar {
  height: 84px; /* Больше высоты для FAB */
  padding-bottom: 20px; /* Учет safe area */
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, #000 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  align-items: flex-start; /* Выравнивание по верху для FAB */
  padding-top: 12px;
}

.toolbar-item {
  opacity: 0.5;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 6px;
}

.toolbar-item.active {
  opacity: 1;
  color: var(--accent);
}

.toolbar-item.active .toolbar-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(180, 255, 57, 0.4));
}

.toolbar-icon {
  font-size: 22px;
}

.toolbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* FAB (Центральная кнопка) */
.toolbar-center {
  margin-top: -28px; /* Поднимаем кнопку над баром */
}

.toolbar-fab {
  width: 64px;
  height: 64px;
  background: #b4ff39; /* Кислотный лайм */
  color: #000;
  box-shadow: 0 8px 24px rgba(180, 255, 57, 0.25), 
              0 2px 8px rgba(180, 255, 57, 0.2),
              inset 0 2px 4px rgba(255,255,255,0.5);
  border: none; /* Убираем черную обводку для чистоты */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px; /* Squircle форма */
  transform: rotate(45deg); /* Ромб */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toolbar-fab-icon {
  font-size: 28px;
  transform: rotate(-45deg); /* Возвращаем иконку */
  display: block;
}

/* Эффект нажатия на FAB */
.toolbar-fab:active {
  transform: rotate(45deg) scale(0.9);
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.4);
}

/* Маленькая FAB кнопка для страниц генерации */
.toolbar-center-small {
  margin-top: -16px; /* Меньше подъём */
}

.toolbar-fab-small {
  width: 44px !important;
  height: 44px !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.25) !important;
}

.toolbar-fab-small .toolbar-fab-icon {
  font-size: 20px;
}

.toolbar-fab-small .toolbar-fab-svg {
  width: 20px;
  height: 20px;
}

.toolbar-fab-small:active {
  transform: rotate(45deg) scale(0.92);
}

/* Компенсация отступа для контента, чтобы не перекрывался хедером/футером */
@media (max-width: 959px) {
  #app {
    padding-top: 0; /* Хедер sticky, не нужен padding */
    padding-bottom: 100px; /* Больше места снизу */
  }
  
  /* Скрываем десктопные элементы */
  .desktop-only {
    display: none !important;
  }
}


/* ============================================
   MOBILE ICONS & HEADER FIXES (2025-11-20 Update 3)
   ============================================ */

/* Fix Mobile Header Visibility */
.mobile-header {
  position: fixed !important; /* Ensure it's fixed */
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999; /* Very high z-index */
  height: 60px;
  pointer-events: none;
  display: block; /* Force display */
}

@media (min-width: 960px) {
  .mobile-header {
    display: none !important;
  }
}

/* Ensure content isn't hidden behind fixed header on mobile */
@media (max-width: 959px) {
  #app {
    padding-top: 60px !important; /* Match header height */
    padding-bottom: 100px !important;
  }
}

/* SVG Icons Styling */
.nav-svg-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.toolbar-item.active .nav-svg-icon {
  stroke-width: 2.5; /* Thicker stroke for active */
  filter: drop-shadow(0 0 5px rgba(180, 255, 57, 0.6));
}

/* FAB Icon Styling */
.toolbar-fab-svg {
  width: 28px;
  height: 28px;
  stroke: #000; /* Black icon on lime background */
  stroke-width: 2.5;
  transform: rotate(0deg); /* Ensure no rotation unless needed */
}

/* Fix toolbar icon container */
.toolbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit; /* Reset font size as we use SVG width/height */
}

/* ============================================
   MOBILE MENU LOGIC & STYLES (2025-11-20 Update 4)
   ============================================ */

/* Кнопка Try Free для неавторизованных */
.try-free-btn {
  background: #b4ff39;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
}

.try-free-btn:active {
  transform: scale(0.96);
  background: #a3e632;
}

/* Выпадающее меню мобильной шапки */
.mobile-menu-dropdown {
  position: fixed;
  top: 60px; /* Высота хедера */
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9998; /* Чуть ниже хедера */
}

.mobile-menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu-item {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.mobile-menu-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item.danger {
  color: #ef4444;
}

.mobile-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 0;
}

/* Анимация бургера */
.burger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger-line {
  width: 24px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Крестик при активном меню */
.burger-btn.active .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-btn.active .burger-line:nth-child(3) { /* Добавим третью линию для полноценного бургера если нужно, но у нас 2 */
  /* Если было 2 линии, то анимация другая */
}

/* Адаптация для 2-х линий (как сейчас в коде) */
.burger-line:first-child {
  transform-origin: center;
}
.burger-line:last-child {
  transform-origin: center;
}

.burger-btn.active .burger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}
.burger-btn.active .burger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ============================================
   DESIGN FIXES (2025-11-20 Update 5)
   ============================================ */

/* Улучшенная кнопка "Попробовать" */
.try-free-btn {
  background: linear-gradient(135deg, #b4ff39 0%, #7dff00 100%);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  border-radius: 24px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.3);
  border: 1px solid rgba(0,0,0,0.1);
}

.try-free-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(180, 255, 57, 0.2);
}

/* Стилизация SVG иконок в меню */
.mobile-menu-item {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 14px 16px; /* Чуть больше воздуха */
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  fill: currentColor;
  opacity: 0.8;
}

.mobile-menu-item:active .menu-item-icon {
  opacity: 1;
  transform: scale(1.1);
  transition: transform 0.2s;
}

/* Цветные иконки для важных пунктов */
.icon-lime { color: #b4ff39; }
.icon-blue { color: #60a5fa; }
.icon-purple { color: #c084fc; }
.icon-red { color: #f87171; }

/* Разделитель */
.mobile-menu-divider {
  margin: 6px 16px; /* Отступы по бокам */
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   FIX MENU CLICKS (2025-11-20 Update 6)
   ============================================ */

/* Исправление кликов в выпадающем меню */
.mobile-menu-dropdown {
  z-index: 9999 !important; /* Выше всех элементов */
  pointer-events: none; /* По умолчанию скрыто */
}

.mobile-menu-dropdown.active {
  pointer-events: auto !important; /* Когда открыто - кликабельно */
}

/* Убираем pointer-events:none с header, если меню активно */
.mobile-header:has(.mobile-menu-dropdown.active) {
  pointer-events: auto !important;
}

/* ============================================
   BUTTON & HEADER LAYOUT TWEAKS (2025-11-20 Update 7)
   ============================================ */

/* Уменьшаем кнопку "ПОПРОБОВАТЬ" */
.try-free-btn {
  font-size: 11px !important;
  padding: 0 14px !important;
  height: 32px !important;
  letter-spacing: 0.5px !important;
}

/* Корректировка сетки хедера для отступа от логотипа */
/* Логотип забирает место слева */
.header-section.left {
  flex: 0 0 auto !important; /* Логотип по содержимому */
  margin-right: auto; /* Толкаем всё остальное вправо */
}

/* Центральная секция с кнопкой сдвигается вправо */
.header-section.center {
  flex: 0 0 auto !important;
  margin-right: 8px; /* Отступ от бургера */
}

/* Бургер справа */
.header-section.right {
  flex: 0 0 auto !important;
}

/* Если нужно скрыть стандартную центровку */
.mobile-header-glass {
  justify-content: space-between; /* Распределяем: Лого ... Кнопка Бургер */
}

/* ============================================
   COMPACT UPLOAD PREVIEW (Added 2025-11-21)
   Оптимизация превью загруженного изображения
   ============================================ */

/* Контейнер при загруженном файле - сбрасываем стили большой зоны */
.upload-section.has-file {
  width: max-content !important; /* Занимает только место контента */
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin-bottom: 16px; /* Отступ снизу */
}

/* Само превью - фиксированный квадрат */
.upload-section.has-file .upload-preview {
  width: 120px;
  height: 120px;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Изображение внутри превью */
.upload-section.has-file .upload-preview-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover; /* Обрезаем лишнее, заполняя квадрат */
}

/* Кнопка удаления - делаем аккуратнее */
.upload-section.has-file .upload-remove-btn {
  width: 24px;
  height: 24px;
  font-size: 14px;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-section.has-file .upload-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
}

/* ============================================
   DYNAMIC MODEL CONFIGURATION UI (Added 2025-11-21)
   Стили для динамического интерфейса выбора моделей
   ============================================ */

/* Секция выбора модели */
.generation-model-section {
  margin-bottom: 24px;
}

.model-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Карточка модели */
.model-card {
  background: var(--card-bg, #1a1a1a);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.model-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.model-card.selected {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.model-card-header input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4CAF50;
}

.model-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.model-card-info {
  margin-left: 32px;
}

.model-card-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  line-height: 1.4;
}

.model-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.model-meta-item {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Контейнер динамических параметров */
.dynamic-params-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Секция параметра */
.param-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 16px;
}

.param-header {
  margin-bottom: 12px;
}

.param-label {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
}

.param-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

/* Input элементы */
.form-select,
.form-input,
.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================
   SCENES (STORYBOARD)
   ============================================ */
.scenes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   UPLOAD DISCLAIMER
   ============================================ */
.upload-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.disclaimer-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.disclaimer-text {
  font-size: 13px;
  color: rgba(255, 152, 0, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.scene-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.scene-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scene-number {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scene-remove-btn {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 6px;
  color: #ff3b30;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scene-remove-btn:hover {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.5);
}

.scene-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.scene-textarea:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.6);
}

.scene-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.scene-duration {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-duration label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.scene-duration-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  width: 80px;
  transition: border-color 0.2s ease;
}

.scene-duration-input:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.6);
}

.btn-add-scene {
  width: 100%;
  background: rgba(76, 175, 80, 0.1);
  border: 1px dashed rgba(76, 175, 80, 0.4);
  border-radius: 10px;
  color: #4CAF50;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-add-scene:hover {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.6);
  transform: translateY(-1px);
}

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

/* ============================================
   SCENES VALIDATION & INFO
   ============================================ */
.scenes-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.warning-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.warning-text {
  font-size: 13px;
  color: rgba(255, 59, 48, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.scenes-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.info-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.info-text {
  font-size: 13px;
  color: rgba(76, 175, 80, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.form-input-small {
  width: 100px;
}

/* Textarea с счетчиком */
.textarea-container {
  position: relative;
}

.textarea-container .char-counter {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4CAF50;
}

.checkbox-container label {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

/* Множественная загрузка файлов */
.multi-upload-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-previews {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-preview-item {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.upload-preview-image-multi {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-remove-btn-multi {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.upload-remove-btn-multi:hover {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

.upload-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  text-align: center;
  font-weight: 600;
}

.upload-zone-multi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.upload-zone-multi:hover {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.05);
}

.upload-zone-multi .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-zone-multi .upload-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  text-align: center;
}

.upload-zone-multi .upload-subtext {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* Сцены (для SORA) */
.scenes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scene-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scene-number {
  font-size: 14px;
  font-weight: 600;
  color: #4CAF50;
}

.btn-remove-scene {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 0, 0, 0.2);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-scene:hover {
  background: rgba(255, 0, 0, 0.6);
  transform: scale(1.1);
}

.scene-description {
  margin-bottom: 12px;
}

.scene-duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-duration label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.scene-duration input {
  width: 80px;
}

.btn-add-scene {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.5);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-scene:hover {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4CAF50;
}

/* Кнопки */
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

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

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .model-card {
    padding: 12px;
  }
  
  .model-card-header {
    gap: 8px;
  }
  
  .model-card-name {
    font-size: 15px;
  }
  
  .model-card-info {
    margin-left: 28px;
  }
  
  .upload-preview-item {
    width: 100px;
    height: 100px;
  }
  
  .scene-item {
    padding: 12px;
  }
  
  .scene-duration {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .scene-duration input {
    width: 100%;
  }
}

/* Улучшение стилей для существующих элементов */
.generation-form-left {
  max-width: 600px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(76, 175, 80, 0.5);
}


/* ============================================
   GENERATION FORM REFACTOR (2025-11-21)
   ============================================ */

/* Layout Adjustments */
.generation-form-content {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.generation-form-left {
  flex: 1;
  max-width: 500px; /* Ограничиваем ширину формы */
}

.generation-form-right {
  flex: 1.5;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Section Spacing */
.form-section {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 24px;
}

.form-section:last-child {
  border-bottom: none;
}

/* 1. SLOTTED MEDIA UPLOAD */
.slotted-upload-wrapper {
  margin-bottom: 16px;
}

.upload-slots-container {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.upload-slot {
  width: 110px;
  height: 140px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-slot:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

.upload-slot.has-file {
  border-style: solid;
  border-color: transparent;
  background: #000;
}

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

.slot-icon {
  font-size: 24px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.slot-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 0 4px;
}

.slot-label.filled {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px;
  font-size: 10px;
}

.slot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
}

.slot-remove-btn:hover {
  background: #ff4444;
}

/* Photo Upload Specific Styles */
.photo-upload-wrapper {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

.photo-upload-wrapper .upload-header {
  margin-bottom: 12px;
}

.photo-upload-wrapper .section-title {
  font-size: 14px;
  color: #fff;
  margin: 0 0 4px 0;
}

.photo-upload-wrapper .section-description {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.photo-slots {
  flex-wrap: wrap;
}

.photo-slot {
  width: 80px;
  height: 80px;
  min-width: 80px;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
}

.photo-slot:hover {
  background: rgba(204,255,0,0.08);
  border-color: rgba(204,255,0,0.4);
}

.photo-slot.has-file {
  border: 2px solid rgba(204,255,0,0.5);
}

.photo-slot .slot-icon {
  font-size: 20px;
  color: rgba(204,255,0,0.6);
  margin-bottom: 4px;
}

.photo-slot .slot-label {
  font-size: 10px;
}

.upload-counter {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* 2. COMPACT MODEL SELECTOR */
.model-selector-compact {
  position: relative;
  width: 100%;
}

.model-selected-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.model-selected-display:hover {
  background: rgba(255,255,255,0.12);
}

.model-selected-display.open {
  border-color: #4CAF50;
}

.model-info-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.model-name {
  font-weight: 600;
  font-size: 14px;
}

.model-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-top: 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}

.model-dropdown.hidden {
  display: none;
}

.model-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.model-dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}

.model-dropdown-item.active {
  background: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
}

.model-cost-badge {
  margin-left: auto;
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 3. TEXTAREA & INPUTS */
.form-textarea {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

/* 4. FOOTER */
.footer-cost-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.cost-value {
  color: #FFD700;
}

.btn-generate-large {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  background: linear-gradient(45deg, #4CAF50, #45a049);
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.3s;
}

.btn-generate-large:active {
  transform: scale(0.98);
}

.btn-generate-large:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-generate-large.hidden {
  display: none;
}

/* 5. RIGHT COLUMN PREVIEW */
.demo-reference-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.demo-caption {
  position: absolute;
  bottom: 20px;
  background: rgba(0,0,0,0.7);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.placeholder-info {
  position: absolute;
  text-align: center;
  z-index: 2;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Mobile Adaptation */
@media (max-width: 900px) {
  .generation-form-content {
    flex-direction: column;
  }
  
  .generation-form-left {
    max-width: 100%;
  }
  
  .generation-form-right {
    min-height: 300px;
    order: -1; /* Move preview to top on mobile */
  }
}


/* ============================================
   SETTINGS & TEMPLATE UI UPDATES (2025-11-21)
   ============================================ */

/* 1. TEMPLATE PREVIEW (Top Left) */
.section-template {
  margin-bottom: 16px;
}

.template-mini-card {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background: #000;
}

.template-mini-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

/* Для фото шаблона - вписываем полностью без обрезки */
.template-mini-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
  background: #1a1a1a;
}

.template-mini-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.template-mini-title {
  font-size: 20px;
  font-weight: 800;
  color: #CCFF00; /* Lime Green accent like in screenshot */
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.template-change-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Блок выбора шаблона (свободный режим) */
.template-select-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30,30,40,0.9) 0%, rgba(20,20,30,0.95) 100%);
  border: 2px dashed rgba(204,255,0,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-select-card:hover {
  border-color: rgba(204,255,0,0.6);
  background: linear-gradient(135deg, rgba(40,40,50,0.9) 0%, rgba(30,30,40,0.95) 100%);
}

.template-select-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.template-select-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(204,255,0,0.15);
  border: 2px solid rgba(204,255,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #CCFF00;
  font-weight: 300;
  transition: all 0.3s ease;
}

.template-select-card:hover .template-select-icon {
  background: rgba(204,255,0,0.25);
  border-color: rgba(204,255,0,0.6);
  transform: scale(1.1);
}

.template-select-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.template-select-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.template-change-badge:hover {
  background: rgba(255,255,255,0.3);
}


/* 2. SEGMENTED CONTROLS (Stylish Buttons for Settings) */
.segmented-control {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.segmented-btn {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.segmented-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.segmented-btn.active {
  background: #4CAF50; /* Active Green */
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}


/* 3. CUSTOM CHECKBOX */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
}

.checkbox-wrapper input {
  display: none; /* Hide default checkbox */
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  margin-right: 10px;
  position: relative;
  transition: all 0.2s;
}

.checkbox-wrapper input:checked + .custom-checkbox {
  background: #4CAF50;
  border-color: #4CAF50;
}

.checkbox-wrapper input:checked + .custom-checkbox::after {
  content: '✔';
  position: absolute;
  color: white;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-text {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}


/* ============================================
   REFACTORED SETTINGS CONTROLS (Like Screenshot)
   ============================================ */

/* Контейнер для сетки настроек (Duration, Resolution в ряд) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* Стиль кнопки-селектора (как на скриншоте) */
.setting-selector-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.setting-selector-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.setting-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.setting-value {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

.setting-arrow {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* Выпадающее меню для настроек */
.setting-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  display: none;
}

.setting-dropdown-menu.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

.setting-option {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.setting-option.selected {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.setting-option.selected::after {
  content: '✓';
  color: #4CAF50;
  font-size: 12px;
}

/* Стилизация выбора модели (как на скриншоте) */
.model-selector-modern {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.model-selector-modern:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.model-selector-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-selector-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.model-selector-value {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-selector-arrow {
  color: rgba(255, 255, 255, 0.4);
}

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

/* ============================================
   MOBILE ADAPTATIONS FIX (2025-11-21)
   ============================================ */

@media (max-width: 900px) {
  /* 1. FIX ORDER: Form Top, Preview Bottom */
  .generation-form-content {
    flex-direction: column;
  }
  
  .generation-form-right {
    order: 2 !important; /* Preview goes to bottom */
    min-height: 300px;
    margin-top: 24px;
  }
  
  .generation-form-left {
    order: 1 !important; /* Settings stay on top */
  }

  /* 2. COMPACT SETTINGS BUTTONS */
  .settings-grid {
    /* На узких экранах - одна колонка для лучшей читаемости */
    grid-template-columns: 1fr; 
    gap: 8px;
  }

  .setting-selector-btn {
    padding: 10px 12px; /* Немного меньше отступы */
  }

  .setting-value {
    font-size: 14px; /* Чуть меньше шрифт */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Чтобы длинный текст не ломал кнопку */
  }
  
  .setting-label {
    font-size: 11px;
  }

  /* Компактная карточка превью шаблона */
  .template-mini-card {
    height: 140px; /* Меньше высота на мобильном */
  }

  /* Уменьшаем размер кнопок-сегментов */
  .segmented-btn {
    padding: 8px 4px;
    font-size: 12px;
  }
  
  /* Модель селектор компактнее */
  .model-selector-modern {
    padding: 12px;
  }
  
  .model-selector-value {
    font-size: 14px;
  }
}

/* ============================================
   CRITICAL MOBILE ORDER FIX (2025-11-21)
   ============================================ */

@media (max-width: 900px) {
  /* Жестко задаем колонку */
  .generation-form-content {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Сбрасываем любые order, чтобы элементы шли как в DOM */
  /* DOM: Left (Settings) -> Right (Preview) */
  .generation-form-left {
    order: 0 !important; 
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .generation-form-right {
    order: 1 !important; /* Строго после настроек */
    width: 100% !important;
    margin-top: 32px !important;
    min-height: 300px !important;
  }
}

/* ============================================
   DESKTOP COMPACT FIX (2025-11-21)
   Making buttons neater on desktop
   ============================================ */

/* Делаем кнопку выбора модели компактнее */
.model-selector-modern {
  padding: 10px 14px !important; /* Было 16px */
  min-height: 50px;
}

.model-selector-value {
  font-size: 15px !important; /* Было 16px */
}

.model-selector-label {
  font-size: 11px !important; /* Было 12px */
  margin-bottom: 2px;
}

/* Делаем кнопки настроек (Quality, Duration) компактнее */
.setting-selector-btn {
  padding: 8px 12px !important; /* Было 12px 16px */
  min-height: 46px;
}

.setting-content {
  gap: 2px !important; /* Было 4px */
}

.setting-label {
  font-size: 11px !important; /* Было 12px */
}

.setting-value {
  font-size: 13px !important; /* Было 15px */
  line-height: 1.3;
}

/* Стрелочки тоже чуть меньше */
.setting-arrow, 
.model-selector-arrow {
  font-size: 12px !important;
  opacity: 0.5;
}

/* Корректировка сетки, чтобы кнопки не были слишком широкими если их мало */
.settings-grid {
  gap: 10px !important;
}

/* ============================================
   DESKTOP ULTRA-COMPACT FIX (2025-11-21)
   Strict single-line layout for neat buttons
   ============================================ */

/* 1. Кнопки настроек (Settings) */
.setting-selector-btn {
  padding: 6px 10px !important;
  min-height: 42px !important;
  max-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.setting-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 0px !important;
  overflow: hidden; /* Важно для обрезки текста */
  flex: 1;
  margin-right: 8px;
}

.setting-label {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px !important;
  white-space: nowrap;
}

.setting-value {
  font-size: 13px !important;
  line-height: 16px !important;
  white-space: nowrap !important; /* Запрещаем перенос */
  overflow: hidden !important;
  text-overflow: ellipsis !important; /* Троеточие для длинного текста */
  font-weight: 600 !important;
}

/* 2. Кнопка выбора модели */
.model-selector-modern {
  padding: 8px 12px !important;
  min-height: 48px !important;
  max-height: 56px !important;
  margin-bottom: 12px !important;
}

.model-selector-info {
  overflow: hidden;
  flex: 1;
  margin-right: 10px;
}

.model-selector-value {
  font-size: 14px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 3. Грид настроек - делаем более плотным */
.settings-grid {
  gap: 8px !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; /* Адаптивные колонки */
}

/* Опции в выпадающем списке тоже компактнее */
.setting-option {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* ============================================
   V2 COMPACT MODE (Guaranteed Apply)
   ============================================ */

/* Кнопки настроек в компактном режиме */
.compact-mode .setting-selector-btn {
  padding: 0 12px !important; /* Убираем вертикальный паддинг, центруем флексом */
  height: 48px !important;      /* Фиксированная высота */
  min-height: 48px !important;
  max-height: 48px !important;
  background: #1a1a1a !important; /* Более темный фон */
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.compact-mode .setting-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  width: 100%;
  overflow: hidden;
}

.compact-mode .setting-label {
  font-size: 10px !important;
  text-transform: uppercase;
  color: #666 !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.compact-mode .setting-value {
  font-size: 13px !important;
  color: #fff !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
  padding-right: 8px;
}

.compact-mode .setting-arrow {
  font-size: 10px !important;
  color: #444 !important;
  flex-shrink: 0;
}

/* Выбор модели в компактном режиме */
.compact-mode .model-selector-modern {
  padding: 0 14px !important;
  height: 54px !important;
  min-height: 54px !important;
  background: #1a1a1a !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
}

.compact-mode .model-selector-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
}

.compact-mode .model-selector-label {
  font-size: 11px !important;
  color: #666 !important;
  text-transform: uppercase;
  font-weight: 700 !important;
}

.compact-mode .model-selector-value {
  font-size: 15px !important;
}

/* Грид настроек */
.compact-mode .settings-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important; /* Строго две колонки на десктопе */
  gap: 10px !important;
}

/* Мобильная адаптация для компактного режима */
@media (max-width: 600px) {
  .compact-mode .settings-grid {
    grid-template-columns: 1fr !important; /* Одна колонка на телефоне */
  }
}

/* ============================================
   V3 ULTRA-COMPACT LAYOUT (Less spacing)
   ============================================ */

/* Уменьшаем отступы между основными блоками */
.compact-mode .generation-form-content {
  gap: 20px !important; /* Было 32px */
  margin-top: 16px !important;
}

/* Убираем лишние отступы внутри секций */
.compact-mode .form-section {
  margin-bottom: 16px !important; /* Было 24px */
  padding-bottom: 0 !important;
  border-bottom: none !important; /* Убираем линии для плотности */
}

/* Заголовки секций */
.compact-mode .section-title {
  font-size: 12px !important;
  text-transform: uppercase;
  color: #888 !important;
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  font-weight: 700;
}

/* Уменьшаем отступы внутри промпта */
.compact-mode .section-prompt {
  margin-top: -8px !important; /* Подтягиваем промпт выше */
}

/* Сжимаем блок модели */
.compact-mode .model-selector-modern {
  margin-bottom: 8px !important;
}

/* Подтягиваем настройки */
.compact-mode .settings-grid {
  margin-top: 8px !important;
}

/* Уменьшаем высоту поля промпта */
.compact-mode .form-textarea {
  padding: 10px !important;
  min-height: 80px !important; /* Чуть меньше высота */
}

/* Подтягиваем слоты загрузки */
.compact-mode .slotted-upload-wrapper {
  margin-bottom: 12px !important;
}

/* ============================================
   MODEL SELECTOR DROPDOWN FIX (2025-11-21)
   Unified style with settings dropdown
   ============================================ */

/* Контейнер кнопки выбора модели должен быть relative для позиционирования меню */
.compact-mode .model-selector-modern {
  position: relative !important;
  z-index: 50 !important; /* Чтобы меню было поверх других элементов */
}

/* Само выпадающее меню модели */
.model-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background: #1e1e1e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 4px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
  z-index: 100 !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  margin-top: 0 !important; /* Сбрасываем старые отступы */
}

/* Скрытое состояние */
.model-dropdown.hidden {
  display: none !important;
}

/* Пункты меню модели */
.model-dropdown-item {
  padding: 10px 12px !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: none !important; /* Убираем линии */
  background: transparent !important;
}

.model-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

.model-dropdown-item.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* Бейдж стоимости в меню */
.model-cost-badge {
  font-size: 12px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  color: #FFD700 !important;
}

/* ============================================
   UNIFIED MODEL SELECTOR (IDENTICAL TO SETTINGS)
   ============================================ */

.compact-mode .model-selector-modern {
  height: 48px !important;       /* Как у кнопок настроек */
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 0 12px !important;    /* Идентичные отступы */
  border-radius: 10px !important;
  margin-bottom: 0 !important;   /* Убираем лишний отступ */
}

.compact-mode .model-selector-label {
  font-size: 10px !important;    /* Как у setting-label */
  color: #666 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.compact-mode .model-selector-value {
  font-size: 13px !important;    /* Как у setting-value */
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

/* Выравниваем стрелочку */
.compact-mode .model-selector-arrow {
  font-size: 10px !important;
  color: #444 !important;
}

/* Меню выбора модели - точно как у настроек */
.model-dropdown {
  top: calc(100% + 4px) !important; /* Чуть ближе, как у настроек */
  border-radius: 12px !important;
  padding: 4px !important;
}

.model-dropdown-item {
  padding: 10px 12px !important;
  font-size: 13px !important;
  min-height: 40px !important; /* Чтобы пальцем попадать удобно */
}

/* ============================================
   PREMIUM LOADING & VIDEO PLAYER (2025-11-24)
   ============================================ */

/* 1. Premium Loading State (Cinema Card) */
.generation-progress-container {
  background: rgba(20, 20, 20, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Shimmer Effect Background */
.generation-progress-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 3s infinite linear;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -150%; }
  100% { left: 150%; }
}

/* Pulsating Center Icon */
.progress-loader-icon {
  font-size: 64px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(204, 255, 0, 0.4));
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Modern Progress Bar */
.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 100px !important;
  height: 6px !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3) !important;
}

.progress-bar {
  background: linear-gradient(90deg, #CCFF00, #00FF88) !important;
  box-shadow: 0 0 15px rgba(204, 255, 0, 0.5) !important;
}

/* Status Text */
.progress-status {
  color: #CCFF00 !important; /* Neon Green */
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  font-size: 14px !important;
  margin-bottom: 16px !important;
}

.progress-tips {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 24px;
  max-width: 80%;
  line-height: 1.5;
}

/* 2. Premium Video Player Container */
.generation-result-video-wrapper {
  background: #000 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  position: relative !important;
  transition: transform 0.3s ease !important;
}

/* Video Player Controls Customization (Webkit) */
.generation-result-video::-webkit-media-controls-panel {
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
}

/* Download Button in Player Context */
.video-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

.btn-action-modern {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-action-modern:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-action-modern.primary {
  background: #CCFF00;
  color: #000;
  border: none;
  font-weight: 700;
}

.btn-action-modern.primary:hover {
  background: #b3e600;
  box-shadow: 0 5px 20px rgba(204, 255, 0, 0.3);
}


/* ============================================
   VIDEO PLAYER FIX (2025-11-24)
   ============================================ */

/* Ensure video wrapper doesn't stretch */
.generation-result-video-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Video should maintain aspect ratio */
.generation-result-video {
  width: 100% !important;
  height: auto !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}

/* Actions bar should be centered below video */
.video-actions-bar {
  display: flex !important;
  gap: 12px !important;
  margin-top: 0 !important;
  width: auto !important;
  justify-content: center !important;
}


/* ============================================
   HISTORY GALLERY (2025-11-24) - Compact Icons
   ============================================ */

.history-gallery-section {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.history-gallery-title {
  display: none; /* Скрываем заголовок для компактности */
}

.history-gallery-grid {
  display: flex;
  gap: 8px;
}

.history-gallery-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.history-gallery-item:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.history-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 8px;
  text-align: center;
}

.history-gallery-item:hover .history-overlay {
  opacity: 1;
}

.history-date {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Mobile: показываем 2 миниатюры */
@media (max-width: 900px) {
  .history-gallery-section {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  
  .history-gallery-grid {
    gap: 6px;
  }
  
  .history-gallery-item {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   FAB MENU - Bottom Sheet Style
   ============================================ */

.fab-menu-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end; /* Прижимаем к низу */
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fab-menu-container.active {
  opacity: 1;
  pointer-events: auto;
}

.fab-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  transition: background 0.3s ease;
}

.fab-menu {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px; /* Ограничение ширины на десктопе */
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px 40px 16px; /* Большой паддинг снизу */
  background: rgba(20, 20, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: none; /* Важно для обработки свайпов в JS */
}

.fab-menu-container.active .fab-menu {
  transform: translateY(0);
}

/* Ручка для перетаскивания */
.fab-menu-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 8px auto;
}

.fab-menu-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.fab-menu-option:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}

/* Стили для Видео */
.fab-menu-option.option-video .fab-menu-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Стили для Фото */
.fab-menu-option.option-photo .fab-menu-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.fab-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
}

.fab-menu-icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 2;
}

.fab-menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fab-menu-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.fab-menu-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* ============================================
   SITE FOOTER - Статичный подвал сайта
   ============================================ */

.site-footer {
  background: linear-gradient(180deg, var(--bg) 0%, #0a0a0d 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 60px;
  padding-bottom: 100px; /* Отступ для мобильной навигации */
}

.footer-container {
  max-width: var(--xl);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.footer-nav {
  min-width: 160px;
}

.footer-nav-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px 0;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.footer-bottom .footer-container {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-copyright {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  text-align: center;
}

/* Footer адаптивность */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 16px;
    text-align: center;
  }
  
  .footer-brand {
    max-width: 100%;
  }
  
  .footer-nav {
    min-width: auto;
  }
  
  .footer-nav-list {
    gap: 12px;
  }
  
  .footer-link {
    font-size: 15px;
    padding: 4px 0;
  }
}

/* ============================================
   LEGAL PAGES - Юридические страницы
   ============================================ */

.legal-page {
  min-height: 100vh;
  padding: 20px 0 60px;
}

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

.legal-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.legal-updated {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 32px 0;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

.legal-section p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px 0;
}

.legal-section ul,
.legal-section ol {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-important {
  background: rgba(255, 92, 122, 0.1);
  border-left: 3px solid var(--danger);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

.legal-note {
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
}

.legal-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.legal-back {
  margin-top: 40px;
  text-align: center;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* ============================================
   CONTACTS PAGE - Страница контактов
   ============================================ */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.contact-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.contact-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.contact-icon.telegram {
  background: linear-gradient(135deg, #229ED9, #1DA1F2);
}

.contact-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.contact-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.contact-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 8px 0;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--accent);
}

.contact-description {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* FAQ секция */
.faq-item {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.faq-item p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.6;
}

/* Contacts адаптивность */
@media (max-width: 768px) {
  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .legal-title {
    font-size: 24px;
  }
}

/* ============================================
   REQUISITES PAGE - Страница реквизитов
   ============================================ */

.requisites-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.requisites-table {
  width: 100%;
  border-collapse: collapse;
}

.requisites-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.requisites-table tr:last-child {
  border-bottom: none;
}

.requisites-table td {
  padding: 14px 0;
  vertical-align: top;
}

.requisites-label {
  color: var(--muted);
  font-size: 14px;
  width: 40%;
  padding-right: 20px;
}

.requisites-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

/* ============================================
   COOKIE BANNER - Баннер согласия на cookies
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(20, 20, 28, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-banner-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-hiding {
  transform: translateY(100%);
  opacity: 0;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.cookie-banner-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cookie-banner-link:hover {
  color: #8b8dff;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #b4ff39;
  color: #000;
  box-shadow: 0 4px 16px rgba(180, 255, 57, 0.3);
}

.cookie-btn-accept:hover {
  background: #c4ff5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180, 255, 57, 0.4);
}

.cookie-btn-accept:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(180, 255, 57, 0.3);
}

/* Мобильная версия cookie banner */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 12px 16px;
    /* Учитываем мобильную навигацию */
    bottom: 70px;
  }

  .cookie-banner-content {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .cookie-banner-text p {
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
  }

  .cookie-banner-actions {
    justify-content: center;
  }

  .cookie-btn {
    padding: 10px 24px;
    font-size: 13px;
    border-radius: 10px;
  }
}


/* ===========================================
   ПОДПИСКИ - SUBSCRIPTION PAGE
   =========================================== */

.subscription-page {
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, #0a0a0f 0%, #121218 100%);
}

.subscription-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Auth required */
.subscription-auth-required {
  text-align: center;
  padding: 80px 20px;
}

.subscription-auth-required h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 16px;
}

.subscription-auth-required p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

.auth-link {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Payment messages */
.payment-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
}

.payment-message.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.payment-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.payment-message .message-icon {
  font-size: 20px;
}

/* Header section */
.subscription-header-section {
  text-align: center;
  margin-bottom: 40px;
}

.subscription-header-section h1 {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subscription-header-section p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

/* Loading */
.subscription-loading {
  text-align: center;
  padding: 60px 20px;
}

.subscription-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.subscription-error {
  text-align: center;
  padding: 40px 20px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.subscription-error p {
  color: #ef4444;
  margin-bottom: 16px;
}

.subscription-error button {
  padding: 10px 24px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

/* Notification */
.subscription-notification {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.subscription-notification.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.subscription-notification.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.subscription-notification.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.subscription-notification.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.subscription-notification.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

/* Max plan message */
.max-plan-message {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.max-plan-message h2 {
  color: #a855f7;
  margin-bottom: 12px;
}

.max-plan-message p {
  color: rgba(255, 255, 255, 0.7);
}

/* Upgrade hint */
.upgrade-hint {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* Current subscription block */
.current-subscription-block {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.no-subscription {
  text-align: center;
  padding: 20px;
}

.no-subscription h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}

.no-subscription p {
  color: rgba(255, 255, 255, 0.5);
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.subscription-header h3 {
  font-size: 20px;
  color: #fff;
}

.subscription-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.subscription-status.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.subscription-status.status-pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.subscription-status.status-expired,
.subscription-status.status-cancelled {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.subscription-status.status-suspended,
.subscription-status.status-failed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.subscription-info {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  gap: 12px;
}

.info-label {
  color: rgba(255, 255, 255, 0.5);
  min-width: 150px;
}

.info-value {
  color: #fff;
  font-weight: 500;
}

.info-value.auto-renew-on {
  color: #10b981;
}

.info-value.auto-renew-off {
  color: #9ca3af;
}

.subscription-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.action-btn.toggle-autorenew.on {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.action-btn.toggle-autorenew.off {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.action-btn.cancel-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn:hover {
  transform: translateY(-1px);
}

/* Plans section */
.subscription-plans-section {
  margin-top: 40px;
}

.subscription-plans-section h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 24px;
  text-align: center;
}

.subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Plan card */
.subscription-plan-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.3s;
}

.subscription-plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.subscription-plan-card.recommended {
  border-color: rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.subscription-plan-card.current {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
}

.plan-badge.current-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.subscription-plan-card .plan-name {
  font-size: 20px;
  color: #fff;
  margin-bottom: 16px;
  margin-top: 8px;
}

.subscription-plan-card .plan-price {
  margin-bottom: 12px;
}

.subscription-plan-card .price-amount {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
}

.subscription-plan-card .price-currency {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
}

.subscription-plan-card .price-period {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.subscription-plan-card .plan-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.subscription-plan-card .plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.subscription-plan-card .feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.subscription-plan-card .feature-check {
  color: #10b981;
  font-weight: bold;
}

.subscription-plan-card .feature-star {
  color: #fbbf24;
}

.subscription-plan-card .feature-item.bonus {
  color: #fbbf24;
  font-weight: 500;
}

.plan-select-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-select-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.plan-select-btn:disabled,
.plan-select-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .subscription-page {
    padding: 16px;
    padding-bottom: 100px;
  }

  .subscription-header-section h1 {
    font-size: 24px;
  }

  .subscription-plans-grid {
    grid-template-columns: 1fr;
  }

  .subscription-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-row {
    flex-direction: column;
    gap: 4px;
  }

  .info-label {
    min-width: auto;
    font-size: 13px;
  }

  .subscription-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    text-align: center;
  }
}
