/* style.css */

/* Add Google Fonts import at the very top */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Основные переменные для цветов — СВЕТЛАЯ ТЕМА */
:root {
    --color-primary: #2563eb; /* Tailwind blue-700 */
    --color-primary-dark: #1d4ed8; /* Tailwind blue-800 */
    --color-secondary: #6b7280; /* Tailwind gray-500 */
    --color-text-dark: #1f2937; /* Tailwind gray-900 */
    --color-text-light: #111827; /* Tailwind gray-900 (for headings) */
    --color-border: #d1d5db; /* Tailwind gray-300 */
    --color-background-light: #f3f4f6; /* Tailwind gray-100 */
    --color-background-card: #ffffff; /* white */
    --color-input-bg: #ffffff; /* white */
    --color-progress-bg: #e5e7eb; /* Tailwind gray-200 */
    --color-progress-fill: #2563eb; /* Tailwind blue-700 */
    --color-modal-overlay: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    --color-success: #059669; /* Tailwind green-700 */
    --color-error: #dc2626; /* Tailwind red-600 */
    --color-info: #2563eb; /* Tailwind blue-700 */
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
    padding: 0;
    margin: 0;
}

/* Header */
header {
    background-color: #ffffff;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
header .btn-header {
    background-color: #f9fafb; /* gray-50 */
    color: #4b5563; /* gray-600 */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: 1px solid #e5e7eb;
}
header .btn-header:hover {
    background-color: #f3f4f6; /* gray-100 */
}

/* Input Group */
.input-group {
    margin-bottom: 1.5rem;
}
.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151; /* gray-700 */
    margin-bottom: 0.5rem;
}

/* Headings */
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

/* Input Fields */
.input-field, .textarea-field {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-input-bg);
    color: var(--color-text-dark);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field::placeholder, .textarea-field::placeholder {
    color: #9ca3af; /* gray-400 */
}
.input-field:focus, .textarea-field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); /* blue-700 with opacity */
}
.input-field:disabled, .textarea-field:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.textarea-field {
    min-height: 5rem;
    resize: vertical;
}

/* Checkbox */
.form-checkbox {
    height: 1rem;
    width: 1rem;
    color: var(--color-primary);
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    transition: background-color 0.2s, border-color 0.2s;
}
.form-checkbox:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
    border: none;
}
.btn-primary:hover {
    background-color: #1d4ed8; /* blue-800 */
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #f9fafb; /* gray-50 */
    color: #4b5563; /* gray-600 */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: 1px solid #e5e7eb;
}
.btn-secondary:hover {
    background-color: #f3f4f6; /* gray-100 */
}

.btn-upload {
    background-color: #f9fafb; /* gray-50 */
    color: #4b5563; /* gray-600 */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}
.btn-upload:hover {
    background-color: #f3f4f6; /* gray-100 */
}

/* Analysis Pipeline Icons */
.icon-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 1px solid #e5e7eb;
}

/* Progress Indicator */
#progress-stages {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.progress-stage {
    text-align: center;
    color: #6b7280; /* gray-500 */
    transition: color 0.3s;
}
.progress-stage .icon-container {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 1.25rem;
    border: 1px solid #e5e7eb;
}
/* Pending State */
.progress-stage.pending .icon-container {
    background-color: #f9fafb; /* gray-50 */
    color: #9ca3af; /* gray-400 */
}
.progress-stage.pending .stage-label {
    color: #9ca3af; /* gray-400 */
}
/* In-Progress State */
.progress-stage.in-progress .icon-container {
    background-color: #2563eb; /* blue-700 */
    color: white;
    animation: pulse 2s infinite;
}
.progress-stage.in-progress .stage-label {
    color: #2563eb; /* blue-700 */
}
/* Success State */
.progress-stage.success .icon-container {
    background-color: #059669; /* green-700 */
    color: white;
}
.progress-stage.success .stage-label {
    color: #059669; /* green-700 */
}
/* Error State */
.progress-stage.error .icon-container {
    background-color: #dc2626; /* red-600 */
    color: white;
}
.progress-stage.error .stage-label {
    color: #dc2626; /* red-600 */
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Progress Bar */
#progressBarContainer {
    background-color: var(--color-progress-bg);
}
#progressBar {
    background-color: var(--color-progress-fill);
}

/* Status Log */
#statusLog {
    background-color: #f9fafb; /* gray-50 */
    border: 1px solid #e5e7eb; /* gray-200 */
}
#detailedProgressLog {
    background-color: #f3f4f6; /* gray-100 */
    color: #4b5563; /* gray-600 */
}

