/* HYPEPORT for Creators — фирменный стиль hypeport.cloud (общий с pay.hypeport.cloud) */

@font-face {
    font-family: 'VK Sans Display';
    src: url('/static/fonts/VKSansDisplay-Regular_1767995018489.ttf') format('truetype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'VK Sans Display';
    src: url('/static/fonts/VKSansDisplay-Medium_1767995018488.ttf') format('truetype');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'VK Sans Display';
    src: url('/static/fonts/VKSansDisplay-DemiBold_1767995018488.ttf') format('truetype');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'VK Sans Display';
    src: url('/static/fonts/VKSansDisplay-Bold_1767995018488.ttf') format('truetype');
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    --primary-red: #f32321;
    --primary-red-hover: #d91f1d;
    --gradient: #f32321;

    --bg-primary: #F3F4F6;
    --bg-secondary: #E5E7EB;
    --bg-surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --border-color: #D1D5DB;

    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --info: #2563EB;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-surface: #181818;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #2c2c2c;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'VK Sans Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Логотип (чёрный/белый по теме) ---------- */
.logo-img { height: 44px; display: block; }
.logo-img.logo-dark { display: none; }
[data-theme="dark"] .logo-img.logo-light { display: none; }
[data-theme="dark"] .logo-img.logo-dark { display: block; }

/* ---------- Topbar ---------- */
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}
[data-theme="dark"] .topbar {
    background: rgba(24, 24, 24, 0.8);
    backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #fff;
    background: var(--gradient);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}
.topnav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.topnav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.topnav a:hover { color: var(--text-primary); background: var(--bg-secondary); text-decoration: none; }
.topnav a.active { color: #fff; background: var(--gradient); box-shadow: 0 2px 12px rgba(243, 35, 33, 0.3); }
.topuser { display: flex; align-items: center; gap: 12px; }

.nav-toggle { display: none; }

/* ---------- User dropdown ---------- */
.user-menu { position: relative; }
.user-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 10px 6px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer; font-family: inherit; color: var(--text-primary);
    transition: all .2s;
}
.user-btn:hover { border-color: var(--primary-red); }
.user-ava {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gradient); color: #fff; flex: none;
    font-size: 13px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { font-size: 11px; color: var(--text-muted); transition: transform .2s; }
.user-menu.open .user-caret { transform: rotate(180deg); }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
    z-index: 100;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border-color); margin-bottom: 6px; }
.user-dropdown-name { font-size: 14px; font-weight: 600; }
.user-dropdown-mail { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border: none; background: none;
    font-family: inherit; font-size: 14px; color: var(--text-primary);
    border-radius: var(--radius-md); cursor: pointer; text-align: left;
    text-decoration: none;
}
.menu-item:hover { background: var(--bg-secondary); text-decoration: none; }
.menu-item-danger { color: var(--error); }
.menu-ico { font-size: 16px; width: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Переключатель языка внутри меню пользователя */
.menu-lang {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 8px 12px;
}
.menu-lang-label { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.lang-switch { display: inline-flex; background: var(--bg-secondary); border-radius: 20px; padding: 2px; }
.lang-switch a {
    padding: 4px 12px; border-radius: 18px;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    transition: all .15s;
}
.lang-switch a:hover { color: var(--text-primary); text-decoration: none; }
.lang-switch a.on { background: var(--gradient); color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px 24px 48px; flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: 13px; margin-bottom: 14px;
}
.back-link:hover { color: var(--primary-red); text-decoration: none; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.card .card-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 18px;
}
.alert-error   { background: rgba(220, 38, 38, 0.12); color: var(--error); }
.alert-success { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.alert-info    { background: rgba(37, 99, 235, 0.12); color: var(--info); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gradient);
    color: #fff;
}
.btn:hover { transform: scale(1.02); box-shadow: var(--shadow-md); text-decoration: none; color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-md); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary-red); }
.form-textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; }
.form-hint { display: block; margin-top: 7px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

pre.raw {
    max-height: 340px; overflow: auto; padding: 14px;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
}

/* ---------- Каталог релизов ---------- */
.release-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.release {
    position: relative; display: block;
    aspect-ratio: 1; border-radius: var(--radius-xl); overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transition: transform .25s, box-shadow .25s;
}
.release:hover { transform: translateY(-6px); box-shadow: 0 14px 38px rgba(0,0,0,.35); text-decoration: none; }
.release img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.release-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.3) 55%, transparent 100%); }
.release-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; }
.release-title { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release-sub { margin-top: 3px; font-size: 12px; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release .badge { position: absolute; top: 12px; right: 12px; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; font-size: 12px; font-weight: 500;
    border-radius: 20px;
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(6px);
    color: #d1d5db;
}
.badge.ok { color: #4ade80; } .badge.warn { color: #fbbf24; } .badge.err { color: #f87171; }

/* ---------- Генератор ---------- */
.gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 940px) { .gen-grid { grid-template-columns: 1fr; } }

.formats { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.formats button {
    padding: 7px 16px; border-radius: 20px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.formats button:hover { color: var(--text-primary); }
.formats button.active { background: var(--gradient); border-color: var(--gradient); color: #fff; box-shadow: 0 2px 12px rgba(243,35,33,.3); }

.preview {
    display: flex; align-items: center; justify-content: center;
    min-height: 340px; padding: 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}
.preview img { max-width: 100%; max-height: 460px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }

.gen-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Пустое состояние ---------- */
.empty { text-align: center; padding: 72px 24px; }
.empty-icon {
    width: 64px; height: 64px; margin: 0 auto 18px;
    border-radius: 50%; background: var(--bg-secondary); color: var(--text-muted);
    font-size: 24px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.empty h2 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ---------- Вход ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(243, 35, 33, 0.14), transparent 35%),
        radial-gradient(circle at bottom right, rgba(243, 35, 33, 0.08), transparent 30%),
        var(--bg-secondary);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.auth-card .logo-img { height: 56px; margin: 0 auto 22px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.7; }

.hypeport-id-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 14px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(243, 35, 33, 0.3);
}
.hypeport-id-btn:hover { transform: scale(1.02); box-shadow: 0 4px 18px rgba(243, 35, 33, 0.4); text-decoration: none; color: #fff; }
.hypeport-id-mark {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 4px;
}
.auth-note { margin-top: 22px; color: var(--text-muted); font-size: 12px; line-height: 1.6; }

/* ---------- Мобильная навигация ---------- */
@media (max-width: 820px) {
    .topbar { gap: 12px; padding: 0 16px; }
    .logo-img { height: 34px; }
    .nav-toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 4px;
        width: 38px; height: 38px; margin-left: auto;
        background: var(--bg-secondary); border: 1px solid var(--border-color);
        border-radius: var(--radius-md); cursor: pointer;
        padding: 0 9px;
    }
    .nav-toggle span { display: block; height: 2px; background: var(--text-secondary); border-radius: 2px; }
    .topnav {
        position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; gap: 2px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 10px 16px 16px;
        display: none;
    }
    body.nav-open .topnav { display: flex; }
    .user-name { display: none; }
    .container { padding: 20px 16px; }
    .gen-grid { grid-template-columns: 1fr; }
}
