/* calc/assets/css/calculators/image_to_text.css */

:root {
    --bg-graphite-card: #1E293B; 
    --text-graphite-main: #F8FAFC; 
    --text-graphite-muted: #94A3B8; 
    
    --accent-blue: #3B82F6; 
    --accent-blue-hover: #2563EB; 
    --accent-blue-glow: rgba(59, 130, 246, 0.2);
    
    --border-graphite: #334155; 
    --shadow-graphite: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 
                       0 0 15px rgba(0, 0, 0, 0.2);
}

/* ОСНОВНАЯ СЕТКА И КАРКАС */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

.calc-grid { 
    display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; 
    width: 100%; box-sizing: border-box; 
}
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

.calc-inputs, .calc-results { 
    min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; 
}

.group-title { font-size: 14px; font-weight: 800; color: #1E293B; margin: 0 0 12px 0; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #E2E8F0; padding-bottom: 8px;}

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }

.input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }

.calc-select {
    width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 600;
    border: 2px solid transparent; border-radius: 12px;
    background: #F1F5F9; outline: none; transition: all 0.3s;
    font-family: inherit; color: #1E293B; appearance: none; cursor: pointer;
}
.calc-select:focus { 
    background: #fff; border-color: var(--accent-blue); 
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); 
}
.calc-select optgroup { font-weight: 800; color: #475569; }

/* DROPZONE СТИЛИ */
.dropzone-area {
    border: 2px dashed #94A3B8; border-radius: 16px; background: #F8FAFC;
    padding: 40px 20px; text-align: center; cursor: pointer;
    transition: all 0.3s ease; margin-top: 8px;
}
.dropzone-area:hover, .dropzone-area.drag-over {
    border-color: var(--accent-blue); background: #EFF6FF;
}
.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;}
.drop-icon { color: var(--accent-blue); transition: transform 0.3s;}
.dropzone-area:hover .drop-icon { transform: translateY(-5px); }
.drop-title { font-size: 16px; font-weight: 700; color: #1E293B; }
.drop-desc { font-size: 13px; color: #64748B; }

.info-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px; border-radius: 12px; margin-top: 24px;
    font-size: 13px; line-height: 1.5; border: 1px solid;
}
.info-alert svg { flex-shrink: 0; margin-top: -2px; }
.hidden { display: none !important; }

/* ПРАВАЯ КАРТОЧКА (Graphite) */
.card--graphite-blue { 
    background: var(--bg-graphite-card); 
    color: var(--text-graphite-main); 
    border: 1px solid var(--border-graphite); border-radius: 24px;
    box-shadow: var(--shadow-graphite);
    overflow: hidden; padding: 32px 0 0 0; 
    display: flex; flex-direction: column; max-height: 650px;
    min-width: 0; max-width: 100%; box-sizing: border-box;
}
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.scanner-title { 
    color: var(--accent-blue); margin: 0 24px 16px; 
    font-size: 12px; text-align: center; 
    font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
}

.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 24px; color: var(--text-graphite-muted); gap: 16px; text-align: center;
    font-size: 14px; font-weight: 500; flex: 1;
}
.empty-state svg { color: #475569; }

/* File List */
.file-list-container {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 24px 20px;
    scrollbar-width: thin; scrollbar-color: #475569 transparent;
    min-width: 0; max-width: 100%; box-sizing: border-box;
}
.file-list-container::-webkit-scrollbar { width: 6px; }
.file-list-container::-webkit-scrollbar-thumb { background-color: #475569; border-radius: 10px; }

.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }

/* ИЗМЕНЕНИЯ ДЛЯ ПОЛНОГО ТЕКСТА: Карточка файла теперь гибкая по высоте */
.file-item {
    display: flex; flex-direction: column;
    background: #0F172A; border: 1px solid #334155; border-radius: 12px;
    padding: 12px; gap: 12px; transition: transform 0.2s; position: relative; overflow: hidden;
    min-width: 0; max-width: 100%; box-sizing: border-box;
}

.file-item-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
}

/* Эффект Сканера */
.file-item.processing::before {
    content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 2px;
    background: var(--accent-blue); box-shadow: 0 0 10px 2px var(--accent-blue-glow);
    animation: scannerSweep 2s infinite ease-in-out alternate; z-index: 10;
}
@keyframes scannerSweep { 0% { left: 0%; opacity: 0.5; } 50% { opacity: 1; } 100% { left: 100%; opacity: 0.5; } }

.file-thumb {
    width: 48px; height: 48px; border-radius: 8px; background: #1E293B;
    object-fit: cover; border: 1px solid #334155; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: var(--text-graphite-muted); font-size: 10px; font-weight: 700;
}

.file-info { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-width: 0; width: 100%; }
.file-name { 
    font-size: 13px; font-weight: 700; color: var(--text-graphite-main);
    display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    margin-bottom: 4px;
}
.file-snippet {
    font-size: 11px; color: var(--text-graphite-muted); 
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: monospace;
}

