/* text-to-binary.css */

/* Main converter styles */
.converter-section {
    margin: 2rem 0;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.textarea-mono {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    background-color: var(--bg-secondary, #f8f9fa);
}

.textarea-mono:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.control-options {
    margin: 1rem 0;
    padding: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color, #007bff);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.btn-primary.suggested {
    background-color: var(--accent-color, #28a745);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.btn-secondary {
    background-color: var(--secondary-color, #6c757d);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark, #545b62);
    transform: translateY(-2px);
}

.btn-secondary.copied {
    background-color: var(--success-color, #28a745);
}

/* Results section */
.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    background-color: var(--bg-secondary, #f8f9fa);
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #ddd);
}

.result-header h3 {
    margin: 0;
    color: var(--text-primary, #333);
}

.result-info {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

.result-output {
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    background-color: var(--bg-primary, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.code-text {
    color: var(--text-primary, #333);
    tab-size: 4;
}

/* Error messages */
.error-message {
    color: var(--error-color, #dc3545);
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--error-color, #dc3545);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 4px;
    display: none;
    font-size: 0.95rem;
}

/* Warning box */
.warning-box {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color, #ffc107);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    color: var(--text-primary, #333);
}

.warning-box strong {
    color: var(--warning-color, #856404);
}

/* Unit definitions */
.unit-definition {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color, #eee);
}

.unit-definition:last-child {
    border-bottom: none;
}

.unit-definition h3 {
    color: var(--text-primary, #333);
    margin-bottom: 1rem;
}

.unit-definition p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary, #555);
}

.unit-definition strong {
    color: var(--text-primary, #333);
}

/* Quick reference */
.quick-reference {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
}

.quick-reference h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.ref-section {
    padding: 1rem;
    background-color: var(--bg-primary, white);
    border-radius: 6px;
    border: 1px solid var(--border-color, #ddd);
}

.ref-section p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.code-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.code-list li {
    padding: 0.25rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    border-bottom: 1px dashed var(--border-color, #eee);
}

.code-list li:last-child {
    border-bottom: none;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .textarea-mono {
        font-size: 0.9rem;
    }
    
    .result-output {
        font-size: 0.9rem;
    }
}