body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 80%;
    margin: 0 auto;
    min-width: 1024px; /* Минимальная ширина для читаемости */
}

h1 {
    text-align: center;
    color: #333;
}

.file-upload {
    margin: 0; /* Убираем margin, так как отступы теперь управляются через .controls */
}

#fileInput {
    display: none;
}

.upload-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    display: inline-block;
}

.upload-button:hover {
    background-color: #45a049;
}

.table-container {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    overflow-wrap: break-word; /* Перенос длинных слов */
    word-wrap: break-word;     /* Для поддержки старых браузеров */
    word-break: break-word;    /* Перенос в любом месте если нужно */
    min-width: 50px;          /* Минимальная ширина ячейки */
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
    position: sticky;
    top: 0;
}

th.sortable {
    cursor: pointer;
}

th.sortable:hover {
    background-color: #e9ecef;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Стили для разных уровней логов */
.level-info {
    border-left: 4px solid #4CAF50;
}

.level-debug {
    border-left: 4px solid #2196F3;
}

.level-warn {
    border-left: 4px solid #ff9800;
}

.level-error {
    border-left: 4px solid #f44336;
}

.level-gc {
    border-left: 4px solid #9c27b0;
}

/* Стили для сообщений */
td.message {
    max-width: none; /* Убираем ограничение максимальной ширины */
    white-space: pre-wrap;
    word-break: break-word;
}

/* Добавьте эти стили в конец файла */
.additional-info {
    max-width: none; /* Убираем ограничение максимальной ширины */
    white-space: pre-wrap;
    word-break: break-word;
}

.additional-info pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: inherit;
}

/* Обновляем ширину столбцов */
th:nth-child(1) { width: 10%; }  /* Timestamp */
th:nth-child(2) { width: 60%; }  /* Message */
th:nth-child(3) { width: 5%; }   /* Level */
th:nth-child(4) { width: 7%; }   /* Logger */
th:nth-child(5) { width: 8%; }   /* ID */
th:nth-child(6) { width: 10%; }  /* Additional Info */

/* Стили для лоадера */
.loader-container {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #4CAF50;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: #666;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Затемнение таблицы при загрузке */
.table-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Добавляем стили для контролов */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

/* Удаляем стили для logs-count-control */
.logs-count-control,
.logs-count-input {
    display: none;
}

/* Добавляем стили для контрола направления чтения */
.direction-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.direction-control input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.direction-control label {
    cursor: pointer;
    user-select: none;
}

/* Стили для кнопки загрузки */
.load-more-container {
    text-align: center;
    margin: 20px 0;
}

.load-more-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.load-more-button:hover {
    background-color: #45a049;
}

.load-more-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Стили для поиска */
.search-control {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.search-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #45a049;
}

.search-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Добавляем стиль для подсветки найденного текста */
.highlight {
    background-color: #90EE90; /* бледно-зеленый цвет */
    padding: 2px;
    border-radius: 2px;
}

/* Стили для кнопки возврата */
.back-button {
    margin: 20px;
}

.back-button a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.back-button a:hover {
    color: #45a049;
} 

#time-delta-form {
    margin: 20px 0;
}

#result {
    margin-top: 20px;
    font-size: 1.2em;
    color: #333;
}