/******** Logs Page **********/

/* Общие стили для страницы логов */
.ai-content-wizard-logs-page {
    background: linear-gradient(135deg, #6ddb90 0%, #35a79c 100%) !important;
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin-top: 20px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Стили для формы фильтрации */
.ai-cw-logs-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    background: #f7f7f7;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}
.ai-cw-logs-filter-form label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}
.ai-cw-logs-filter-form select,
.ai-cw-logs-filter-form input[type="date"],
.ai-cw-logs-filter-form input[type="submit"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

/* Контейнер для дат (Custom) */
#custom_period_fields {
    border: 1px dotted #ccc;
    border-radius: 4px;
    padding: 8px;
}
#custom_period_fields.custom-active {
    display: flex !important;
    align-items: center;
    gap: 10px;
}
.custom-dates-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.custom-dates-wrapper label {
    margin: 0;
    font-weight: 600;
}

/* Кнопка фильтрации (Apply) */
.ai-cw-logs-filter-form input[type="submit"] {
    background: #35a79c;
    color: #fff;
    border: none;
    cursor: pointer;
    margin-left: auto;
}
.ai-cw-logs-filter-form select:focus,
.ai-cw-logs-filter-form input[type="date"]:focus,
.ai-cw-logs-filter-form input[type="submit"]:focus {
    border-color: #35a79c;
    box-shadow: 0 0 3px rgba(53, 167, 156, 0.5);
}
.ai-cw-logs-filter-form input[type="submit"]:hover {
    background: #2e8a85;
}

/* Заголовок табов (единый блок) */
.ai-cw-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 5px 10px;
    margin-bottom: 0;
}
.ai-cw-tab-buttons {
    display: flex;
    gap: 10px;
}

/* Стили вкладок */
.ai-cw-tab-button {
    background-color: #f9f9f9;
    color: #333;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    padding: 10px 16px;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 16px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}
.ai-cw-tab-button:hover {
    background-color: #eaeaea;
}
.ai-cw-tab-button.active {
    background-color: #fff;
    box-shadow: inset 0 -3px 0 #35a79c;
    font-weight: bold;
}

/* Блок с количеством записей в заголовке */
.log-count-header {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

/* Содержимое таба */
.ai-cw-tab-content {
    display: none;
}
.ai-cw-tab-content.active {
    display: block;
}
.tab-content-wrapper {
    border: 1px solid #ddd;
    border-radius: 0 4px 4px 4px;
    padding: 15px;
    background: #fff;
    color: #333;
    overflow-x: auto;
}

/* Стили для таблиц логов */
.ai-content-wizard-logs-page .ai-cw-logs-table,
.ai-content-wizard-logs-page .ai-cw-article-logs-table {
    background-color: #fff !important;
    color: #333 !important;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto !important;
    width: 100%;
}
.ai-content-wizard-logs-page .ai-cw-logs-table th,
.ai-content-wizard-logs-page .ai-cw-logs-table td,
.ai-content-wizard-logs-page .ai-cw-article-logs-table th,
.ai-content-wizard-logs-page .ai-cw-article-logs-table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}
.ai-content-wizard-logs-page .ai-cw-logs-table th,
.ai-content-wizard-logs-page .ai-cw-article-logs-table th {
    background-color: #f9f9f9;
    text-align: left;
}

/* Стили для пагинации */
.pagination {
    margin-top: 15px;
    text-align: center;
}
.pagination a {
    margin: 0 5px;
    padding: 5px 10px;
    background: #fff;
    color: #35a79c;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
}
.pagination a:hover {
    background: #e7e7e7;
}
.pagination .current-page {
    margin: 0 5px;
    padding: 5px 10px;
    background: #35a79c;
    color: #fff;
    border: 1px solid #35a79c;
    border-radius: 4px;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .ai-content-wizard-logs-page {
        padding: 10px;
    }
    .ai-cw-logs-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .ai-cw-logs-filter-form label,
    .ai-cw-logs-filter-form select,
    .ai-cw-logs-filter-form input[type="date"],
    .ai-cw-logs-filter-form input[type="submit"] {
        width: 100%;
        margin-left: 0;
    }
    #custom_period_fields.custom-active {
        flex-direction: column;
        align-items: stretch;
    }
    .ai-cw-tab-button {
        padding: 10px;
        font-size: 14px;
    }
}
