:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --accent-primary: #ff6b35;
    --accent-secondary: #f7c948;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --gradient: linear-gradient(135deg, #ff6b35, #f7c948);
    --border-color: #2a2a3a;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Unbounded', cursive;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
}

.hero {
    padding: 180px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-family: 'Unbounded', cursive;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero-title .accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--gradient);
    opacity: 0.2;
    animation: pulse 4s ease-in-out infinite;
}

.hero-circle.small {
    width: 200px;
    height: 200px;
    animation-delay: 2s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 107, 53, 0.1);
}

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

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: block;
}

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

.generator {
    padding: 80px 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab {
    padding: 14px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--gradient);
    color: var(--bg-primary);
    border-color: transparent;
}

.tab-content {
    display: none;
}

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

.description-field {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
    gap: 12px;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--gradient);
    border-color: var(--accent-primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: bold;
}

.checkbox-input[type="radio"] + .checkbox-custom {
    border-radius: 50%;
}

.checkbox-input[type="radio"]:checked + .checkbox-custom {
    background: var(--gradient);
    border-color: var(--accent-primary);
}

.checkbox-input[type="radio"]:checked + .checkbox-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 50%;
}

.image-prompt-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.generated-image-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.generated-image-section h4 {
    font-family: 'Unbounded', cursive;
    font-size: 16px;
    color: var(--accent-secondary);
    margin-bottom: 15px;
}

.image-preview {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-publish-option {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.image-publish-option.hidden {
    display: none;
}

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

.image-prompt-header h4 {
    font-family: 'Unbounded', cursive;
    font-size: 16px;
    color: var(--accent-secondary);
}

#imagePromptText {
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.result-publish {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.result-publish h4 {
    font-family: 'Unbounded', cursive;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.publish-options {
    display: flex;
    gap: 20px;
    margin: 16px 0;
}

.scheduled-options {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.publish-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-vk {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-vk {
    background: linear-gradient(135deg, #0077FF, #00BFFF);
    color: white;
}

.btn-vk:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 119, 255, 0.4);
}

.form-input-small {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input-small:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-input-small::placeholder {
    color: var(--text-secondary);
    font-size: 13px;
}

.generation-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 10px;
}

.settings-auth {
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.settings-auth h3 {
    font-family: 'Unbounded', cursive;
    margin-bottom: 24px;
}

.settings-panel {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

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

.settings-header h3 {
    font-family: 'Unbounded', cursive;
}

.tones-list {
    margin-bottom: 30px;
}

.tone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
}

.tone-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tone-item-id {
    font-family: monospace;
    color: var(--accent-primary);
    font-size: 14px;
}

.tone-item-name {
    color: var(--text-primary);
    font-weight: 500;
}

.delete-tone-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #ff3b30;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.delete-tone-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: #ff3b30;
}

.add-tone {
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.add-tone h4 {
    font-family: 'Unbounded', cursive;
    font-size: 18px;
    margin-bottom: 16px;
}

.add-tone-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.add-tone-form .form-input-small {
    flex: 1;
}

.audiences-list {
    margin-bottom: 15px;
}

.audience-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
}

.audience-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.audience-item-id {
    font-family: monospace;
    color: var(--accent-primary);
    font-size: 14px;
}

.audience-item-name {
    color: var(--text-primary);
    font-weight: 500;
}

.delete-audience-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #ff3b30;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.delete-audience-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: #ff3b30;
}

.section-title {
    font-family: 'Unbounded', cursive;
    font-size: 36px;
    text-align: center;
    margin-bottom: 50px;
}

.generator-form {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
}

.form-select {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

.result {
    max-width: 700px;
    margin: 40px auto 0;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

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

.result-header {
    padding: 20px 30px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.result-title {
    font-family: 'Unbounded', cursive;
    font-size: 18px;
    color: var(--accent-primary);
}

.result-content {
    padding: 30px;
}

.result-content p {
    white-space: pre-wrap;
    line-height: 1.8;
}

.result-actions {
    display: flex;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

.hidden {
    display: none !important;
}

.error {
    max-width: 700px;
    margin: 20px auto;
    padding: 16px 24px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid #ff3b30;
    border-radius: 12px;
    color: #ff3b30;
    text-align: center;
}

.help {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.help-card {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
}

.help-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
}

.help-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Unbounded', cursive;
    font-size: 24px;
    font-weight: 700;
    color: var(--bg-primary);
    margin: 0 auto 20px;
}

.help-card h3 {
    font-family: 'Unbounded', cursive;
    font-size: 20px;
    margin-bottom: 12px;
}

.help-card p {
    color: var(--text-secondary);
}

.ai-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200;
}

.ai-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

.ai-toggle:hover {
    transform: scale(1.1);
}

.ai-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.ai-header {
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.ai-avatar {
    font-size: 24px;
}

.ai-messages {
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
}

.ai-message {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-input {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.ai-input input {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

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

.ai-input button {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--bg-primary);
    font-size: 18px;
    transition: transform 0.2s;
}

.ai-input button:hover {
    transform: scale(1.1);
}

.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        margin: 0 auto 32px;
    }

    .nav {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .ai-chat {
        width: 280px;
    }
}