/* String Encoder/Decoder Styles */
.encoder-decoder-app {
    display: grid;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

#text-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: var(--input-bg);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s ease;
}

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

#text-input::placeholder {
    color: var(--text-secondary);
}

.input-info {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-info span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.input-info span span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Methods Section */
.methods-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.methods-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.method-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.2s ease;
}

.method-card:hover {
    border-color: var(--primary-color);
}

.method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.method-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.method-actions {
    display: flex;
    gap: 0.5rem;
}

.method-result {
    min-height: 60px;
    padding: 0.75rem;
    background: var(--code-bg, #f8f9fa);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-all;
    white-space: pre-wrap;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.method-result:hover {
    background: var(--hover-bg);
}

.method-result:empty::before {
    content: 'Result will appear here...';
    color: var(--text-secondary);
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.method-result.has-content {
    background: var(--success-bg, #f0f9ff);
    border-color: var(--success-border, #0ea5e9);
}

.method-result.error {
    background: var(--error-bg, #fef2f2);
    border-color: var(--error-border, #ef4444);
    color: var(--error-text, #dc2626);
}

/* Copy indicator */
.method-result::after {
    content: 'Click to copy';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.method-result:hover::after {
    opacity: 0.8;
}

.method-result.copied::after {
    content: 'Copied!';
    background: var(--success-color, #10b981);
    opacity: 1;
}

/* Batch Section */
.batch-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.batch-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.batch-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:active {
    transform: translateY(0);
}

/* Message */
.message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    opacity: 1;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    opacity: 1;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    opacity: 1;
}

/* Loading state */
.method-card.loading .method-result {
    position: relative;
    overflow: hidden;
}

.method-card.loading .method-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .message.success {
        background: #064e3b;
        color: #a7f3d0;
        border-color: #065f46;
    }
    
    .message.error {
        background: #7f1d1d;
        color: #fca5a5;
        border-color: #991b1b;
    }
    
    .message.info {
        background: #1e3a8a;
        color: #93c5fd;
        border-color: #1e40af;
    }
    
    .method-result.has-content {
        background: #0c4a6e;
        border-color: #0284c7;
    }
    
    .method-result.error {
        background: #7f1d1d;
        border-color: #dc2626;
        color: #fca5a5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .encoder-decoder-app {
        gap: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .input-actions {
        justify-content: center;
    }
    
    .methods-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .method-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .method-actions {
        justify-content: center;
    }
    
    .batch-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .input-info {
        justify-content: center;
    }
    
    #text-input {
        min-height: 100px;
        font-size: 13px;
    }
    
    .method-result {
        font-size: 12px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .input-section,
    .methods-section,
    .batch-section {
        padding: 1rem;
    }
    
    .method-card {
        padding: 0.75rem;
    }
    
    .method-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    .method-result::after {
        display: none;
    }
}