/* Results Section Tabs */
.tab-button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: #6b7280; /* gray-500 */
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    margin-bottom: -2px;
}
.tab-button:hover {
    color: var(--color-primary);
}
.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-button-inner {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6b7280; /* gray-500 */
    font-weight: 500;
    font-size: 0.875rem;
}
.tab-button-inner.active {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Tab Content */
.tab-content {
    display: none !important;
}
.tab-content.active {
    display: block !important;
}
.tab-content-inner {
    display: none !important;
}
.tab-content-inner.active {
    display: block !important;
}

/* General Card Styles for Results */
#summaryTab > div > div,
#aiSummaryContainer,
#llmScoresContainer > div,
#fullReportContainerWrapper > div,
#chartsContainer > div {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}

/* Tables */
.scrollable-table-container {
    border: 1px solid #e5e7eb;
    overflow-x: auto;
}
.scrollable-table-container table {
    background-color: #ffffff;
    width: 100%;
    table-layout: fixed;
}
.scrollable-table-container th {
    background-color: #f9fafb; /* gray-50 */
    color: #374151; /* gray-700 */
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}
.scrollable-table-container td {
    color: #4b5563; /* gray-600 */
    border-color: #e5e7eb;
    padding: 0.75rem 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Specific Table Cell Colors for TFIDF */
.scrollable-table-container tr.bg-red-950 { background-color: #fef2f2; } /* red-50 */
.scrollable-table-container tr.bg-yellow-950 { background-color: #fffbeb; } /* yellow-50 */
.scrollable-table-container td.text-red-400 { color: #ef4444; /* red-500 */ }
.scrollable-table-container td.text-yellow-400 { color: #eab308; /* yellow-500 */ }

/* Recommendation Card */
.recommendation-card {
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
}
.recommendation-header {
    background-color: #ffffff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #e5e7eb;
}
.recommendation-header:hover {
    background-color: #f9fafb; /* gray-50 */
}
.recommendation-title {
    color: #111827; /* gray-900 */
    font-weight: 600;
    font-size: 1rem;
}
.recommendation-card .recommendation-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.recommendation-card.expanded .recommendation-details {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}
.recommendation-card .recommendation-header .fa-chevron-down {
    transition: transform 0.3s ease-in-out;
}
.recommendation-card.expanded .recommendation-header .fa-chevron-down {
    transform: rotate(180deg);
}

.recommendation-body {
    color: #374151; /* gray-700 */
    padding: 1rem;
}
.recommendation-body strong {
    color: #111827; /* gray-900 */
}

/* Priority Badges */
.priority-badge {
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.priority-Критический { background-color: #dc2626; } /* red-600 */
.priority-Высокий { background-color: #ea580c; } /* orange-600 */
.priority-Средний { background-color: #2563eb; } /* blue-700 */
.priority-Низкий { background-color: #6b7280; } /* gray-500 */

/* Message Box */
.message-box {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    z-index: 1000;
    transition: bottom 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}
.message-box.show {
    bottom: 30px;
}

/* Modals */
.modal-overlay {
    background-color: var(--color-modal-overlay);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 0.5rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}
.modal-overlay.show .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3, .modal-header h2 {
    color: #111827; /* gray-900 */
}
.modal-header .close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af; /* gray-400 */
}
.modal-header .close-modal-btn:hover {
    color: #111827; /* gray-900 */
}
.modal-body {
    color: #374151; /* gray-700 */
    padding: 1.5rem;
}
.modal-body strong {
    color: #111827; /* gray-900 */
}

/* Image Preview Modal */
#previewImage {
    border-color: #e5e7eb;
}

/* Competitor Selection Modal Table Styles */
#competitorResultsTableBody table {
    table-layout: fixed;
    width: 100%;
}

#competitorResultsTableBody th, #competitorResultsTableBody td {
    padding: 0.5rem;
    white-space: normal;
    word-break: break-word;
}

#competitorResultsTableBody th:nth-child(1), #competitorResultsTableBody td:nth-child(1) { width: 5%; }
#competitorResultsTableBody th:nth-child(2), #competitorResultsTableBody td:nth-child(2) { width: 5%; }
#competitorResultsTableBody th:nth-child(3), #competitorResultsTableBody td:nth-child(3) {
    width: 35%;
    word-break: break-all;
    text-align: left;
    padding-left: 12px;
}
#competitorResultsTableBody th:nth-child(4), #competitorResultsTableBody td:nth-child(4) { width: 8%; text-align: center; }
#competitorResultsTableBody th:nth-child(5), #competitorResultsTableBody td:nth-child(5) { width: 8%; text-align: center; }
#competitorResultsTableBody th:nth-child(6), #competitorResultsTableBody td:nth-child(6) { width: 8%; text-align: center; }
#competitorResultsTableBody th:nth-child(7), #competitorResultsTableBody td:nth-child(7) { width: 8%; text-align: center; }
#competitorResultsTableBody th:nth-child(8), #competitorResultsTableBody td:nth-child(8) { width: 10%; text-align: center; }
#competitorResultsTableBody th:nth-child(9), #competitorResultsTableBody td:nth-child(9) { width: 8%; text-align: center; }

#competitorResultsTableBody tr.bg-green-50 { background-color: #f0fdf4; } /* green-50 */
#competitorResultsTableBody tr.bg-red-100 { background-color: #fef2f2; } /* red-50 */
#competitorResultsTableBody td.text-red-500 { color: #ef4444; }
#competitorResultsTableBody td.text-gray-500 { color: #6b7280; }

/* Comparison Table Specific Styles */
.comparison-table {
    table-layout: fixed;
    width: 100%;
}

.comparison-table th, .comparison-table td {
    padding: 0.75rem 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
}

.comparison-table th:first-child, .comparison-table td:first-child {
    width: 150px;
    min-width: 150px;
    max-width: 200px;
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-table thead th:first-child {
    background-color: #f9fafb; /* gray-50 */
    z-index: 11;
}

.comparison-table th:not(:first-child), .comparison-table td:not(:first-child) {
    width: calc((100% - 150px) / var(--num-competitors, 1));
    min-width: 100px;
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
}

.scrollable-table-container table:not(.comparison-table) {
    table-layout: fixed;
    width: 100%;
}

.scrollable-table-container table:not(.comparison-table) th,
.scrollable-table-container table:not(.comparison-table) td {
    padding: 0.75rem 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
    width: auto;
}

/* TF*IDF Table */
#tfidfTableContainer table th:nth-child(1), #tfidfTableContainer table td:nth-child(1) { width: 180px; min-width: 180px; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tfidfTableContainer table th:nth-child(2), #tfidfTableContainer table td:nth-child(2) { width: 90px; min-width: 90px; max-width: 120px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(3), #tfidfTableContainer table td:nth-child(3) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(4), #tfidfTableContainer table td:nth-child(4) { width: 90px; min-width: 90px; max-width: 120px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(5), #tfidfTableContainer table td:nth-child(5) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(6), #tfidfTableContainer table td:nth-child(6) { width: 90px; min-width: 90px; max-width: 120px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(7), #tfidfTableContainer table td:nth-child(7) { width: 90px; min-width: 90px; max-width: 120px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(8), #tfidfTableContainer table td:nth-child(8) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#tfidfTableContainer table th:nth-child(9), #tfidfTableContainer table td:nth-child(9) { width: 90px; min-width: 90px; max-width: 120px; white-space: nowrap; }

/* N-grams Table */
#bigramsTableContainer table th:nth-child(1), #bigramsTableContainer table td:nth-child(1),
#trigramsTableContainer table th:nth-child(1), #trigramsTableContainer table td:nth-child(1) {
    width: 150px; min-width: 150px; max-width: 200px;
    position: sticky; left: 0; z-index: 5;
    background-color: #ffffff; border-right: 1px solid #e5e7eb;
    white-space: normal; word-break: break-word;
}
#bigramsTableContainer table thead th:nth-child(1),
#trigramsTableContainer table thead th:nth-child(1) {
    background-color: #f9fafb; z-index: 6;
}
#bigramsTableContainer table th:not(:first-child), #bigramsTableContainer table td:not(:first-child),
#trigramsTableContainer table th:not(:first-child), #trigramsTableContainer table td:not(:first-child) {
    width: calc((100% - 150px) / var(--num-docs-for-ngrams, 1));
    min-width: 80px; max-width: 120px;
    white-space: nowrap;
}

/* Keywords Table */
#keywordsTableContainer table th:nth-child(1), #keywordsTableContainer table td:nth-child(1) { width: 150px; min-width: 150px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#keywordsTableContainer table th:nth-child(2), #keywordsTableContainer table td:nth-child(2) { width: 60px; min-width: 60px; max-width: 80px; white-space: nowrap; }
#keywordsTableContainer table th:not(:nth-child(-n+2)), #keywordsTableContainer table td:not(:nth-child(-n+2)) {
    width: calc((100% - 210px) / var(--num-docs-for-keywords, 1));
    min-width: 80px; max-width: 120px;
    white-space: nowrap;
}

/* Images Table */
#imageTableContainer table th:nth-child(1), #imageTableContainer table td:nth-child(1) { width: 180px; min-width: 180px; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#imageTableContainer table th:nth-child(2), #imageTableContainer table td:nth-child(2) { width: 70px; min-width: 70px; max-width: 90px; white-space: nowrap; }
#imageTableContainer table th:nth-child(3), #imageTableContainer table td:nth-child(3) { width: 70px; min-width: 70px; max-width: 90px; white-space: nowrap; }
#imageTableContainer table th:nth-child(4), #imageTableContainer table td:nth-child(4) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#imageTableContainer table th:nth-child(5), #imageTableContainer table td:nth-child(5) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#imageTableContainer table th:nth-child(6), #imageTableContainer table td:nth-child(6) { width: 150px; min-width: 150px; max-width: 200px; white-space: normal; word-break: break-word; }
#imageTableContainer table th:nth-child(7), #imageTableContainer table td:nth-child(7) { width: 50px; min-width: 50px; max-width: 70px; white-space: nowrap; }
#imageTableContainer table th:nth-child(8), #imageTableContainer table td:nth-child(8) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#imageTableContainer table th:nth-child(9), #imageTableContainer table td:nth-child(9) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }
#imageTableContainer table th:nth-child(10), #imageTableContainer table td:nth-child(10) { width: 80px; min-width: 80px; max-width: 100px; white-space: nowrap; }

/* Score Circle Container Adjustment */
.score-circle-container {
    position: relative;
    top: -32px;
}
#seo-health-score, #llm-friendly-score-value, #human-touch-score-value {
    top: 70px;
}