/* Base64.css - Scope all styles under .b64-app to prevent side effects on other pages */

.b64-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    max-width: 900px;
    margin: 10px auto 30px auto;
    padding: 0 10px;
}

.b64-app * {
    box-sizing: border-box;
}

/* Header Banner */
.b64-app .b64-header {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.25);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.b64-app .b64-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.b64-app .b64-header-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 4px 0 0 0;
}

/* Main Card */
.b64-app .b64-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
    margin-bottom: 24px;
}

/* Controls */
.b64-app .b64-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.b64-app .b64-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.b64-app .b64-control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.b64-app .b64-radio-group {
    display: flex;
    gap: 8px;
}

.b64-app .b64-radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.b64-app .b64-radio-group label {
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b64-app .b64-radio-group label:hover {
    border-color: #ec4899;
    color: #ec4899;
}

.b64-app .b64-radio-group input[type="radio"]:checked + label {
    background: #ec4899;
    border-color: #ec4899;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
}

/* Textarea Workspace */
.b64-app .b64-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .b64-app .b64-workspace {
        grid-template-columns: 1fr;
    }
}

.b64-app .b64-panel {
    display: flex;
    flex-direction: column;
}

.b64-app .b64-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.b64-app .b64-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
}

.b64-app .b64-panel-counter {
    font-size: 0.775rem;
    color: #a0aec0;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 12px;
}

.b64-app .b64-textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.925rem;
    line-height: 1.6;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.b64-app .b64-textarea:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.b64-app .b64-textarea.error {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.b64-app .b64-error-msg {
    font-size: 0.8rem;
    color: #e53e3e;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

.b64-app .b64-error-msg.show {
    display: block;
}

/* Toolbar Actions */
.b64-app .b64-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.b64-app .b64-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.b64-app .b64-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b64-app .b64-btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.b64-app .b64-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

.b64-app .b64-btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.b64-app .b64-btn-secondary:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.b64-app .b64-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.b64-app .b64-btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

/* Related Tools Card */
.b64-app .b64-related-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
}

.b64-app .b64-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.b64-app .b64-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.b64-app .b64-related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.b64-app .b64-related-item:hover {
    border-color: #ec4899;
    color: #ec4899;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1);
}

/* Toast notification */
.b64-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d3748;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.b64-toast.show {
    opacity: 1;
    transform: translateY(0);
}
