/* --- Wrapper (Matches Stopwatch/Diff Theme) --- */
#jwt-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
    gap: 20px;
}

/* --- Labels --- */
.jwt-label {
    font-size: 0.7rem;
    color: #9ca3af; /* Gray 400 */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-bottom: 2px solid #374151;
    padding-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.jwt-label-sub {
    color: #4b5563; /* Darker gray for detail */
    font-size: 0.6rem;
}

/* --- Input Section --- */
.jwt-section {
    width: 100%;
}

.jwt-textarea {
    width: 100%;
    background-color: #1f2937; /* Gray 800 */
    border: 1px solid #374151;
    color: #d1d5db; /* Gray 300 */
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    padding: 15px;
    border-radius: 6px;
    height: 120px;
    resize: vertical;
    outline: none;
    line-height: 1.4;
    transition: all 0.2s;
    word-break: break-all;
}

.jwt-textarea:focus {
    border-color: #ec4899; /* Pink focus for Input */
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
    color: white;
}

/* --- Status Bar --- */
.jwt-status {
    font-size: 0.7rem;
    padding: 8px;
    margin-top: -4px; /* Connect visually to input */
    background-color: #111;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    text-align: center;
    color: #4b5563;
    border: 1px solid #374151;
    border-top: none;
    font-weight: bold;
}

.jwt-status.success {
    color: #10b981; /* Green */
    border-color: #059669;
}

.jwt-status.error {
    color: #ef4444; /* Red */
    border-color: #b91c1c;
}

/* --- Output Grid --- */
.jwt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Header left, Payload right */
    gap: 20px;
    width: 100%;
}

.jwt-col {
    display: flex;
    flex-direction: column;
}

.jwt-output-box {
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.85rem;
    color: #6b7280; /* Dim when inactive */
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 250px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 500px;
}

/* Custom Scrollbar */
.jwt-output-box::-webkit-scrollbar { width: 8px; }
.jwt-output-box::-webkit-scrollbar-track { background: #111; }
.jwt-output-box::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

/* Active States */
#jwt-output-header.active {
    border-color: #ef4444; /* Red border for Header (convention) */
    color: #fca5a5;
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.3);
}

#jwt-output-payload.active {
    border-color: #a855f7; /* Purple border for Payload (convention) */
    color: #d8b4fe;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.3);
}

.jwt-output-box.error {
    color: #ef4444;
    border-color: #ef4444;
}

/* --- Clear Button --- */
.jwt-btn-clear {
    width: 100%;
    background-color: #374151;
    color: #9ca3af;
    border: none;
    border-bottom: 4px solid #1f2937;
    border-radius: 4px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.1s;
}

.jwt-btn-clear:hover {
    background-color: #4b5563;
    color: white;
}

.jwt-btn-clear:active {
    transform: translateY(4px);
    border-bottom: none;
    margin-bottom: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .jwt-grid {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
    }
    
    .jwt-output-box {
        min-height: 150px;
    }
}