/* Encoder Tool Styles */
#encoder-tool {
    background: transparent;
}

.encoder-container {
    padding: 0;
    max-width: 100%;
}

.encoder-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    border: 1px solid #e0e0e0;
}

.encoder-tab {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    text-align: center;
}

.encoder-tab:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.encoder-tab.active {
    color: #fff;
    background: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.encoder-input-section,
.encoder-output-section {
    margin-bottom: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.encoder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.encoder-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.encoder-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

#encoder-input,
#encoder-output {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s ease;
}

#encoder-input:focus,
#encoder-output:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#encoder-output {
    background: #f5f5f5;
}

.encoder-options {
    margin-top: 15px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.encoding-options label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    cursor: pointer;
}

.encoding-options input[type="checkbox"],
.encoding-options input[type="radio"] {
    margin-right: 8px;
}

.encoder-actions-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.encoder-actions-bar .btn {
    min-width: 130px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.encoder-actions-bar .btn-primary {
    background: #007bff;
    color: #fff;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.encoder-actions-bar .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.encoder-actions-bar .btn-secondary {
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
}

.encoder-actions-bar .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.type-text {
    background: #e7f3ff;
    color: #0066cc;
}

.type-badge.type-json {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-badge.type-url {
    background: #fff3e0;
    color: #e65100;
}

.type-badge.type-base64 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.type-badge.type-urlencoded {
    background: #ffe0b2;
    color: #e65100;
}

.type-badge.type-html {
    background: #ffe0f7;
    color: #c2185b;
}

.type-badge.type-hex {
    background: #e0f2f1;
    color: #00695c;
}

.type-badge.type-jwt {
    background: #fce4ec;
    color: #880e4f;
}

.size-info {
    font-size: 12px;
    color: var(--text-secondary, #666);
    font-family: 'Consolas', 'Monaco', monospace;
}

.json-preview-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
}

.json-preview-section pre {
    margin: 0;
    padding: 15px;
    background: var(--code-bg, #f5f5f5);
    border-radius: 6px;
    overflow-x: auto;
    max-height: 400px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.quick-tools-section {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-tools-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--input-bg, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-tool-btn:hover {
    background: var(--primary-light, #e3f2fd);
    border-color: var(--primary-color, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quick-tool-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.quick-tool-label {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary, #333);
}

.examples-section {
    margin-top: 25px;
}

.examples-section details {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.examples-section summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    color: #007bff;
    font-size: 15px;
}

.examples-section summary:hover {
    color: #0056b3;
}

.examples-content {
    margin-top: 15px;
}

.example-item {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--input-bg, #f8f9fa);
    border-radius: 6px;
}

.example-item h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--primary-color, #007bff);
}

.example-item code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-primary, #333);
}

/* Dark theme support */
[data-theme="dark"] .encoder-mode-tabs {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .encoder-tab {
    color: #a0aec0;
}

[data-theme="dark"] .encoder-tab:hover {
    color: #63b3ed;
    background: rgba(99, 179, 237, 0.1);
}

[data-theme="dark"] .encoder-tab.active {
    color: #fff;
    background: #3182ce;
}

[data-theme="dark"] .encoder-input-section,
[data-theme="dark"] .encoder-output-section {
    background: #1a202c;
    border-color: #2d3748;
}

[data-theme="dark"] .encoder-header {
    border-bottom-color: #2d3748;
}

[data-theme="dark"] .encoder-header h3 {
    color: #e2e8f0;
}

[data-theme="dark"] #encoder-input,
[data-theme="dark"] #encoder-output {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] #encoder-input:focus,
[data-theme="dark"] #encoder-output:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

[data-theme="dark"] .encoder-options {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .json-preview-section {
    background: #1a202c;
    border-color: #2d3748;
}

[data-theme="dark"] .json-preview-section pre {
    background: #2d3748;
    color: #e2e8f0;
}

[data-theme="dark"] .quick-tools-section {
    background: #1a202c;
    border-color: #2d3748;
}

[data-theme="dark"] .quick-tools-section h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .quick-tool-btn {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .quick-tool-btn:hover {
    background: #3d4d61;
    border-color: #3182ce;
}

[data-theme="dark"] .quick-tool-label {
    color: #e2e8f0;
}

[data-theme="dark"] .examples-section details {
    background: #1a202c;
    border-color: #2d3748;
}

[data-theme="dark"] .examples-section summary {
    color: #63b3ed;
}

[data-theme="dark"] .example-item {
    background: #2d3748;
}

[data-theme="dark"] .example-item h4 {
    color: #63b3ed;
}

[data-theme="dark"] .example-item code {
    color: #e2e8f0;
}

[data-theme="dark"] .btn-small {
    background: #2d3748;
    border-color: #4a5568;
    color: #a0aec0;
}

[data-theme="dark"] .btn-small:hover {
    background: #3d4d61;
    border-color: #3182ce;
    color: #63b3ed;
}

[data-theme="dark"] .encoder-actions-bar .btn-primary {
    background: #3182ce;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

[data-theme="dark"] .encoder-actions-bar .btn-primary:hover {
    background: #2c5aa0;
    box-shadow: 0 4px 8px rgba(49, 130, 206, 0.4);
}

[data-theme="dark"] .encoder-actions-bar .btn-secondary {
    background: #2d3748;
    color: #a0aec0;
    border-color: #4a5568;
}

[data-theme="dark"] .encoder-actions-bar .btn-secondary:hover {
    background: #3d4d61;
    border-color: #3182ce;
    color: #63b3ed;
}

/* Responsive */
@media (max-width: 768px) {
    .encoder-mode-tabs {
        flex-wrap: wrap;
    }
    
    .encoder-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .encoder-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .encoder-actions-bar {
        flex-direction: column;
    }
    
    .encoder-actions-bar .btn {
        width: 100%;
    }
    
    .quick-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
