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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    color: #d4d4d4;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.input-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: #0e639c;
    color: #fff;
}

.btn-primary:hover {
    background: #1177bb;
}

.btn-secondary {
    background: #3c3c3c;
    color: #d4d4d4;
}

.btn-secondary:hover {
    background: #4c4c4c;
}

#jwtInput {
    width: 100%;
    min-height: 120px;
    background: #ffffff;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 12px;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

#jwtInput:focus {
    border-color: #0e639c;
}

.examples {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.examples-label {
    color: #64748b;
    font-size: 13px;
}

.example-btn {
    background: #2d2d2d;
    border: 1px solid #3c3c3c;
    color: #9cdcfe;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.example-btn:hover {
    background: #3c3c3c;
    border-color: #4c4c4c;
}

.output-section {
    display: none;
}

.output-section.visible {
    display: block;
}

.metadata {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metadata-label {
    color: #64748b;
    font-size: 13px;
}

.metadata-value {
    color: #d4d4d4;
    font-weight: 500;
    font-size: 14px;
}

.metadata-value.valid {
    color: #4ec9b0;
}

.metadata-value.invalid {
    color: #f48771;
}

.metadata-value.warning {
    color: #dcdcaa;
}

.decoded-parts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.part-box {
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.part-header {
    background: #2d2d2d;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #3c3c3c;
}

.part-title {
    font-weight: 600;
    font-size: 13px;
    color: #569cd6;
}

.part-subtitle {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

.copy-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #3c3c3c;
}

.part-content {
    padding: 15px;
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.part-content code {
    color: #d4d4d4;
}

.signature-box {
    grid-column: 1 / -1;
}

.signature-content {
    word-break: break-all;
    font-size: 12px;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #569cd6;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #f8fafc;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    border: 1px solid #3c3c3c;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #64748b;
    font-size: 13px;
}

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

    header h1 {
        font-size: 1.8rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        width: 100%;
    }

    .btn {
        flex: 1;
    }

    .decoded-parts {
        grid-template-columns: 1fr;
    }

    .metadata {
        flex-direction: column;
        gap: 10px;
    }

    .examples {
        flex-direction: column;
        align-items: flex-start;
    }
}
