/* assets/style.css */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

.wrapper {
    max-width: 1100px;
    margin: 20px auto;
    padding: 16px;
    background: #020617;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

header h1 {
    margin: 0 0 4px;
    font-size: 24px;
}

header p {
    margin: 0 0 16px;
    font-size: 13px;
    color: #9ca3af;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-button {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
    transition: 0.15s;
}

.tab-button.active {
    background: #22c55e;
    color: #020617;
    border-color: transparent;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 12px 4px;
}

.tab-content.active {
    display: block;
}

h2 {
    margin-top: 0;
    font-size: 18px;
}

.form-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 13px;
    color: #9ca3af;
}

input[type="text"],
select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 14px;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34,197,94,0.3);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.15s;
}

.btn.primary {
    background: #22c55e;
    color: #020617;
    font-weight: 600;
}

.btn.primary:hover {
    background: #16a34a;
}

.btn.small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.result-box {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #9ca3af;
}

.result-box.ok {
    border-color: #22c55e;
    color: #bbf7d0;
}

.result-box.error {
    border-color: #ef4444;
    color: #fecaca;
}

.hint {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #020617;
}

.data-table th,
.data-table td {
    border: 1px solid #1f2937;
    padding: 6px 8px;
    vertical-align: top;
}

.data-table th {
    text-align: left;
    color: #9ca3af;
    font-weight: 500;
}

.data-table tbody tr:nth-child(odd) {
    background: #020617;
}

.data-table tbody tr:nth-child(even) {
    background: #030712;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.badge-success {
    background: #16a34a;
    color: #022c22;
}

/* Адаптив */
@media (max-width: 768px) {
    .wrapper {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        margin-bottom: 8px;
        border-radius: 8px;
        overflow: hidden;
    }

    .data-table td {
        border: none;
        border-bottom: 1px solid #1f2937;
    }

    .data-table td::before {
        display: block;
        font-size: 11px;
        color: #6b7280;
        margin-bottom: 2px;
    }

    .data-table td:nth-child(1)::before { content: "ID"; }
    .data-table td:nth-child(2)::before { content: "Дата"; }
    .data-table td:nth-child(3)::before { content: "Баер"; }
    .data-table td:nth-child(4)::before { content: "Метка"; }
    .data-table td:nth-child(5)::before { content: "Апселлер"; }
    .data-table td:nth-child(6)::before { content: "Статус"; }
    .data-table td:nth-child(7)::before { content: "Результат"; }
    .data-table td:nth-child(8)::before { content: "Тест"; }
}
.log-list {
    margin-top: 8px;
    padding-left: 20px;
    list-style: none;
}

.log-list li {
    font-size: 13px;
    margin-bottom: 3px;
}
.result-box {
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.45;
}

.result-item {
    display: flex;
    align-items: flex-start;       /* 🔥 важно */
    gap: 8px;                       /* расстояние между иконкой и текстом */
    margin-bottom: 6px;
}

.result-item .icon {
    font-size: 18px;
    line-height: 1;                 /* 🔥 выравнивает иконку */
    margin-top: 2px;                /* 🔥 небольшая корректировка */
}

.result-item.success .icon {
    color: #4CAF50; /* зелёный */
}

.result-item.error .icon {
    color: #ff4d4d; /* красный */
}
#check-result.ok {
    border: 2px solid #4caf50;
    background: #0e2610;
    color: #aaffaa;
}

#check-result.error {
    border: 2px solid #ff5555;
    background: #2a0f0f;
    color: #ffcccc;
}

.log-list {
    margin-left: 0;
    padding-left: 15px;
    list-style: none;
    line-height: 1.6em;
}

.log-list li {
    font-size: 15px;
}

.log-list li span {
    opacity: 0.8;
}
/* -------------------------------------- */
/* Стили для колонки "Ссылка"             */
/* -------------------------------------- */

.test-link {
    color: #4da3ff;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

.test-link:hover {
    text-decoration: underline;
}

.url-preview {
    font-size: 12px;
    color: #bbb;
    word-break: break-all;
    line-height: 1.4;
    display: block;
    max-width: 550px;   /* ширина текста */
    white-space: normal;
}

/* Чтобы таблица красиво растягивалась */
.data-table td:nth-child(3),
.data-table th:nth-child(3) {
    width: 500px;
}

/* Подсветка строки при наведении */
.data-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

/* Фикс мелких отступов */
.data-table td {
    vertical-align: top;
    padding-top: 10px;
    padding-bottom: 10px;
}
/* === Таблица тестирования === */

.data-table td.url-cell {
    max-width: 420px;                /* ширина колонки */
    white-space: normal !important;  /* разрешаем перенос */
    word-break: break-all;           /* ломаем длинные строки */
    line-height: 1.3em;
}

.data-table a.url-open {
    display: inline-block;
    color: #4FA3FF;                  /* голубая ссылка */
    text-decoration: underline;
    margin-bottom: 4px;
}

.data-table .url-text {
    background: rgba(255,255,255,0.05);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #ccc;
    max-height: 70px;                /* ограничиваем высоту */
    overflow-y: auto;                /* добавляем скролл если длинная */
}
