/* Base64 Encode/Decode - WordPress Plugin Styles */

.b64-container {
    max-width: 640px;
    margin: 0 auto 2rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.75rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    box-sizing: border-box;
}

.b64-header { margin-bottom: 1.25rem; }

.b64-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
    border: none !important;
    display: flex;
    align-items: center;
}

.b64-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0 !important;
}

/* Mode toggle */
.b64-mode-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 1.25rem;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.b64-mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.b64-mode-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Input/output sections */
.b64-input-section,
.b64-output-section { margin-bottom: 1rem; }

.b64-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.b64-label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.b64-char-badge {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.b64-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.b64-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    background: #ffffff;
}

.b64-textarea[readonly] {
    background: #f0f9ff;
    border-color: #bfdbfe;
    color: #1e40af;
    cursor: default;
}

/* File upload */
.b64-file-row { margin-bottom: 1rem; }

.b64-file-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.15s;
}

.b64-file-label:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.b64-file-name {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 10px;
}

/* URL-safe option */
.b64-options-row {
    margin-bottom: 1rem;
}

.b64-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
}

.b64-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.b64-checkbox-label code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    color: #374151;
}

/* Action buttons */
.b64-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.b64-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: transparent;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.b64-btn:hover { background: #f9fafb; }
.b64-btn:active { transform: scale(0.98); }

.b64-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.b64-primary:hover { background: #1d4ed8; }

.b64-danger-btn {
    color: #dc2626;
    border-color: #fca5a5;
}

.b64-danger-btn:hover { background: #fef2f2; }

/* Error box */
.b64-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

/* Arrow divider */
.b64-arrow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 0.25rem;
}

/* Output wrapper with copy button */
.b64-output-wrap { position: relative; }

.b64-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.b64-copy-btn:hover { background: #f3f4f6; }

.b64-copy-btn.copied {
    color: #065f46;
    border-color: #6ee7b7;
    background: #ecfdf5;
}

/* Stats grid */
.b64-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.b64-stat-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.b64-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.b64-stat-lbl {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 480px) {
    .b64-container { padding: 1.25rem; }
    .b64-actions { flex-direction: column; }
    .b64-btn { justify-content: center; }
    .b64-stats-grid { grid-template-columns: 1fr 1fr; }
}
