/* Coverage Analyzer Styles */
.coverage-analyzer {
    margin-bottom: 2rem;
}

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

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

/* Panel Styles */
.input-panel,
.results-panel {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--panel-header-bg, #f9fafb);
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-icon {
    color: var(--primary-color, #3b82f6);
    flex-shrink: 0;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #111827);
}

.panel-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* Format Selector */
.format-selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #111827);
}

.format-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg, #ffffff);
    color: var(--text-primary, #111827);
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-select:hover {
    border-color: var(--primary-color, #3b82f6);
}

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

/* Editor Container */
.editor-container {
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    background: var(--editor-bg, #ffffff);
}

.coverage-editor {
    width: 100%;
    height: 400px;
}

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

/* Thresholds Section */
.thresholds-section {
    padding: 20px;
    background: var(--section-bg, #f9fafb);
    border-radius: 8px;
}

.thresholds-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary, #111827);
}

.thresholds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.threshold-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threshold-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
}

.threshold-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.threshold-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg, #ffffff);
    color: var(--text-primary, #111827);
    transition: all 0.2s ease;
}

.threshold-input:hover {
    border-color: var(--primary-color, #3b82f6);
}

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

.threshold-unit {
    position: absolute;
    right: 14px;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
    pointer-events: none;
}

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

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

.btn-primary {
    background: var(--primary-color, #3b82f6);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

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

.btn-secondary:hover {
    background: var(--secondary-hover, #e5e7eb);
    border-color: var(--border-hover, #9ca3af);
}

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

/* Results Panel */
.results-content {
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 400px;
}

.empty-icon {
    color: var(--text-muted, #9ca3af);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    margin: 0;
}

/* Results Display */
.summary-card {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6) 0%, var(--primary-dark, #2563eb) 100%);
    border-radius: 12px;
    padding: 24px;
    color: #ffffff;
    margin-bottom: 24px;
}

.summary-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

.metric-item {
    text-align: center;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1;
}

.metric-label {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.summary-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    opacity: 0.9;
}

/* Issues Section */
.issues-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-card {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.issue-high {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.issue-medium {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.issue-type {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 8px 0;
    color: var(--text-primary, #111827);
}

.issue-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

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

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

.issue-message {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* Files Section */
.files-section {
    margin-bottom: 24px;
}

.files-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
}

.file-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--hover-bg, #f9fafb);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--text-primary, #111827);
    word-break: break-word;
}

.file-path {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin: 0;
    word-break: break-all;
}

.file-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: 16px;
}

.coverage-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

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

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

.file-lines {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
}

/* Recommendations Section */
.recommendations-section {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 20px;
}

.recommendations-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendations-list {
    margin: 0;
    padding-left: 20px;
}

.recommendations-list li {
    font-size: 14px;
    color: var(--text-secondary, #4b5563);
    margin-bottom: 8px;
    line-height: 1.5;
}

.recommendations-list li:last-child {
    margin-bottom: 0;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #3b82f6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}

/* Scrollbar Styling */
.files-list::-webkit-scrollbar {
    width: 8px;
}

.files-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f1f1);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #c1c1c1);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #a8a8a8);
}
