/* Container */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Mode Switcher (Tab Style) */
.mode-switch-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px;
    display: flex;
    position: relative;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.mode-btn.active {
    color: white;
}

/* Sliding Background for Tabs */
.switch-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--primary-blue);
    border-radius: 40px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
}

/* When decoding, slide bg to right */
.mode-switch-container.decode-active .switch-bg {
    transform: translateX(100%);
}

/* Editor Panes */
.editor-pane {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 200px;
    transition: border-color 0.2s;
}

.editor-pane:focus-within {
    border-color: var(--primary-blue);
}

.output-pane {
    background: var(--bg-body); /* Slightly darker to indicate read-only */
}

.pane-header {
    background: var(--bg-body);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-header span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.action-link {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.action-link.danger { color: #ef4444; }

textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-main);
    background: transparent;
    outline: none;
    line-height: 1.5;
}

/* Arrow Icon */
.action-arrow {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

/* Common Components (Toast, Modal) */
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 10px 20px; border-radius: 30px;
    font-size: 0.9rem; z-index: 1000; animation: slideUp 0.3s;
}
@keyframes slideUp { from {opacity:0; transform:translate(-50%,20px);} to {opacity:1; transform:translate(-50%,0);} }
.hidden { display: none; }
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-surface); width: 100%; max-width: 400px;
    border-radius: var(--radius-lg); padding: 24px;
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { color: var(--text-main); }
.modal-body p { color: var(--text-muted); margin-bottom: 8px; font-size: 0.9rem; }