*,
*::before,
*::after {
    box-sizing: border-box;
}

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

.container {
    max-width: min(1400px, 96vw);
    margin: 20px auto;
    padding: 24px 28px;
    background: radial-gradient(circle at top left, #1f2937, #020617);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

header h1 .app-version {
    font-size: 0.5em;
    font-weight: normal;
    color: rgba(148, 163, 184, 0.9);
}

header p {
    margin-top: 8px;
    color: #9ca3af;
}

.actions-row {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 900px) {
    .actions-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }
    .actions-row .default-link {
        flex: 1;
        min-width: 0;
    }
    .actions-row .upload-section {
        flex: 1;
        min-width: 0;
    }
}

.models-section {
    margin-bottom: 28px;
}

.models-section h2 {
    margin: 0 0 4px 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.models-hint {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.models-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.models-list .model-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.4);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.models-list .model-option:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(100, 116, 139, 0.5);
}

.models-list .model-option input {
    margin: 0 10px 0 0;
    flex-shrink: 0;
}

.models-list .model-limit {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-left: 6px;
}

.meta .model-used,
.meta .usage-tokens,
.meta .rate-limit {
    margin-top: 4px;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Log szekció */
.log-section {
    margin-top: 2rem;
    border-top: 1px solid #334155;
    padding-top: 1rem;
}

.log-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.log-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    text-decoration: underline;
}

.log-toggle:hover {
    color: #e2e8f0;
}

.log-refresh {
    background: #334155;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.log-refresh:hover {
    background: #475569;
}

.log-content {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.75rem;
    max-height: 200px;
    overflow: auto;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

.log-content pre.log-lines {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.default-link {
    margin-bottom: 28px;
}

.default-link .default-hint {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.default-link .default-hint code {
    background: rgba(51, 65, 85, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

.default-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.default-link .no-default {
    color: #94a3b8;
    font-size: 0.95rem;
}

.default-link .no-default code {
    background: rgba(51, 65, 85, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-default {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-default:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-default:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-box {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    max-width: 400px;
}

.loading-box p {
    margin: 0 0 8px 0;
    color: #e2e8f0;
}

.loading-box p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.back-link {
    margin-bottom: 16px;
}

.back-link a {
    color: #93c5fd;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

h2 {
    margin-top: 0;
    font-size: 1.3rem;
}

.upload-section {
    margin-bottom: 28px;
    padding-top: 4px;
}

.upload-section h2 {
    margin-bottom: 14px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.upload-form .form-actions {
    margin-top: 4px;
}

.form-row {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-row label {
    margin-bottom: 6px;
}

.form-row-file input[type="file"] {
    width: 100%;
    max-width: 100%;
}

.file-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 6px;
    min-height: 1.2em;
}

label {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #cbd5f5;
}

input[type="file"],
input[type="text"] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background-color: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
}

input[type="file"]::file-selector-button {
    background-color: #1d4ed8;
    color: #e5e7eb;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    margin-right: 10px;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background-color: #1e40af;
}

.upload-form button[type="submit"] {
    align-self: flex-start;
    padding: 12px 24px;
    font-size: 1rem;
}

button {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
    box-shadow: 0 10px 25px -10px rgba(34, 197, 94, 0.6);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px -12px rgba(34, 197, 94, 0.8);
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.error {
    padding: 12px 14px;
    border-radius: 8px;
    background-color: rgba(185, 28, 28, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fecaca;
    margin-bottom: 16px;
}

.results {
    margin-top: 16px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgba(37, 99, 235, 0.2);
    color: #bfdbfe;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge .doc-link,
a.default-doc-link {
    color: #93c5fd;
    text-decoration: underline;
}

.badge .doc-link:hover,
a.default-doc-link:hover {
    color: #bfdbfe;
}

a.default-doc-link {
    font-size: 0.9rem;
}

.meta {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #e5e7eb;
}

#results-section .table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.compare-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.compare-section h3 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
}

.compare-hint {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.compare-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.compare-controls select {
    min-width: 280px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-size: 0.95rem;
}

#compare-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.compare-result {
    margin-top: 8px;
}

.compare-meta {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.compare-date {
    font-size: 0.85em;
    opacity: 0.9;
}

.compare-table .row-diff {
    background: rgba(251, 191, 36, 0.08);
}

.compare-table .cell-diff {
    background: rgba(251, 191, 36, 0.2);
    font-weight: 600;
}

table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(15, 23, 42, 0.9);
}

thead {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.9), rgba(30, 64, 175, 0.7));
}

th, td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
}

th {
    color: #e5e7eb;
}

tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.8);
}

tbody tr:nth-child(odd) {
    background-color: rgba(15, 23, 42, 0.6);
}

tbody tr:hover {
    background-color: rgba(30, 64, 175, 0.35);
}

@media (max-width: 768px) {
    .container {
        margin: 16px;
        padding: 16px;
    }

    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }

    table, thead, tbody, th, td, tr {
        font-size: 0.8rem;
    }
}

