/* Main Interface */
.debt-analyzer-interface {
    margin-top: 2rem;
}

.analyzer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .analyzer-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel Styles */
.input-panel,
.results-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.language-selector-wrapper {
    position: relative;
}

.language-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: all 0.2s ease;
}

.language-selector:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.language-selector option {
    background: #667eea;
    color: white;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: pulse 2s infinite;
}

.status-indicator.analyzing .status-dot {
    background: #ffd700;
}

.status-indicator.complete .status-dot {
    background: #4ade80;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Editor Container */
.editor-container {
    flex: 1;
    min-height: 600px;
    padding: 1rem;
    background: #f8f9fa;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 600px;
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 767px) {
    .editor-container {
        min-height: 400px;
    }
    
    .code-editor {
        min-height: 400px;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn-primary,
.btn-secondary,
.btn-outline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-icon {
    font-size: 1.125rem;
}

@media (max-width: 767px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        width: 100%;
    }
}

/* Results Container */
.results-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 400px;
    max-height: 600px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.empty-description {
    font-size: 0.9375rem;
    margin: 0;
    color: #6c757d;
}

/* Metrics Overview */
.metrics-overview {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.metric-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.metric-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-excellent {
    background: #d4edda;
    color: #155724;
}

.badge-good {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-moderate {
    background: #fff3cd;
    color: #856404;
}

.badge-poor {
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 767px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: 1.25rem;
    }
    
    .metric-icon {
        font-size: 2rem;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .results-container {
        min-height: 300px;
        max-height: none;
    }
}

/* Issues Section */
.issues-section {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #212529;
}

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.issue-item {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.issue-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.issue-item.high {
    border-left-color: #dc3545;
}

.issue-item.medium {
    border-left-color: #ffc107;
}

.issue-item.low {
    border-left-color: #28a745;
}

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

.issue-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.issue-severity {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.issue-severity.high {
    background: #f8d7da;
    color: #721c24;
}

.issue-severity.medium {
    background: #fff3cd;
    color: #856404;
}

.issue-severity.low {
    background: #d4edda;
    color: #155724;
}

.issue-description {
    font-size: 0.9375rem;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.issue-location {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
    
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 0;
    margin-bottom: 0;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation-item {
    background: linear-gradient(135deg, #e7f3ff 0%, #d6e9f5 100%);
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 4px solid #0066cc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.recommendation-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #004085;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-title::before {
    content: "💡";
    font-size: 1.25rem;
}

.recommendation-text {
    font-size: 0.9375rem;
    color: #004085;
    line-height: 1.6;
    margin: 0;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    min-height: 300px;
}

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

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

.loading-text {
    color: #6c757d;
    font-size: 0.9375rem;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .language-selector-wrapper {
        width: 100%;
    }
    
    .language-selector {
        width: 100%;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}
