/* JWT Debugger (Offline) — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #060b18;
    --bg2: #0d1524;
    --bg3: #121d30;
    --bg4: #1a273e;
    --border: #1e2d45;
    --border2: rgba(255, 255, 255, 0.04);
    --text: #d8e8ff;
    --text2: #5a7ca0;
    --text3: #2a3d5a;
    --blue: #60a5fa;
    --green: #4ade80;
    --orange: #fb923c;
    --red: #f87171;
    --purple: #c084fc;
    --radius: 12px;
    --t: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 40% at 5% 5%, rgba(96, 165, 250, 0.06), transparent), radial-gradient(ellipse 40% 25% at 95% 90%, rgba(74, 222, 128, 0.04), transparent);
    z-index: 0;
}

/* Header */
header {
    background: rgba(6, 11, 24, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hdr {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.25);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
}

h1.brand-title {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

.hdr-actions {
    display: flex;
    gap: 6px;
}

/* Layout */
.mode-view {
    max-width: 1200px;
    margin: 14px auto;
    padding: 0 20px 40px;
    position: relative;
    z-index: 1;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Panels */
.panel {
    background: rgba(13, 21, 36, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.panel:last-child {
    margin-bottom: 0;
}

.panel-title-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text2);
}

/* JWT input */
.jwt-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 12px 14px;
    font-size: 11.5px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.65;
    resize: vertical;
    min-height: 130px;
    outline: none;
    word-break: break-all;
}

.jwt-input::placeholder {
    color: var(--text3);
}

/* JWT parts overlay */
.jwt-parts {
    padding: 8px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    word-break: break-all;
    border-top: 1px solid var(--border2);
    line-height: 1.8;
    min-height: 24px;
}

.part-header {
    color: #60a5fa;
}

.part-payload {
    color: #4ade80;
}

.part-sig {
    color: #fb923c;
}

.part-dot {
    color: var(--text3);
}

/* Verify box */
.verify-box {
    padding: 10px 14px;
    border-top: 1px solid var(--border2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verify-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
}

.verify-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
    white-space: nowrap;
}

.verify-result {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.verify-ok {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.verify-fail {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Status bar */
.status-bar {
    padding: 8px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-ok {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: var(--green);
}

.status-warn {
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.2);
    color: var(--orange);
}

.status-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--red);
}

.status-tag {
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
}

/* JSON view */
.json-view {
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 1.75;
    overflow-x: auto;
    min-height: 60px;
    color: var(--text);
}

.jk {
    color: #93c5fd;
}

/* keys */
.jv-str {
    color: #86efac;
}

.jv-num {
    color: #fca5a5;
}

.jv-bool {
    color: #c4b5fd;
}

.jv-null {
    color: #94a3b8;
}

/* Claims table */
.claims-table {
    padding: 0 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.claim-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 11px;
}

.claim-name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--blue);
    min-width: 50px;
    flex-shrink: 0;
}

.claim-desc {
    color: var(--text2);
}

.claim-val {
    color: var(--text3);
    font-style: italic;
    margin-left: auto;
}

/* Sig view */
.sig-view {
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #fb923c;
    word-break: break-all;
    line-height: 1.6;
}

/* Builder */
.json-editor {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 12px 14px;
    font-size: 11.5px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.7;
    resize: vertical;
    min-height: 120px;
    outline: none;
}

.claim-presets {
    padding: 6px 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    border-top: 1px solid var(--border2);
}

.preset-label {
    font-size: 10px;
    color: var(--text3);
}

.claim-preset {
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg3);
    font-size: 10px;
    cursor: pointer;
    transition: var(--t);
    color: var(--text2);
}

.claim-preset:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.jwt-output {
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    word-break: break-all;
    line-height: 1.8;
    min-height: 80px;
}

/* Compare */
.compare-body {
    padding: 12px 14px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diff-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.diff-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--blue);
    width: 100px;
    flex-shrink: 0;
}

.diff-a {
    color: var(--red);
}

.diff-b {
    color: var(--green);
}

.diff-same {
    color: var(--text2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

.btn:hover {
    border-color: var(--blue);
    color: #93c5fd;
}

.btn-sm {
    padding: 3px 9px;
    font-size: 10px;
    border-radius: 6px;
}

.btn-primary {
    background: #1d4ed8;
    border-color: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px;
    width: 100%;
    justify-content: center;
    border-radius: 9px;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-verify {
    background: rgba(74, 222, 128, 0.13);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--green);
}

.mode-btn {
    transition: var(--t);
}

.mode-btn.active {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--blue);
    color: var(--blue);
}

/* Inputs */
.inp {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    padding: 5px 9px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--t);
    flex: 1;
}

.inp:focus {
    border-color: var(--blue);
}

/* Toast */
.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
    pointer-events: all;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

@media(max-width:760px) {
    .layout {
        grid-template-columns: 1fr;
    }
}