/* calc/assets/css/calculators/webp_converter.css */

:root {
    --bg-grape-card: #FCFAFF; 
    --text-grape-main: #1C1C1E; 
    --text-grape-muted: #8E8E93; 
    
    --accent-grape: #7B61FF; 
    --accent-honey: #FFB020; 
    --accent-grape-glow: rgba(123, 97, 255, 0.15);
    
    --border-grape: #E5E0F8; 
    --shadow-grape: 0 24px 48px -12px rgba(123, 97, 255, 0.1), 
                    0 0 15px rgba(0, 0, 0, 0.03);
}

/* =========================================
   ОСНОВНАЯ СЕТКА И КАРКАС
   ========================================= */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* ЗАЩИТА ОТ GRID BLOWOUT: minmax(0, 1fr) не дает сетке разрываться */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; width: 100%; box-sizing: border-box;}
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

.calc-inputs { gap: 16px; min-width: 0; }
.group-title { font-size: 14px; font-weight: 800; color: var(--text-grape-main); margin: 0 0 12px 0; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #F2F2F7; 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); transition: color 0.3s;}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper select {
    width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 600;
    border: 2px solid transparent; border-radius: 12px;
    background: #F2F2F7; outline: none; transition: all 0.3s;
    font-family: inherit; color: var(--text-grape-main); appearance: none; cursor: pointer;
}
.input-wrapper select:focus { 
    background: #fff; border-color: var(--accent-grape); 
    box-shadow: 0 0 0 4px var(--accent-grape-glow); 
}

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* DROPZONE */
.dropzone-area {
    border: 2px dashed #D1D1D6; border-radius: 16px; background: #FAFAFC;
    padding: 40px 20px; text-align: center; cursor: pointer;
    transition: all 0.3s ease; margin-top: 8px; width: 100%; box-sizing: border-box;
}
.dropzone-area:hover, .dropzone-area.drag-over {
    border-color: var(--accent-grape); background: #F4F1FF;
}
.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;}
.drop-icon { color: var(--accent-grape); transition: transform 0.3s;}
.dropzone-area:hover .drop-icon { transform: translateY(-5px); }
.drop-title { font-size: 16px; font-weight: 700; color: var(--text-grape-main); }
.drop-desc { font-size: 13px; color: var(--text-grape-muted); }

.info-alert {
    display: flex; align-items: flex-start; gap: 12px;
    background: #F4F1FF; border: 1px solid #E5E0F8;
    padding: 16px; border-radius: 12px; margin-top: 24px;
    color: #4A3A99; font-size: 13px; line-height: 1.5;
}
.info-alert svg { flex-shrink: 0; color: var(--accent-grape); margin-top: -2px; }
.hidden { display: none !important; }

/* =========================================
   ПРАВАЯ КАРТОЧКА (Grape & Honey)
   ========================================= */
.card--grape-honey { 
    background: var(--bg-grape-card); 
    color: var(--text-grape-main); 
    border: 1px solid var(--border-grape); border-radius: 24px;
    box-shadow: var(--shadow-grape);
    overflow: hidden; padding: 32px 0 0 0; 
    display: flex; flex-direction: column; max-height: 600px;
    width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0;
}
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.grape-title { 
    color: var(--accent-grape); margin: 0 24px 16px; 
    font-size: 12px; text-align: center; 
    font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
}

/* Empty State */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 24px; color: var(--text-grape-muted); gap: 16px; text-align: center;
    font-size: 14px; font-weight: 500;
}
.empty-state svg { color: #D1D1D6; }

/* File List (Пакетная конвертация) */
.file-list-container {
    flex: 1; overflow-y: auto; padding: 0 24px 20px;
    width: 100%; box-sizing: border-box;
    /* Кастомный скроллбар */
    scrollbar-width: thin; scrollbar-color: var(--border-grape) transparent;
}
.file-list-container::-webkit-scrollbar { width: 6px; }
.file-list-container::-webkit-scrollbar-thumb { background-color: var(--border-grape); border-radius: 10px; }

.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; width: 100%;}

.file-item {
    display: flex; align-items: center; justify-content: space-between;
    background: #FFFFFF; border: 1px solid var(--border-grape); border-radius: 12px;
    padding: 10px; gap: 12px; transition: transform 0.2s;
    width: 100%; box-sizing: border-box; max-width: 100%;
}
.file-item:hover { border-color: var(--accent-grape); transform: translateX(2px); }

