/* Основные стили */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/*
 * === Telegram баннер ===
 * position: fixed, центрирован в левом зазоре экрана.
 * Формула: left gap ≈ (100vw − 900px) / 2  (900px ≈ max-width контент-карточки)
 * Центр left gap = (100vw − 900px) / 4
 * Banner left    = центр − half_banner_width = (100vw − 900px) / 4 − 90px
 */
.tg-fixed-banner {
    position: fixed;
    top: 100px;
    left: calc((100vw - 900px) / 4 - 100px);
    width: 200px;
    z-index: 100;
}

/* Скрывать на экранах, где нет места (< 1400px) */
@media (max-width: 1399px) {
    .tg-fixed-banner { display: none !important; }
}

.tg-sidebar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(160deg, #2AABEE 0%, #229ED9 100%);
    border-radius: 16px;
    padding: 24px 16px;
    color: #fff;
    box-shadow: 0 6px 24px rgba(42, 171, 238, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    gap: 12px;
    width: 100%;
}

.tg-sidebar-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(42, 171, 238, 0.65);
    color: #fff;
}

.tg-sidebar-icon {
    font-size: 3rem;
    line-height: 1;
}

.tg-sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Эмодзи в стиле Telegram (Noto Color Emoji от Google) */
.tg-emoji {
    font-family: 'Noto Color Emoji', sans-serif;
    font-style: normal;
    font-weight: normal;
}

.tg-sidebar-desc {
    font-size: 0.76rem;
    opacity: 0.93;
    line-height: 1.45;
}

.tg-sidebar-btn {
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 7px 0;
    font-size: 0.78rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.tg-sidebar-card:hover .tg-sidebar-btn {
    background: rgba(255, 255, 255, 0.4);
}

/* Контейнер для загрузки */
.upload-container {
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
}

/* Область загрузки */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 4rem 2rem;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
    position: relative;
    display: block;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-content {
    user-select: none;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Список файлов */
.selected-files {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-actions {
    margin-left: 1rem;
}

/* Прогресс загрузки */
.progress-container {
    margin: 2rem 0;
}

.progress {
    height: 1.5rem;
    border-radius: 0.75rem;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    transition: width 0.3s ease;
}

/* Результаты */
.results-container {
    margin-top: 2rem;
}

.links-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.links-list {
    max-height: 400px;
    overflow-y: auto;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.link-item:last-child {
    margin-bottom: 0;
}

.link-url {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
    flex: 1;
    margin-right: 1rem;
}

.link-url:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Информационная панель */
.info-panel .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-panel .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.info-panel ul li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.info-panel ul li i {
    margin-right: 0.5rem;
    width: 1rem;
}

/* Сессия */
.session-info {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

/* Кнопки */
.btn {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Навигация */
.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Шапка с описанием */
.header-description {
    margin-top: -1px;
    padding: 0.75rem 0;
    line-height: 1.2;
}

.header-description p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.85);
}

/* SEO ключевые слова в футере */
.seo-keywords {
    margin-bottom: 0.5rem;
}

.seo-keywords small {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Футер */
footer {
    margin-top: auto;
}

/* Админ панель */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .upload-card {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .link-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-url {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .header-description p {
        font-size: 0.8rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Состояния */
.success-state {
    border-color: #28a745;
    background-color: #d4edda;
}

.error-state {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Скрытый H1 для SEO */
.seo-hidden-h1 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
}

/* Блоки преимуществ */
.features-section {
    margin-top: 2rem;
}

.feature-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #e9ecef;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
}

.feature-card h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    color: #666;
    position: relative;
    padding-left: 1.5rem;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* SEO описание */
.seo-description .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.seo-description .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* Компактное описание под шапкой */
.header-description {
    padding: 0.5rem 0;
    margin-top: -1px;
}

.header-description p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.2;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.85);
}

/* Скрытый H1 для SEO */
.seo-hidden-h1 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .feature-card {
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .header-description p {
        font-size: 0.8rem;
    }
}

/* ─── Блог ──────────────────────────────────────────────────────────── */

.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.blog-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f2f5;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.05);
}

.blog-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-body {
    padding: 1.25rem;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    color: #999;
    font-size: 0.8rem;
}

.blog-empty-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Статья — детальная страница */

.blog-article-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.blog-back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.blog-back-link:hover {
    color: #764ba2;
}

.blog-article-title {
    font-size: 2rem;
    font-weight: 800;
    color: #222;
    line-height: 1.3;
}

.blog-article-meta {
    color: #999;
    font-size: 0.9rem;
}

.blog-article-thumbnail img {
    border-radius: 12px;
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.blog-article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.blog-article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #222;
}

.blog-article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.blog-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.blog-article-figure {
    margin: 2rem 0;
    padding: 0;
    text-align: center;
}

.blog-article-figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.blog-article-content blockquote {
    border-left: 4px solid #667eea;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9ff;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.blog-article-content ul, .blog-article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.blog-article-content li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .blog-article-card {
        padding: 1.5rem;
    }

    .blog-article-title {
        font-size: 1.5rem;
    }

    .blog-card-img {
        height: 160px;
    }
}

/* Related posts */
.blog-related-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
}

.blog-related-card {
    padding: 12px;
    border-radius: 10px;
    transition: background 0.2s;
    color: #333;
}

.blog-related-card:hover {
    background: #f0f2ff;
    color: #333;
}

.blog-related-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.blog-related-img-placeholder {
    width: 80px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blog-related-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}