.file-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-dl-single {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; background: #334155; color: var(--text-graphite-main);
    text-decoration: none; transition: all 0.2s;
}
.btn-dl-single:hover { background: var(--accent-blue); color: #fff; }
.btn-dl-single.disabled { background: #1E293B; color: #475569; cursor: not-allowed; pointer-events: none;}

/* ТЕКСТОВОЕ ПОЛЕ ДЛЯ ПОЛНОГО ТЕКСТА */
.extracted-text-area {
    width: 100%; height: 120px; box-sizing: border-box;
    background: #1E293B; border: 1px solid #334155; border-radius: 8px;
    color: var(--text-graphite-main); padding: 12px; font-family: monospace; font-size: 12px; line-height: 1.5;
    resize: vertical; outline: none; transition: border-color 0.2s;
}
.extracted-text-area:focus { border-color: var(--accent-blue); }

/* Display Block */
.graphite-display { 
    display: flex; flex-direction: column;
    padding: 20px 24px; gap: 12px; background: #0F172A; border-top: 1px solid #334155;
    min-width: 0; max-width: 100%; box-sizing: border-box;
}

.status-indicator { font-size: 12px; font-weight: 700; color: var(--accent-blue); text-align: center; margin-bottom: -4px;}

.progress-container { margin-bottom: 8px; }
.progress-info { display: flex; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-graphite-main); margin-bottom: 8px;}
.progress-bar-bg { width: 100%; height: 6px; background: #334155; border-radius: 99px; overflow: hidden;}
.progress-bar-fill { height: 100%; background: var(--accent-blue); width: 0%; transition: width 0.1s linear;}

.download-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 16px; background: var(--accent-blue); color: #FFFFFF;
    font-size: 15px; font-weight: 700; border-radius: 14px; border: none; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}
.download-action-btn:hover:not(:disabled) { background: var(--accent-blue-hover); transform: translateY(-2px); box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4); }
.download-action-btn:disabled { background: #334155; color: #64748B; box-shadow: none; transform: none; cursor: not-allowed; }

.secondary-action-btn {
    background: transparent; color: var(--text-graphite-muted); border: none;
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline;
    transition: color 0.2s; padding: 4px;
}
.secondary-action-btn:hover { color: #EF4444; }

.error-msg {
    margin: 0 24px 24px; background: #450A0A; color: #FCA5A5;
    padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
    border: 1px solid #7F1D1D; text-align: center;
}

/* SEO ИНФОБЛОКИ И ТАБЛИЦЫ - ПОЛНЫЙ БЛОК */
.info-wrapper { padding: 60px 0; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.06); margin-bottom: 20px; }
.icon-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.3; }
.header-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04); flex-shrink: 0; margin-top: -4px; }
.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

.scanner-icon svg { color: var(--accent-blue); }
.slate-icon svg { color: #64748B; }
.intro-text { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; width: 100%; box-sizing: border-box;}
.formula-card { background: #fff; border: 1px solid rgba(0,0,0,0.04); box-shadow: 0 4px 20px rgba(0,0,0,0.03); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; min-width: 0; max-width: 100%; box-sizing: border-box;}
.formula-header { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.formula-card h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

.badge-blue { background: #EFF6FF; color: #2563EB; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge-graphite { background: #F1F5F9; color: #334155; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }

/* ТАБЛИЦА */
.seo-table-container { background: #fff; border: 1px solid #E5E5EA; border-radius: 16px; padding: 24px; margin-bottom: 40px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.seo-table-container h3 { margin-top: 0; margin-bottom: 20px; font-size: 18px; }
.seo-table { width: 100%; border-collapse: collapse; text-align: left; }
.seo-table th { background: #F8FAFC; padding: 12px 16px; font-weight: 700; border-bottom: 2px solid #E2E8F0; }
.seo-table td { padding: 16px; border-bottom: 1px solid #E2E8F0; font-weight: 500; }
.seo-table tr:last-child td { border-bottom: none; }
.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E2E8F0, transparent); margin: 48px 0; }

/* FAQ */
.faq-section .faq-item { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item[open] { border-color: var(--accent-blue); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
summary.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
summary.faq-question:hover { background-color: #F8FAFC; }
.faq-section .faq-item[open] summary.faq-question { color: #2563EB; background: #EFF6FF; }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-question .icon-plus { display: none; }
.faq-section .faq-item[open] summary.faq-question::after { content: '−'; color: #2563EB; }
.faq-answer, .faq-item div[itemprop="text"] { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 900px) {
    .row-2-col { grid-template-columns: 1fr; }
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .seo-table-container { padding: 16px; overflow-x: auto; }
    .seo-table th, .seo-table td { padding: 12px 10px; font-size: 14px; }
}