.file-thumb {
    width: 48px; height: 48px; border-radius: 8px; background: #F2F2F7;
    object-fit: cover; border: 1px solid #E5E5EA; flex-shrink: 0;
    background-image: linear-gradient(45deg, #E5E5EA 25%, transparent 25%, transparent 75%, #E5E5EA 75%, #E5E5EA), linear-gradient(45deg, #E5E5EA 25%, transparent 25%, transparent 75%, #E5E5EA 75%, #E5E5EA);
    background-size: 10px 10px; background-position: 0 0, 5px 5px;
}

/* МАГИЯ ЗДЕСЬ: min-width: 0 разрешает тексту сокращаться через многоточие (...) */
.file-info { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; }

.file-name { 
    font-size: 13px; font-weight: 700; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
    width: 100%; display: block;
}

.file-meta { font-size: 11px; color: var(--text-grape-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.file-meta .status { color: #34C759; font-weight: 600; }

.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: #F4F1FF; color: var(--accent-grape);
    text-decoration: none; transition: all 0.2s; flex-shrink: 0;
}
.btn-dl-single:hover { background: var(--accent-grape); color: #fff; }

/* Buttons Display */
.grape-display { 
    display: flex; flex-direction: column;
    padding: 20px 24px; gap: 12px; background: #FAFAFC; border-top: 1px solid var(--border-grape);
    width: 100%; box-sizing: border-box;
}

.download-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 16px; background: var(--accent-honey); color: #1C1C1E;
    font-size: 15px; font-weight: 700; border-radius: 14px; border: none; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 8px 20px rgba(255, 176, 32, 0.3);
    box-sizing: border-box; white-space: normal; line-height: 1.3; text-align: center;
}
.download-action-btn:hover { background: #E59D17; transform: translateY(-2px); box-shadow: 0 12px 25px rgba(255, 176, 32, 0.4); }
.download-action-btn:disabled { background: #E5E5EA; color: #8E8E93; box-shadow: none; transform: none; cursor: not-allowed; }

.secondary-action-btn {
    background: transparent; color: var(--text-grape-muted); border: none;
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline;
    transition: color 0.2s; padding: 4px; box-sizing: border-box; width: 100%; text-align: center;
}
.secondary-action-btn:hover { color: #E11D48; }

.error-msg {
    margin: 0 24px 24px; background: #FEF2F2; color: #E11D48;
    padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
    border: 1px solid #FECDD3; text-align: center; width: calc(100% - 48px); box-sizing: border-box;
}

/* =========================================
   SEO ИНФОБЛОКИ И ТАБЛИЦА
   ========================================= */
.info-wrapper { padding: 60px 0; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.06); margin-bottom: 20px; overflow: hidden; width: 100%;}
.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; }

.grape-icon svg { color: var(--accent-grape); }
.slate-icon svg { color: var(--text-grape-muted); }

.intro-text { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

.formulas-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 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-grape { background: #F4F1FF; color: var(--accent-grape); padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge-honey { background: #FFF6E0; color: #D97706; 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); max-width: 100%; box-sizing: border-box; overflow-x: auto;}
.seo-table-container h3 { margin-top: 0; margin-bottom: 20px; color: var(--text-grape-main); font-size: 18px; }
.seo-table { width: 100%; border-collapse: collapse; text-align: left; }
.seo-table th { background: #F2F2F7; padding: 12px 16px; font-weight: 700; color: var(--text-grape-muted); border-bottom: 2px solid #E5E5EA; }
.seo-table td { padding: 16px; border-bottom: 1px solid #E5E5EA; color: var(--text-grape-main); font-weight: 500; }
.seo-table tr:last-child td { border-bottom: none; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E5EA, transparent); margin: 48px 0; }

/* FAQ */
.faq-section .faq-item { background: #fff; border: 1px solid #E5E5EA; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item[open] { border-color: var(--accent-grape); box-shadow: var(--shadow-grape); }
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: #F4F1FF; }
.faq-section .faq-item[open] summary.faq-question { color: var(--accent-grape); background: #F4F1FF; }
.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: var(--accent-grape); }
.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; }
}