/**
 * Text to Binary Converter Styles
 * Extends main.css with tool-specific styling
 */

.text-to-binary-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-color, #1f2937);
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.05));
}

.tab-btn.active {
    background: var(--bg-color, #ffffff);
    color: var(--primary-color, #3b82f6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark theme tabs */
[data-theme="dark"] .mode-tabs {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .tab-btn {
    color: #94a3b8;
}

[data-theme="dark"] .tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .tab-btn.active {
    background: #334155;
    color: #60a5fa;
}

/* System dark mode preference */
@media (prefers-color-scheme: dark) {
    .mode-tabs {
        background: #1e293b;
        border-color: #334155;
    }

    .tab-btn {
        color: #94a3b8;
    }

    .tab-btn:hover {
        color: #e2e8f0;
        background: rgba(255, 255, 255, 0.05);
    }

    .tab-btn.active {
        background: #334155;
        color: #60a5fa;
    }
}

/* Light theme explicit override */
[data-theme="light"] .mode-tabs {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

[data-theme="light"] .tab-btn {
    color: #6b7280;
}

[data-theme="light"] .tab-btn:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tab-btn.active {
    background: #ffffff;
    color: #3b82f6;
}

/* Converter Body */
.converter-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

.textarea-wrapper {
    position: relative;
}

.text-binary-textarea {
    width: 100%;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-color, #ffffff);
    color: var(--text-color, #1f2937);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-binary-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--primary-color-alpha, rgba(59, 130, 246, 0.1));
}

.text-binary-textarea::placeholder {
    color: var(--text-muted, #9ca3af);
    opacity: 0.6;
}

/* Dark theme textarea */
[data-theme="dark"] .text-binary-textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .text-binary-textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
    .text-binary-textarea {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .text-binary-textarea:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    }
}

/* Light theme explicit */
[data-theme="light"] .text-binary-textarea {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .text-binary-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Options Section */
.options-section {
    padding: 1.25rem;
    background: var(--card-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    margin: 0;
}

.option-label {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    border: none;
    background: transparent;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #3b82f6);
}

.radio-option span {
    font-size: 0.95rem;
    color: var(--text-color, #1f2937);
}

/* Dark theme options */
[data-theme="dark"] .options-section {
    background: #1e293b;
    border-color: #334155;
}

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

[data-theme="dark"] .radio-option span {
    color: #e2e8f0;
}

[data-theme="dark"] .input-label,
[data-theme="dark"] .output-label {
    color: #e2e8f0;
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
    .options-section {
        background: #1e293b;
        border-color: #334155;
    }

    .option-label {
        color: #e2e8f0;
    }

    .radio-option span {
        color: #e2e8f0;
    }

    .input-label,
    .output-label {
        color: #e2e8f0;
    }
}

/* Light theme explicit */
[data-theme="light"] .options-section {
    background: #f8f9fa;
    border-color: #e5e7eb;
}

[data-theme="light"] .option-label {
    color: #1f2937;
}

[data-theme="light"] .radio-option span {
    color: #1f2937;
}

[data-theme="light"] .input-label,
[data-theme="light"] .output-label {
    color: #1f2937;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-convert,
.btn-swap,
.btn-copy,
.btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-convert {
    background: var(--primary-color, #3b82f6);
    color: white;
    flex: 1;
}

.btn-convert:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-swap {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-color, #1f2937);
    border: 2px solid var(--border-color, #e5e7eb);
}

.btn-swap:hover {
    background: var(--bg-tertiary, #e5e7eb);
    border-color: var(--text-muted, #6b7280);
}

.btn-copy {
    background: var(--success-color, #10b981);
    color: white;
    flex: 1;
}

.btn-copy:hover {
    background: var(--success-dark, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-clear {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-color, #1f2937);
    border: 2px solid var(--border-color, #e5e7eb);
}

.btn-clear:hover {
    background: var(--bg-tertiary, #e5e7eb);
    border-color: var(--text-muted, #6b7280);
}

/* Dark theme buttons */
[data-theme="dark"] .btn-swap,
[data-theme="dark"] .btn-clear {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-swap:hover,
[data-theme="dark"] .btn-clear:hover {
    background: #334155;
    border-color: #475569;
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
    .btn-swap,
    .btn-clear {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .btn-swap:hover,
    .btn-clear:hover {
        background: #334155;
        border-color: #475569;
    }
}

/* Light theme explicit */
[data-theme="light"] .btn-swap,
[data-theme="light"] .btn-clear {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .btn-swap:hover,
[data-theme="light"] .btn-clear:hover {
    background: #e5e7eb;
    border-color: #6b7280;
}

/* Output Section */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.output-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--success-color, #10b981);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mode-tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-convert,
    .btn-swap,
    .btn-copy,
    .btn-clear {
        width: 100%;
        justify-content: center;
    }

    .copy-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}
