/* ============================================================
   Gemini Omni Video — редизайн в общем стиле генераторов
   (скелет как у Fish TTS: hero → форма слева / заказы справа),
   адаптирован под видео: превью-плееры, постеры, aspect-бейджи.
   Загружается только на gemini-omni-video.php. Всё scoped .ov-*,
   функциональные JS-хуки (go-dur-card, go-thumb…) сохранены.
   ============================================================ */

:root {
    --ov-grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --ov-grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(217, 70, 239, 0.18));
    --ov-card-bg: linear-gradient(180deg, rgba(28, 19, 52, 0.72), rgba(17, 11, 34, 0.72));
    --ov-card-border: rgba(178, 142, 255, 0.16);
    --ov-input-bg: rgba(13, 8, 28, 0.62);
    --ov-text: #f5f1ff;
    --ov-muted: rgba(245, 241, 255, 0.55);
    --ov-faint: rgba(245, 241, 255, 0.38);
}

.ov-shell { max-width: 1440px; }

/* ================= Hero ================= */
.ov-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 26px 28px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at 88% 15%, rgba(217, 70, 239, 0.42), transparent 42%),
        radial-gradient(circle at 65% 90%, rgba(139, 92, 246, 0.30), transparent 45%),
        linear-gradient(120deg, #4c1d95 0%, #6d28d9 45%, #86198f 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 60px rgba(109, 40, 217, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.ov-hero h1 { margin: 0 0 8px; font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.15; }
.ov-hero-sub { margin: 0 0 14px; color: rgba(250, 245, 255, 0.85); font-size: 0.92rem; max-width: 560px; }
.ov-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(20, 8, 40, 0.30);
    color: rgba(250, 245, 255, 0.88);
    font-size: 0.78rem; font-weight: 500;
}
.ov-pill .icon-svg { width: 13px; height: 13px; }
.ov-hero-deco {
    position: absolute; right: 26px; top: 50%;
    transform: translateY(-50%);
    width: 108px; height: 108px;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    filter: drop-shadow(0 10px 26px rgba(217, 70, 239, 0.55));
}
.ov-hero-deco .icon-svg { width: 100%; height: 100%; stroke-width: 1.6; }
@media (max-width: 640px) { .ov-hero-deco { display: none; } }

/* ================= Layout: форма + панель заказов ================= */
.ov-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 348px;
    gap: 18px;
    align-items: start;
}
.ov-main { min-width: 0; }

.ov-card {
    background: var(--ov-card-bg);
    border: 1px solid var(--ov-card-border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ov-card:last-child { margin-bottom: 0; }

.ov-label {
    display: flex; align-items: center; gap: 8px;
    color: var(--ov-text);
    font-weight: 700;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
}
.ov-label .icon-svg { width: 16px; height: 16px; color: #d8b4fe; }
.ov-label .ov-req { color: #f0abfc; }
.ov-label .ov-step {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 7px;
    background: var(--ov-grad); color: #fff;
    font-size: 0.72rem; font-weight: 800;
}

/* ================= Промт ================= */
.ov-prompt {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--ov-card-border);
    background: var(--ov-input-bg);
    color: var(--ov-text);
    font-size: 0.92rem;
    line-height: 1.5;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ov-prompt::placeholder { color: var(--ov-faint); }
.ov-prompt:focus {
    outline: none;
    border-color: rgba(217, 70, 239, 0.6);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.14);
}
.ov-prompt-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; font-size: 0.78rem; color: var(--ov-muted);
}
.ov-counter { font-variant-numeric: tabular-nums; }

/* ================= Карточки опций ================= */
.ov-grid { display: grid; gap: 12px; }
.ov-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ov-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.go-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    min-height: 104px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--ov-card-border);
    background: var(--ov-input-bg);
    color: var(--ov-text);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.go-card:hover { border-color: rgba(217, 70, 239, 0.42); transform: translateY(-1px); }
.go-card.is-active {
    border-color: rgba(217, 70, 239, 0.86);
    background: var(--ov-grad-soft);
    box-shadow: 0 0 0 1px rgba(217, 70, 239, 0.18), 0 14px 38px rgba(139, 92, 246, 0.18);
}
.go-card-icon { color: var(--ov-muted); transition: filter 0.18s ease, color 0.18s ease; }
.go-card.is-active .go-card-icon { color: #fff; filter: drop-shadow(0 0 12px rgba(217, 70, 239, 0.40)); }
.go-card-title { font-weight: 800; font-size: 1rem; }
.go-card-sub { font-size: 0.74rem; color: var(--ov-muted); }
.go-card.is-active .go-card-sub { color: rgba(245, 241, 255, 0.78); }

.go-dur-card { min-height: 96px; gap: 6px; padding: 12px 12px 11px; }
.go-dur-card .go-card-title { font-size: 1.08rem; }
.go-dur-track { position: relative; width: 78%; height: 12px; margin-top: 4px; }
.go-dur-track::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 3px; transform: translateY(-50%); border-radius: 3px;
    background: var(--ov-card-border);
}
.go-dur-fill {
    position: absolute; top: 50%; left: 0; height: 3px;
    transform: translateY(-50%); border-radius: 3px;
    background: var(--ov-grad);
    opacity: 0.55; transition: opacity 0.18s ease;
}
.go-dur-knob {
    position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
    transform: translate(-50%, -50%);
    background: #fff; box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.28), 0 2px 6px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.18s ease;
}
.go-dur-card.is-active .go-dur-fill { opacity: 1; }
.go-dur-card.is-active .go-dur-knob { box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.5), 0 0 12px rgba(217, 70, 239, 0.6); }

