/* Refactoring Interface Styles */
.refactoring-interface {
    margin-bottom: 2rem;
}

.refactoring-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.section-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 24px;
    line-height: 1;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Language Selector */
.language-selector-wrapper {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.language-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #111827;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Code Input */
.code-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.code-textarea {
    width: 100%;
    flex: 1;
    min-height: 300px;
    padding: 16px;
    
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    resize: vertical;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.code-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.code-textarea::placeholder {
    color: #9ca3af;
}

.input-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.char-count {
    font-size: 12px;
    color: #6b7280;
}

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

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 16px;
    line-height: 1;
}

/* Suggestions Section */
.suggestions-section {
    min-height: 100%;
}

#suggestions-container {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.empty-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    max-width: 300px;
}

/* Loading State */
.loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

/* Suggestions List */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.suggestion-item {
    background: #f9fafb;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: slideIn 0.3s ease;
}

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

.suggestion-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-item.severity-high {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.suggestion-item.severity-medium {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.suggestion-item.severity-low {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-type {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.severity-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.severity-badge.low {
    background: #dbeafe;
    color: #1e40af;
}

.suggestion-message {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.suggestion-code {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    
    font-size: 13px;
    color: #111827;
    overflow-x: auto;
}

.no-suggestions {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.no-suggestions-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.no-suggestions-title {
    font-size: 20px;
    font-weight: 600;
    color: #059669;
    margin: 0 0 8px 0;
}

.no-suggestions-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .refactoring-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-card {
        height: auto;
    }

    .code-textarea {
        min-height: 250px;
    }
}

@media (max-width: 767px) {
    .refactoring-interface {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .card-header {
        padding: 16px 20px;
    }

    .card-title {
        font-size: 18px;
    }

    .card-body {
        padding: 20px;
    }

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

    .btn-primary,
    .btn-secondary {
        width: 100%;
        flex: none;
    }

    .code-textarea {
        min-height: 200px;
        font-size: 13px;
    }

    .suggestion-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .severity-badge {
        align-self: flex-start;
    }

    .empty-icon,
    .no-suggestions-icon {
        font-size: 48px;
    }

    .empty-title,
    .no-suggestions-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 16px;
    }

    .code-textarea {
        padding: 12px;
        font-size: 12px;
    }

    .suggestion-item {
        padding: 12px;
    }

    .suggestion-type {
        font-size: 15px;
    }

    .suggestion-message {
        font-size: 13px;
    }
}
