/* Converter Wrapper */
.converter-wrapper {
    margin-bottom: 3rem;
}

.converter-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    min-height: 600px;
}

/* Input Panel */
.input-panel,
.output-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
}

.output-panel {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.5;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.textarea-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.code-editor {
    flex: 1;
    width: 100%;
    padding: 1.25rem;
    border: none;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background: #ffffff;
    color: #111827;
    outline: none;
    overflow-y: auto;
    min-height: 500px;
}

.code-editor:focus {
    background: #fafafa;
}

.code-editor-output {
    background: #f9fafb;
    color: #374151;
}

.code-editor::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
    background: #f9fafb;
    min-width: 140px;
    gap: 1rem;
}

.convert-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    min-height: 44px;
}

.convert-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.convert-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loader {
    display: none;
    animation: spin 1s linear infinite;
}

.convert-btn.loading .btn-content {
    display: none;
}

.convert-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.controls-divider {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.action-btn:active {
    background: #e5e7eb;
}

.action-btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.action-btn svg {
    flex-shrink: 0;
}

/* Error Alert */
.error-alert {
    display: none;
    padding: 0.75rem 1rem;
    margin: 0.75rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.error-alert.show {
    display: block;
}

.code-editor.error {
    border-left: 3px solid #ef4444;
    padding-left: calc(1.25rem - 3px);
}

/* Success State */
.action-btn.success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.convert-btn.success {
    background: #10b981;
}

/* Info Section */
.info-section {
    margin-top: 3rem;
    padding: 2.5rem 0;
}

.info-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.info-content > p {
    font-size: 1.0625rem;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 800px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: 10px;
    color: #2563eb;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.feature-item p {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        order: -1;
        flex-direction: row;
        justify-content: center;
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
        min-width: auto;
    }
    
    .convert-btn {
        width: auto;
        min-width: 140px;
    }
    
    .input-panel,
    .output-panel {
        border-right: none;
        border-left: none;
    }
    
    .output-panel {
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 768px) {
    .converter-card {
        border-radius: 12px;
    }
    
    .panel-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .panel-title {
        font-size: 0.9375rem;
    }
    
    .code-editor {
        padding: 1rem;
        font-size: 13px;
        min-height: 350px;
    }
    
    .controls-panel {
        flex-wrap: wrap;
    }
    
    .convert-btn {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        min-width: 0;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .info-section {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
    
    .info-content h2 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-item {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .code-editor {
        min-height: 300px;
        font-size: 12px;
    }
    
    .panel-header {
        padding: 0.75rem;
    }
    
    .panel-title-group {
        gap: 0.5rem;
    }
    
    .panel-icon {
        width: 28px;
        height: 28px;
    }
    
    .action-btn-sm {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .converter-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .panel-header {
        background: #111827;
        border-color: #374151;
    }
    
    .code-editor {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .code-editor-output {
        background: #111827;
        color: #d1d5db;
    }
    
    .controls-panel {
        background: #111827;
        border-color: #374151;
    }
    
    .panel-title {
        color: #f9fafb;
    }
    
    .action-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .action-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
        color: #f9fafb;
    }
}