.go-ratio-card { min-height: 124px; gap: 10px; }
.go-ratio-card .go-card-title { font-size: 1.2rem; }
.go-ratio-icon { width: 58px; height: 44px; color: var(--ov-muted); }
.go-ratio-icon rect { stroke: currentColor; }
.go-ratio-card.is-active .go-ratio-icon { color: #fff; filter: drop-shadow(0 0 12px rgba(217, 70, 239, 0.45)); }

/* ================= Разрешение: segmented ================= */
.go-segment {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--ov-card-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--ov-input-bg);
}
.go-seg-item {
    min-height: 52px;
    border: 0; background: transparent;
    color: var(--ov-muted);
    cursor: pointer; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.go-seg-item + .go-seg-item { border-left: 1px solid rgba(178, 142, 255, 0.12); }
.go-seg-item small { font-size: 0.68rem; color: var(--ov-faint); font-weight: 500; }
.go-seg-item:hover { color: #fff; }
.go-seg-item.is-active {
    color: #fff;
    background: var(--ov-grad-soft);
    box-shadow: inset 0 0 0 1px rgba(217, 70, 239, 0.5);
}
.go-seg-item.is-active small { color: rgba(245, 241, 255, 0.82); }
.go-seg-star { width: 11px; height: 11px; margin-left: 3px; color: #ffce6b; vertical-align: -1px; }

/* ================= Загрузка референсов ================= */
/* upload-zone — page-local класс генераторов (глобальных стилей нет, копируем) */
.upload-zone {
    border: 1.5px dashed rgba(167, 139, 250, 0.42);
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.12), transparent 55%),
        rgba(13, 8, 28, 0.55);
    transition: all 0.22s ease;
    cursor: pointer;
    min-height: 124px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: rgba(217, 70, 239, 0.6);
    background: rgba(139, 92, 246, 0.10);
}
.upload-icon { width: 34px; height: 34px; margin-bottom: 0.5rem; color: rgba(216, 180, 254, 0.8); }
.upload-text { color: rgba(245, 241, 255, 0.85); font-size: 0.9rem; margin-bottom: 0.15rem; font-weight: 600; }
.upload-hint { color: var(--ov-faint); font-size: 0.76rem; }
.ov-ref-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
.ov-ref-grid.has-thumbs { grid-template-columns: 1fr; }
.ov-ref-grid.has-thumbs .upload-zone { display: none; }
.ov-ref-preview {
    border: 1px solid rgba(178, 142, 255, 0.12); border-radius: 14px;
    background: rgba(13, 8, 28, 0.42); padding: 12px;
    display: flex; flex-wrap: wrap; gap: 0.6rem; align-content: flex-start;
    min-height: 118px;
}
.go-thumb { position: relative; width: 84px; height: 84px; }
.go-thumb img { width: 84px; height: 84px; object-fit: contain; background: rgba(7, 4, 16, 0.7); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); display: block; }
.go-thumb-x {
    position: absolute; top: -7px; right: -7px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(10, 5, 20, 0.92); color: #fff;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: grid; place-items: center; padding: 0;
}
.go-thumb-x:hover { background: #d946ef; }
.go-add-tile {
    width: 84px; height: 84px; border-radius: 12px;
    border: 1.5px dashed rgba(178, 142, 255, 0.3); background: rgba(139, 92, 246, 0.06);
    color: #d8b4fe; display: grid; place-items: center; cursor: pointer; padding: 0;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.go-add-tile:hover { border-color: rgba(217, 70, 239, 0.6); color: #fff; background: rgba(139, 92, 246, 0.12); }
.go-add-tile svg { width: 22px; height: 22px; }
.ov-quota-note { font-size: 0.78rem; color: var(--ov-faint); margin-top: 0.55rem; }
@media (max-width: 720px) { .ov-ref-grid.has-thumbs { grid-template-columns: 1fr; } }

/* ================= Расширенные параметры ================= */
.ov-advanced {
    border: 1px solid var(--ov-card-border); border-radius: 14px;
    padding: 0 16px; background: var(--ov-input-bg);
}
.ov-advanced summary {
    cursor: pointer; font-weight: 700; padding: 0.9rem 0; user-select: none; list-style: none;
    color: var(--ov-text); display: flex; align-items: center; gap: 8px; font-size: 0.92rem;
}
.ov-advanced summary::-webkit-details-marker { display: none; }
.ov-advanced summary .icon-svg { width: 16px; height: 16px; flex-shrink: 0; color: #d8b4fe; }
.ov-advanced summary .ov-chev { margin-left: auto; transition: transform 0.2s ease; color: #d8b4fe; width: 16px; height: 16px; }
.ov-advanced[open] summary .ov-chev { transform: rotate(180deg); }
.ov-advanced > div { padding-bottom: 1rem; }
.ov-field-label { font-weight: 600; display: block; margin-bottom: 0.35rem; font-size: 0.84rem; color: rgba(245, 241, 255, 0.82); }
.ov-input {
    width: 100%; padding: 10px 13px; border-radius: 11px;
    border: 1px solid var(--ov-card-border); background: rgba(10, 6, 22, 0.6);
    color: var(--ov-text); font-size: 0.88rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ov-input::placeholder { color: var(--ov-faint); }
.ov-input:focus { outline: none; border-color: rgba(217, 70, 239, 0.6); box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.12); }
.ov-field-hint { margin-top: 0.4rem; font-size: 0.76rem; line-height: 1.4; color: var(--ov-faint); }
.ov-adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ================= CTA ================= */
.ov-cta {
    width: 100%; min-height: 56px;
    border: 0; border-radius: 14px;
    background: var(--ov-grad);
    color: #fff !important; -webkit-text-fill-color: #fff !important;
    font-size: 1.02rem; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 14px 36px rgba(217, 70, 239, 0.24);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.ov-cta:hover { transform: translateY(-1px); box-shadow: 0 18px 44px rgba(217, 70, 239, 0.32); }
.ov-cta:disabled { opacity: 0.65; cursor: default; transform: none; }
.ov-cta .coin-icon { width: 18px; height: 18px; }

/* ================= Правая панель «Мои заказы» ================= */
.ov-panel {
    background: var(--ov-card-bg);
    border: 1px solid var(--ov-card-border);
    border-radius: 18px;
    padding: 16px;
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ov-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ov-panel-title {
    display: inline-flex; align-items: center; gap: 8px; margin: 0;
    color: #fff; font-weight: 700; font-size: 0.98rem;
}
.ov-panel-title .icon-svg { width: 17px; height: 17px; color: #d8b4fe; }
.ov-panel-count {
    min-width: 24px; height: 24px; padding: 0 8px;
    border-radius: 999px; background: var(--ov-grad); color: #fff;
    font-size: 0.72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.ov-refresh {
    width: 30px; height: 30px; border-radius: 9px; margin-left: auto;
    border: 1px solid var(--ov-card-border); background: var(--ov-input-bg);
    color: var(--ov-muted); cursor: pointer; display: grid; place-items: center;
    transition: color 0.18s, border-color 0.18s;
}
.ov-refresh:hover { color: #fff; border-color: rgba(217, 70, 239, 0.5); }
.ov-refresh svg { width: 15px; height: 15px; }

/* Последний готовый ролик — крупный плеер */
.ov-latest {
    background: var(--ov-grad-soft);
    border: 1px solid rgba(217, 70, 239, 0.4);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px;
}
.ov-latest-title { color: #fff; font-weight: 600; font-size: 0.85rem; line-height: 1.3; margin-bottom: 8px; }
.ov-video {
    width: 100%; aspect-ratio: 16 / 9;
    border-radius: 11px; background: #0a0616;
    display: block;
}
.ov-latest-sub { color: var(--ov-muted); font-size: 0.72rem; margin: 8px 0 10px; }
.ov-open-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #e9d5ff; font-size: 0.8rem; font-weight: 600; text-decoration: none;
}
.ov-open-link:hover { color: #fff; }
.ov-open-link .icon-svg { width: 13px; height: 13px; }

.ov-orders-head { color: var(--ov-muted); font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; }
.ov-orders { display: flex; flex-direction: column; gap: 8px; }

.ov-order {
    display: block; text-decoration: none;
    background: rgba(24, 15, 46, 0.5);
    border: 1px solid rgba(178, 142, 255, 0.13);
    border-radius: 13px;
    padding: 10px;
    transition: border-color 0.18s;
}
.ov-order:hover { border-color: rgba(217, 70, 239, 0.4); }
.ov-order-main { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.ov-order-prev {
    width: 96px; height: 62px; border-radius: 10px;
    object-fit: cover; background: #0a0616; display: block;
}
.ov-order-prev-ph {
    width: 96px; height: 62px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--ov-grad-soft);
    color: rgba(255, 255, 255, 0.7);
}
.ov-order-prev-ph svg { width: 20px; height: 20px; }
.ov-order-info { min-width: 0; }
.ov-order-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ov-order-sub { color: var(--ov-faint); font-size: 0.68rem; margin-top: 3px; }
.ov-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }

.ov-badge {
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.68rem; font-weight: 600;
}
.ov-badge.ready { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.ov-badge.error { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.ov-badge.processing { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.ov-badge.render { background: rgba(139, 92, 246, 0.24); color: #d8b4fe; }
.ov-badge.muted { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.ov-orders-empty {
    text-align: center;
    padding: 1.4rem 0.8rem;
    color: var(--ov-faint);
    font-size: 0.82rem;
    border: 1px dashed rgba(178, 142, 255, 0.2);
    border-radius: 12px;
}
.ov-orders-empty .icon-svg { width: 28px; height: 28px; margin-bottom: 8px; color: rgba(216, 180, 254, 0.55); }
.ov-all-link {
    display: block;
    margin-top: 12px;
    padding: 10px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid rgba(178, 142, 255, 0.22);
    background: rgba(139, 92, 246, 0.08);
    color: #d8b4fe;
    font-size: 0.85rem; font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}
.ov-all-link:hover { background: rgba(139, 92, 246, 0.2); color: #fff; }

/* ================= Адаптив ================= */
@media (max-width: 1279.98px) {
    .ov-layout { grid-template-columns: 1fr; }
    .ov-panel { position: static; max-height: none; }
    .ov-orders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .ov-orders-empty { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .ov-two-col { grid-template-columns: 1fr; }
    .ov-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .ov-adv-grid { grid-template-columns: 1fr; }
    .ov-cta-wrap { position: sticky; bottom: 12px; z-index: 20; }
}
@media (max-width: 720px) {
    .ov-orders { grid-template-columns: 1fr; }
    .ov-hero { padding: 20px; }
    .ov-hero h1 { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
    .go-card, .ov-cta, .ov-order { transition: none; }
}


/* ==== Ползунок длительности (образец — seedance-video) ==== */
.duration-slider-wrap { display: flex; align-items: center; gap: 10px; }
.duration-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; background: rgba(139, 92, 246, 0.2); border-radius: 3px; outline: none; }
.duration-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: linear-gradient(135deg, #8b5cf6, #ec4899); border-radius: 50%; cursor: pointer; border: 2px solid rgba(255, 255, 255, 0.3); }
.duration-slider::-moz-range-thumb { width: 20px; height: 20px; background: linear-gradient(135deg, #8b5cf6, #ec4899); border-radius: 50%; cursor: pointer; border: 2px solid rgba(255, 255, 255, 0.3); }
.duration-value { min-width: 48px; padding: 6px 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; color: white; font-size: 0.9rem; text-align: center; font-weight: 500; }
.duration-compact { gap: 6px; }
.duration-compact .duration-slider { flex: 1; min-width: 80px; }
