/* static/css/style.css - Полная и финальная версия */

/* --- Базовые переменные и стили --- */
:root {
    --bg-color: #121212;
    --text-color: #E0E0E0;
    --text-color-dark: #A0A0A0;
    --primary-accent: #00FFC2;
    --secondary-accent: #00A3FF;
    --card-bg: #1E1E1E;
    --border-color: #333;
    --font-family: 'Manrope', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-color); font-family: var(--font-family); line-height: 1.6; }
.container { width: 90%; max-width: 1400px; margin: 0 auto; }
.hidden-input { display: none !important; }

/* --- Шапка и Навигация (Финальная версия) --- */
.main-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.logo a { display: flex; align-items: center; text-decoration: none; }
.logo-text { font-size: 24px; font-weight: 800; color: var(--text-color); letter-spacing: -1px; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav > a, .dropdown-toggle { color: var(--text-color); text-decoration: none; font-size: 16px; font-weight: 600; transition: color 0.3s; padding: 5px 0; }
.main-nav > a:hover, .dropdown-toggle:hover { color: var(--primary-accent); }
.header-actions { display: flex; align-items: center; }
.header-actions .btn { margin-left: 10px; }
.nav-item.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 15px; background-color: transparent; border: none; min-width: 240px; z-index: 100; box-shadow: 0 10px 20px rgba(0,0,0,0.2); border-radius: 8px; }
.dropdown-menu-content { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 5px; overflow: hidden; }
.dropdown-menu a { display: block; padding: 10px 15px; margin: 0; white-space: nowrap; color: var(--text-color-dark); border-radius: 5px; transition: all 0.2s; }
.dropdown-menu a:hover { background-color: var(--primary-accent); color: #000 !important; }
.nav-item.dropdown:hover .dropdown-menu { display: block; }

/* --- Кнопки и формы --- */
.btn { padding: 10px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 16px; transition: all 0.3s; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)); color: #000; }
.btn-primary:hover { box-shadow: 0 0 15px rgba(0, 255, 194, 0.5); transform: translateY(-2px); }
.btn-secondary { background-color: var(--card-bg); color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: #2a2a2a; border-color: var(--primary-accent); }
.btn-large { padding: 15px 35px; font-size: 18px; }
.btn-full { width: 100%; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-color-dark); }
.form-control { width: 100%; padding: 12px; background-color: #121212; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-color); font-size: 16px; }
.form-control:focus { outline: none; border-color: var(--primary-accent); }

/* --- Главная страница (Лендинг) - Версия МАКСИМУМ --- */
.hero-section { text-align: center; padding: 100px 0; background: radial-gradient(circle, rgba(0, 255, 194, 0.1) 0%, rgba(18, 18, 18, 0) 70%); }
.hero-content h1 { font-size: 56px; max-width: 800px; margin: 0 auto 20px; line-height: 1.2; }
.hero-content p { font-size: 18px; color: var(--text-color-dark); max-width: 650px; margin: 0 auto 40px; }
.hero-image-container { margin: 60px 0; }
.hero-image-container img { max-width: 100%; height: auto; border-radius: 20px; box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
.hero-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 900px; margin: 80px auto 0; }
.feature-item-card { background: var(--card-bg); padding: 25px; border-radius: 15px; border: 1px solid var(--border-color); }
.feature-item-card h3 { font-size: 38px; font-weight: 800; color: var(--primary-accent); margin-bottom: 5px; }
.feature-item-card p { font-size: 16px; color: var(--text-color-dark); }

.section-divider { height: 1px; background-color: var(--border-color); margin: 80px 0; }
.feature-block-section { padding: 80px 0; }
.feature-block { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-bottom: 100px; }
.feature-block.reversed { grid-template-areas: "image content"; }
.feature-block.reversed .feature-content { grid-area: content; }
.feature-block.reversed .feature-image { grid-area: image; }
.feature-content h2 { font-size: 40px; margin-bottom: 20px; }
.feature-content p { font-size: 18px; color: var(--text-color-dark); margin-bottom: 25px; }
.feature-content ul { list-style: none; padding-left: 0; margin-bottom: 30px; }
.feature-content ul li { font-size: 17px; color: var(--text-color); margin-bottom: 10px; position: relative; padding-left: 25px; }
.feature-content ul li::before { content: '✓'; color: var(--primary-accent); position: absolute; left: 0; font-weight: bold; }
.feature-image img { max-width: 100%; height: auto; border-radius: 20px; box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
.feature-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature-gallery img { width: 100%; border-radius: 15px; }

.steps-section { padding: 100px 0; text-align: center; }
.section-title { font-size: 42px; margin-bottom: 15px; }
.section-subtitle { font-size: 18px; color: var(--text-color-dark); max-width: 700px; margin: 0 auto 60px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.step-card { background-color: var(--card-bg); border-radius: 20px; padding: 40px; border: 1px solid var(--border-color); text-align: left; position: relative; overflow: hidden; }
.step-card.green-card { background-color: #D4FF5A; color: #000; border-color: #D4FF5A; }
.step-card.green-card .step-number { color: rgba(0,0,0,0.2); }
.step-card.green-card h3, .step-card.green-card p { color: #000; }
.step-number { font-size: 70px; font-weight: 800; color: rgba(255,255,255,0.05); position: absolute; top: -10px; right: 15px; z-index: 0; line-height: 1; }
.step-card h3 { font-size: 28px; margin-bottom: 15px; position: relative; z-index: 1; }
.step-card p { color: var(--text-color-dark); margin-bottom: 30px; position: relative; z-index: 1; }
.step-image { margin-top: 30px; }
.step-image img { max-width: 100%; border-radius: 10px; box-shadow: 0 8px 15px rgba(0,0,0,0.2); }

.final-cta-section { text-align: center; background-color: var(--card-bg); border-radius: 20px; padding: 60px; border: 1px solid var(--border-color); }
.final-cta-section h2 { font-size: 36px; } .final-cta-section p { margin: 15px 0 30px 0; color: var(--text-color-dark); }


/* --- Общие стили для страниц инструментов --- */
.tool-page-container { padding: 40px 0; }
.tool-header { text-align: center; margin-bottom: 50px; }
.tool-header h1 { font-size: 42px; margin-bottom: 10px; }
.tool-header p { font-size: 18px; color: var(--text-color-dark); max-width: 600px; margin: 0 auto; }
.tool-content-split { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.tool-input-card, .tool-result-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 15px; padding: 30px; }
.result-header { display: flex; justify-content: space-between; align-items: center; }
.result-content-box { background-color: var(--bg-color); border-radius: 8px; padding: 20px; min-height: 200px; color: var(--text-color); white-space: pre-wrap; line-height: 1.7; }
.result-content-box .placeholder { color: var(--text-color-dark); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; text-align: left; }
.tool-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 15px; padding: 25px; text-decoration: none; transition: all 0.3s ease; }
.tool-card:hover { transform: translateY(-5px); border-color: var(--primary-accent); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); }
.tool-card h3 { color: var(--text-color); } .tool-card p { color: var(--text-color-dark); }
.settings-card { background-color: var(--card-bg); border-radius: 15px; padding: 30px; border: 1px solid var(--border-color); margin-bottom: 30px; }


/* --- Стили для Аналитики и Калькулятора --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 30px; }
.kpi-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 15px; padding: 25px; }
.kpi-card h4 { color: var(--text-color-dark); margin-bottom: 5px; font-size: 16px; }
.kpi-card .value { font-size: 32px; font-weight: 800; display: block; }
.period-selector { display: flex; justify-content: center; gap: 15px; }
.profit-kpi { background: linear-gradient(45deg, rgba(0, 255, 194, 0.2), rgba(0, 163, 255, 0.2)); border-color: var(--primary-accent); }
.profit-kpi .value { color: var(--primary-accent); }
.table-container { overflow-x: auto; margin-top: 30px; }
.table-container h3 { font-size: 24px; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; background-color: var(--card-bg); border-radius: 15px; overflow: hidden; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background-color: #2a2a2a; }
tbody tr:last-child td { border-bottom: none; }
.profit-cell { color: var(--primary-accent); font-weight: 700; }
.star-rating { display: flex; gap: 5px; font-size: 28px; color: #555; cursor: pointer; }
.star-rating .star { transition: color 0.2s; }
.star-rating .star:hover, .star-rating .star.selected { color: #ffc107; }


/* --- Стили для Модального Окна API --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 15px; padding: 30px; width: 100%; max-width: 450px; text-align: center; }
.modal-link-button { background: none; border: none; color: var(--text-color-dark); font-size: 14px; text-decoration: underline; cursor: pointer; margin-top: 15px; padding: 0; }
.modal-link-button:hover { color: var(--primary-accent); }
.api-instructions { text-align: left; margin-top: 20px; background-color: var(--bg-color); border-radius: 8px; padding: 15px; border: 1px solid var(--border-color); max-height: 0; opacity: 0; overflow: hidden; transition: all 0.4s ease-in-out; }
.api-instructions.active { max-height: 500px; opacity: 1; margin-top: 20px; }
.api-instructions h4 { margin-bottom: 10px; }
.api-instructions ol { padding-left: 20px; color: var(--text-color-dark); }
.api-instructions ol li { margin-bottom: 8px; }
.api-instructions a { color: var(--primary-accent); }

/* --- Генератор Изображений: Профессиональная Версия --- */
.gen-ai-container { background-color: #121212; color: var(--text-color); position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 1000; }
.gen-ai-step { display: none; }
.gen-ai-step.active { display: block; height: 100%; }
#step-upload { width: 100%; height: 100%; display: grid; place-items: center; background: #121212; }
.upload-card { background-color: var(--card-bg); border-radius: 20px; padding: 30px 40px; text-align: center; border: 1px solid var(--border-color); width: 100%; max-width: 400px; cursor: pointer; position: relative; }
.upload-card.dragover { border-color: var(--primary-accent); box-shadow: 0 0 25px rgba(0, 255, 194, 0.3); }
.upload-card-icon { margin-bottom: 15px; } .upload-card-icon img { height: 60px; filter: invert(0.7); }
.upload-card h2 { font-size: 22px; margin-bottom: 8px; }
.upload-card p { color: var(--text-color-dark); margin-bottom: 25px; }
.upload-options { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; color: var(--text-color-dark); pointer-events: auto; }
.upload-card > *:not(.upload-options) { pointer-events: none; }
.truly-hidden-input { width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1; }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; pointer-events: auto; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 22px; }
.toggle-switch .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-switch input:checked + .slider { background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)); }
.toggle-switch input:checked + .slider:before { transform: translateX(18px); }
#step-editor { display: grid; grid-template-columns: 320px 1fr 320px; height: 100vh; width: 100vw; background-color: #1a1a1a; }
.editor-panel-left, .editor-panel-right, .editor-canvas { padding: 15px; display: flex; flex-direction: column; gap: 15px; }
.editor-canvas { background-color: #242424; }
.panel-header a { font-size: 20px; font-weight: 700; color: var(--text-color); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.panel-section { margin-bottom: 10px; }
.panel-section label { display: block; margin-bottom: 10px; color: var(--text-color-dark); font-size: 14px; }
.prompt-actions { display: flex; gap: 10px; margin-top: 10px; }
.prompt-actions .btn { flex-grow: 1; padding: 8px; font-size: 14px; }
.canvas-grid-bg { flex-grow: 1; background-color: #121212; background-image: linear-gradient(45deg, #2c2c2c 25%, transparent 25%), linear-gradient(-45deg, #2c2c2c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c2c2c 75%), linear-gradient(-45deg, transparent 75%, #2c2c2c 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; display: grid; place-items: center; border-radius: 10px; background-repeat: repeat; background-position: center; background-size: cover; transition: background-image 0.5s ease; }
.product-wrapper { max-width: 80%; max-height: 80%; }
#product-image-preview { width: 100%; height: 100%; object-fit: contain; }
.canvas-footer { display: flex; justify-content: space-between; align-items: center; }
.footer-control { display: flex; align-items: center; gap: 10px; }
.form-control-small { background-color: #333; border: 1px solid var(--border-color); color: var(--text-color); border-radius: 8px; padding: 8px 12px; }
.btn-generate { font-size: 16px; padding: 12px 24px; }
.results-placeholder { flex-grow: 1; display: none; }
.results-placeholder.active { display: grid; place-items: center; text-align: center; color: var(--text-color-dark); }
.results-placeholder .spinner { border: 4px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: var(--primary-accent); width: 40px; height: 40px; animation: spin 1s ease-in-out infinite; margin-bottom: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-grow: 1; overflow-y: auto; }
.result-image-container { border: 2px solid transparent; border-radius: 10px; cursor: pointer; transition: all 0.3s; overflow: hidden; aspect-ratio: 1/1; }
.result-image-container:hover { border-color: var(--text-color-dark); }
.result-image-container.selected { border-color: var(--primary-accent); box-shadow: 0 0 15px rgba(0, 255, 194, 0.5); transform: scale(1.05); }
.result-image-container img { width: 100%; height: 100%; object-fit: cover; }
.results-footer { padding-top: 15px; }
.results-footer .btn:disabled { background: #333; color: var(--text-color-dark); cursor: not-allowed; border-color: var(--border-color); }
/* --- Улучшения для главной страницы --- */
.animated-gradient-text {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent), var(--primary-accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-animation 4s linear infinite;
}

@keyframes gradient-animation {
    to { background-position: 200% center; }
}

/* Анимации появления при скролле */
.anim-fade-in, .anim-fade-in-up {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.anim-fade-in-up {
    transform: translateY(50px);
}
.anim-fade-in.visible, .anim-fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Секция "Свяжитесь с нами" --- */
.contact-section {
    padding: 80px 0;
}
.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}


/* --- Виджет поддержки Telegram --- */
.support-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, var(--secondary-accent), #007BFF);
    color: white;
    border-radius: 50px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 163, 255, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}
.support-widget:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.5);
}
.support-widget-icon {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
}
.support-widget-icon svg {
    width: 20px;
    height: 20px;
}
.support-widget-text strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}
.support-widget-text span {
    font-size: 13px;
    opacity: 0.8;
}
/* --- Стили для Виджета Telegram --- */
.support-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 50px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}
.support-widget:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.3);
}
.support-widget-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}
.support-widget-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.support-widget-text {
    padding-right: 15px;
}
.support-widget-text strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
    color: var(--text-color);
}
.support-widget-text span {
    font-size: 13px;
    color: var(--text-color-dark);
}

/* --- Стили для Системы Поддержки --- */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: var(--bg-color); border-radius: 8px; text-decoration: none; transition: background-color 0.2s; }
.ticket-item:hover { background-color: #2a2a2a; }
.ticket-subject { color: var(--text-color); font-weight: 600; }
.ticket-status { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 20px; text-transform: uppercase; }
.status-open { background-color: #5d5a1a; color: #feebc8; }
.status-answered { background-color: #1a5d21; color: #c6f6d5; }
.status-closed { background-color: #555; color: #ccc; }

.ticket-chat-container { display: flex; flex-direction: column; gap: 20px; }
.message-by-staff { flex-direction: row-reverse; }
.message-by-staff .message-content { background-color: var(--primary-accent); color: #000; }
.message-by-staff .message-content .message-author { color: #333; }
.message-author { font-weight: 700; margin-bottom: 5px; font-size: 14px; }
.message-time { font-size: 12px; color: var(--text-color-dark); text-align: right; margin-top: 8px; }
.message-by-staff .message-time { color: #555; }