:root {
    --bg-deep: #070b1a;
    --bg-mid: #101a34;
    --panel: rgba(14, 23, 48, 0.72);
    --panel-border: rgba(144, 190, 255, 0.24);
    --text-main: #eaf1ff;
    --text-soft: #b7c5e6;
    --accent: #39a4ff;
    --accent-2: #8b5cf6;
    --success: #20f0a8;
    --danger: #ff6b6b;
    --shadow-3d: 0 20px 40px rgba(0, 0, 0, 0.45), 0 6px 20px rgba(41, 109, 255, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    padding: 28px;
    margin: 0;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, rgba(57, 164, 255, 0.25), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(139, 92, 246, 0.22), transparent 33%),
        linear-gradient(145deg, var(--bg-deep), var(--bg-mid));
    min-height: 100vh;
}

body.centered {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    position: relative;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 28px;
    margin: 14px auto;
    max-width: 1180px;
    width: 100%;
    box-shadow: var(--shadow-3d);
    overflow: hidden;
}

.container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 65%, rgba(57, 164, 255, 0.16));
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.page-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(57, 164, 255, 0.5);
}

.top-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(151, 187, 255, 0.35);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: rgba(57, 164, 255, 0.15);
}

.nav-link[aria-current="page"] {
    background: linear-gradient(135deg, rgba(57, 164, 255, 0.35), rgba(139, 92, 246, 0.25));
    border-color: var(--accent);
}

.error-banner {
    display: none;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.45);
    background: rgba(80, 20, 30, 0.55);
    color: #ffe0e0;
    font-size: 0.9rem;
}

.error-banner.visible {
    display: block;
}

.error-banner strong {
    color: #fff;
}

.error-banner ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.column {
    background: var(--panel);
    border: 1px solid rgba(138, 179, 255, 0.2);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.26);
    transform: translateY(0);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.column:hover {
    transform: translateY(-2px);
    border-color: rgba(77, 164, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(9, 25, 68, 0.5);
}

label {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: var(--text-main);
    width: 100%;
    text-align: left;
    font-size: 0.92rem;
    letter-spacing: 0.2px;
}

label.hint,
span.hint {
    display: block;
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-top: 4px;
}

input,
select,
button {
    width: 100%;
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid rgba(151, 187, 255, 0.32);
    font-size: 0.95rem;
    text-align: left;
}

input,
select {
    padding: 11px 12px;
    color: #eef5ff;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder {
    color: #9eb1d8;
}

select {
    color-scheme: dark;
}

select option {
    color: #eaf1ff;
    background-color: #162546;
}

select option:checked {
    background-color: #244a8f;
    color: #ffffff;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(57, 164, 255, 0.2);
    transform: translateY(-1px);
}

.field-hidden {
    display: none !important;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.buttons button {
    flex: 1;
    min-width: 120px;
    margin-top: 0;
}

button {
    margin-top: 18px;
    padding: 12px;
    text-align: center;
    border: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 18px rgba(33, 104, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(33, 104, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: brightness(1.05);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background: linear-gradient(135deg, #2b4acb, #6b21a8);
}

button.tertiary {
    background: linear-gradient(135deg, #0d9488, #2563eb);
}

.copy-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #1c7ed6, #3b5bdb);
}

.copy-btn[hidden] {
    display: none;
}

.column h3 {
    margin: 4px 0 10px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(57, 164, 255, 0.4);
    font-size: 1.2rem;
}

pre#result {
    margin: 0;
    height: 100%;
    min-height: 380px;
    background: linear-gradient(170deg, rgba(4, 10, 25, 0.96), rgba(2, 6, 16, 0.96));
    color: var(--success);
    border: 1px solid rgba(57, 164, 255, 0.35);
    border-radius: 12px;
    padding: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 0 18px rgba(0, 0, 0, 0.4);
    font-size: 0.8rem;
}

/* Guide page */
.guide-scroll {
    max-width: 1180px;
    margin: 0 auto;
}

.guide-content {
    position: relative;
    z-index: 1;
    color: var(--text-main);
    line-height: 1.65;
}

.guide-content h1 {
    font-size: 1.75rem;
    color: #fff;
    margin-top: 0;
    text-shadow: 0 0 10px rgba(57, 164, 255, 0.35);
}

.guide-content h2 {
    font-size: 1.25rem;
    color: #c8d9ff;
    margin-top: 1.75rem;
    border-bottom: 1px solid rgba(151, 187, 255, 0.25);
    padding-bottom: 6px;
}

.guide-content h3 {
    font-size: 1.05rem;
    color: var(--text-soft);
    margin-top: 1.25rem;
}

.guide-content p,
.guide-content li {
    font-size: 0.95rem;
    color: var(--text-soft);
}

.guide-content ul,
.guide-content ol {
    padding-left: 1.4rem;
}

.guide-content code,
.guide-content pre {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
}

.guide-content code {
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--success);
}

.guide-content pre {
    background: rgba(4, 10, 25, 0.9);
    border: 1px solid rgba(57, 164, 255, 0.3);
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
    color: #a5f3d0;
    line-height: 1.45;
}

.guide-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 12px 0;
}

.guide-content th,
.guide-content td {
    border: 1px solid rgba(151, 187, 255, 0.25);
    padding: 8px 10px;
    text-align: left;
}

.guide-content th {
    background: rgba(30, 58, 95, 0.6);
    color: #fff;
}

.guide-content td {
    color: var(--text-soft);
}

.guide-content .callout {
    border-left: 4px solid var(--accent);
    padding: 12px 14px;
    margin: 16px 0;
    background: rgba(57, 164, 255, 0.08);
    border-radius: 0 10px 10px 0;
    color: var(--text-main);
}

@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 1fr;
    }

    pre#result {
        min-height: 260px;
    }
}
