/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

html, body {
    height: 100%;
}

:root {
    --primary: #FF2D55;
    --primary-dark: #FF375F;
    --primary-light: #FF6B9D;
    --secondary: #5856D6;
    --accent: #32D74B;
    --accent-light: #64D2FF;
    --warning: #FF9F0A;
    --bg: #000000;
    --surface: rgba(28, 28, 30, 0.8);
    --surface-light: rgba(44, 44, 46, 0.6);
    --text: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 20px;
    --radius-sm: 12px;
}

body {
    background: radial-gradient(circle at 20% 20%, rgba(88, 86, 214, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 45, 85, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(50, 215, 75, 0.1) 0%, transparent 50%),
                var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LAYOUT & CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1100px; /* было 1280px -> растягивало "на весь экран" */
    margin: 0 auto;
    padding: 0 24px;
}

/* На очень широких мониторах еще компактнее (как у норм SaaS) */
@media (min-width: 1400px) {
  .container { max-width: 1040px; }
}

main {
    flex: 1;
    padding: 40px 0;
}

/* ===== HEADER ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 18px;
}

.brand__logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
    overflow: hidden;
}

.brand__logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .hero {
        grid-template-columns: 2fr 1fr;
        gap: 40px;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.card--glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.2), rgba(88, 86, 214, 0.2), rgba(50, 215, 75, 0.1));
    border-radius: var(--radius);
    z-index: -1;
}

.card h1 {
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #FF2D55, #5856D6, #32D74B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sub {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 500px;
}

/* ===== KPI BADGES ===== */
.kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-muted);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== FORM ELEMENTS ===== */
.small {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.input, .textarea {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.textarea {
    min-height: 140px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ===== BUTTONS ===== */
.row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--blue {
    background: linear-gradient(135deg, #0A84FF, #64D2FF);
    color: white;
    box-shadow: 0 10px 25px rgba(10, 132, 255, 0.3);
}

.btn--blue:hover {
    box-shadow: 0 15px 35px rgba(10, 132, 255, 0.4);
}

.btn--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

/* ===== STATUS & PROGRESS ===== */
.notice {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(10, 132, 255, 0.1);
    color: #64D2FF;
    margin-top: 16px;
    font-weight: 500;
}

.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.progress > div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    border-radius: 999px;
    transition: width 0.3s ease;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ===== BULK ACTIONS ===== */
#bulkActions {
    align-items: center;
    gap: 16px;
}

/* ===== RESULTS LIST ===== */
#results {
    margin-top: 20px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ===== SIDEBAR FEATURES ===== */
.feature {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.feature__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.feature__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.feature__text {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .card {
        padding: 24px;
    }

    .nav {
        gap: 16px;
    }

    .row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .topbar__row {
        flex-direction: column;
        gap: 16px;
        padding: 20px 0;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
