:root {
    color-scheme: dark;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0c101f;
    color: #e7ecff;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -40vh -30vw;
    background: radial-gradient(55% 55% at 25% 25%, rgba(120, 99, 255, 0.25), transparent 65%),
        radial-gradient(45% 45% at 80% 20%, rgba(76, 201, 240, 0.18), transparent 70%),
        radial-gradient(50% 50% at 50% 85%, rgba(255, 99, 132, 0.18), transparent 70%);
    filter: blur(0px);
    z-index: -2;
    animation: auroraShift 18s ease-in-out infinite;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, rgba(8, 13, 30, 0.75) 0%, rgba(8, 10, 24, 0.92) 55%, rgba(10, 16, 34, 0.98) 100%);
    z-index: -1;
}

.container {
    width: min(720px, 92vw);
    margin: 3rem auto 2rem;
    flex: 1 0 auto;
}

.hero {
    text-align: center;
    animation: fadeDown 0.8s ease forwards;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3rem);
}

.lead {
    color: #9aa3c7;
    margin-top: 0.5rem;
    max-width: 40ch;
    margin-inline: auto;
}

.card {
    background: rgba(19, 26, 46, 0.85);
    border: 1px solid rgba(115, 130, 184, 0.25);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 18px 38px rgba(7, 13, 25, 0.5);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
    animation: floatIn 0.9s ease forwards;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(138, 180, 248, 0.2), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#lookup-form {
    margin-top: 2rem;
    display: grid;
    gap: 1.5rem;
}

.card:hover::before {
    opacity: 1;
}

.field-group {
    display: grid;
    gap: 0.5rem;
}

label {
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(115, 130, 184, 0.35);
    background: rgba(11, 16, 31, 0.9);
    color: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

input:focus,
select:focus,
button:focus {
    outline: 2px solid #7289da;
    outline-offset: 2px;
}

.dropdown {
    position: relative;
}

.dropdown__toggle {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(115, 130, 184, 0.35);
    background: rgba(11, 16, 31, 0.9);
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: none;
    font-weight: 500;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.22s ease;
}

.dropdown__toggle:hover {
    border-color: rgba(138, 180, 248, 0.9);
    background: rgba(16, 23, 42, 0.95);
}

.dropdown__toggle:focus-visible {
    border-color: rgba(138, 180, 248, 0.9);
}

.dropdown__chevron {
    width: 0.65rem;
    height: 0.65rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.dropdown.open .dropdown__chevron {
    transform: rotate(-135deg);
}

.dropdown__menu {
    position: absolute;
    inset: calc(100% + 0.4rem) 0 auto;
    background: rgba(12, 18, 37, 0.98);
    border: 1px solid rgba(115, 130, 184, 0.25);
    border-radius: 12px;
    box-shadow: 0 18px 34px rgba(5, 11, 27, 0.55);
    padding: 0.35rem;
    display: grid;
    gap: 0.25rem;
    z-index: 10;
    max-height: 14rem;
    overflow-y: auto;
}

.dropdown__option {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dropdown__option:hover,
.dropdown__option:focus-visible {
    border-color: rgba(138, 180, 248, 0.5);
    background: rgba(33, 45, 80, 0.75);
}

.dropdown__option.is-selected {
    background: rgba(104, 123, 226, 0.22);
    border-color: rgba(138, 180, 248, 0.7);
}

.field-help {
    margin: 0;
    font-size: 0.85rem;
    color: #8e96be;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

button:not(.dropdown__toggle):not(.dropdown__option) {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #5865f2, #8c8cff, #5865f2);
    background-size: 250% 250%;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-position 0.6s ease;
    position: relative;
    overflow: hidden;
}

button:not(.dropdown__toggle):not(.dropdown__option):hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 28px rgba(45, 64, 180, 0.45);
    background-position: 80% 20%;
}

button:disabled,
button[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

button.secondary {
    background: transparent;
    border: 1px solid rgba(115, 130, 184, 0.4);
    color: inherit;
    box-shadow: none;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

button.secondary:hover {
    border-color: rgba(138, 180, 248, 0.9);
    color: #b6c8ff;
    box-shadow: 0 10px 24px rgba(65, 86, 156, 0.35);
}

.status {
    margin-top: 1.5rem;
    min-height: 1.5rem;
    color: #9aa3c7;
    text-align: center;
    opacity: 0.85;
    transition: color 0.25s ease;
}

.status.status-active {
    animation: statusPulse 0.6s ease;
}

.status.error {
    color: #ff8fa3;
}

.results {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.results.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

#result-body {
    margin: 1rem 0 0;
    font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.65rem;
    white-space: pre;
    overflow-x: auto;
    background: rgba(9, 14, 30, 0.9);
    border: 1px solid rgba(115, 130, 184, 0.25);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    position: relative;
}

#result-body code {
    display: block;
    color: #dbe4ff;
    line-height: 1.5;
}

.json-key {
    color: #8bd5ff;
}

.json-string {
    color: #c1ffb4;
}

.json-number {
    color: #ffb86b;
}

.json-boolean {
    color: #ff9ce6;
}

.json-null {
    color: #f8f8f2;
    opacity: 0.7;
}

.footer {
    margin: 2rem 0 3rem;
    text-align: center;
    color: #6f7ba7;
    font-size: 0.9rem;
}

.footer a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

@media (max-width: 520px) {
    .card {
        padding: 1.25rem;
    }

    button {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@keyframes auroraShift {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(6deg) scale(1.05);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes statusPulse {
    0% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(0);
    }
}
