/* ============================================================
   base64-encoder / style.css
   Prefix: b64-
   ============================================================ */

.b64-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Section Cards --- */
.b64-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border: 1px solid #eee;
    margin-bottom: 16px;
}

.b64-section-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e36209;
}

/* --- Mode Tabs --- */
.b64-mode-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 16px;
}

.b64-mode-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #888;
    transition: all 0.15s;
    margin-bottom: -2px;
    white-space: nowrap;
}

.b64-mode-tab:hover {
    color: #e36209;
}

.b64-mode-tab.active {
    color: #e36209;
    border-bottom-color: #e36209;
}

/* --- Mode Panels --- */
.b64-mode-panel {
    display: none;
}

.b64-mode-panel.active {
    display: block;
}

/* --- Textarea --- */
.b64-textarea {
    width: 100%;
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 10px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
    color: #222;
    background: #fff;
    tab-size: 4;
    height: 120px;
}

.b64-textarea:focus {
    border-color: #e36209;
    outline: none;
    box-shadow: 0 0 0 3px rgba(227, 98, 9, 0.1);
}

.b64-textarea.readonly {
    background: #fafafa;
    color: #333;
    cursor: default;
}

/* --- Textarea wrap with copy button --- */
.b64-ta-wrap {
    position: relative;
}

.b64-copy-corner {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    z-index: 2;
}

.b64-copy-corner:hover {
    border-color: #e36209;
    color: #e36209;
}

/* --- Options row --- */
.b64-options-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px 0;
}

.b64-option-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px solid #ddd;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    color: #555;
}

.b64-option-label:hover {
    border-color: #e36209;
    color: #e36209;
}

.b64-option-label:has(input:checked) {
    border-color: #e36209;
    background: #fff5f0;
    color: #c05000;
}

.b64-option-label input[type="checkbox"] {
    accent-color: #e36209;
    width: 13px;
    height: 13px;
}

/* --- Direction toggle --- */
.b64-dir-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
}

.b64-dir-label {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 12px;
}

.b64-toggle-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    background: #fff;
    border: 1.5px solid #e36209;
    border-radius: 20px;
    cursor: pointer;
    color: #e36209;
    transition: all 0.15s;
}

.b64-toggle-btn:hover {
    background: #fff5f0;
}

/* --- Size info bar --- */
.b64-size-bar {
    font-size: 12px;
    color: #666;
    padding: 6px 10px;
    background: #f8f8f8;
    border-radius: 5px;
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.b64-size-increase {
    color: #cb2431;
    font-weight: 700;
}

/* --- Error --- */
.b64-error {
    display: none;
    color: #cb2431;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    background: #fff5f5;
    border: 1px solid #fdb8c0;
    border-radius: 4px;
    margin-top: 6px;
}

.b64-error.visible {
    display: block;
}

/* --- Drop zone --- */
.b64-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
    background: #fafafa;
}

.b64-drop-zone:hover,
.b64-drop-zone.drag-over {
    border-color: #e36209;
    background: #fff5f0;
    color: #e36209;
}

.b64-drop-zone-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.b64-drop-zone-text {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.b64-drop-zone-sub {
    font-size: 12px;
    opacity: 0.7;
}

.b64-file-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 18px;
    font-size: 12px;
    font-weight: 700;
    background: #e36209;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.b64-file-btn:hover {
    background: #c05000;
}

/* --- File info --- */
.b64-file-info {
    display: none;
    padding: 10px 12px;
    background: #f0f7ff;
    border: 1px solid #c0d8f5;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
}

.b64-file-info.visible {
    display: block;
}

.b64-file-name {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.b64-file-meta {
    color: #666;
    font-size: 11px;
}

/* --- Image preview --- */
.b64-img-preview {
    display: none;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-top: 10px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

.b64-img-preview.visible {
    display: block;
}

/* --- Snippet buttons --- */
.b64-snippet-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.b64-snip-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
    white-space: nowrap;
}

.b64-snip-btn:hover {
    border-color: #e36209;
    color: #e36209;
    background: #fff5f0;
}

/* --- Section divider --- */
.b64-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 16px 0;
}

/* --- Download section --- */
.b64-dl-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.b64-dl-input {
    flex: 1;
    min-width: 120px;
    padding: 7px 10px;
    font-size: 13px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.2s;
}

.b64-dl-input:focus {
    border-color: #e36209;
    outline: none;
}

.b64-dl-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    background: #e36209;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.b64-dl-btn:hover {
    background: #c05000;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .b64-mode-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .b64-snippet-btns {
        gap: 4px;
    }

    .b64-snip-btn {
        font-size: 11px;
        padding: 5px 8px;
    }

    .b64-dl-row {
        flex-direction: column;
        align-items: stretch;
    }

    .b64-dl-btn {
        text-align: center;
    }
}