/* Duplication Detector Interface */
.duplication-detector-interface {
    margin-bottom: 2rem;
}

/* Detector Layout */
.detector-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-icon {
    font-size: 1.5rem;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

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

.header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Configuration Section */
.config-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-icon {
    font-size: 1rem;
}

.config-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-select:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.config-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Editor Wrapper */
.editor-wrapper {
    flex: 1;
    min-height: 400px;
    position: relative;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

/* Results Summary */
.results-summary {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.summary-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.summary-icon.groups {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-icon.lines {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-icon.ratio {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-icon.ratio.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.summary-icon.ratio.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.summary-details {
    flex: 1;
    min-width: 0;
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.2;
}

.summary-value.ratio-value {
    font-size: 1.75rem;
}

.summary-value.ratio-value.low {
    color: #48bb78;
}

.summary-value.ratio-value.medium {
    color: #ed8936;
}

.summary-value.ratio-value.high {
    color: #f56565;
}

/* Duplicates Container */
.duplicates-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 600px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #a0aec0;
}

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

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.empty-text {
    font-size: 0.9375rem;
    color: #718096;
    margin: 0;
}

/* Duplicate Group */
.duplicate-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.duplicate-group:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.group-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duplicate-instances {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.duplicate-instance {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.instance-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.instance-location {
    color: #667eea;
}

.code-block {
    padding: 1rem;
    background: #2d3748;
    border-radius: 8px;
    overflow-x: auto;
    
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.code-line {
    padding: 0.25rem 0;
    white-space: pre;
}

.refactoring-suggestion {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left: 4px solid #fc8181;
    border-radius: 8px;
}

.suggestion-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #c53030;
    margin-bottom: 0.5rem;
}

.suggestion-text {
    font-size: 0.875rem;
    color: #742a2a;
    margin: 0;
    line-height: 1.6;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.action-btn.secondary {
    background: #ffffff;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.action-btn.secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-text {
    font-weight: 600;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.results-actions .action-btn {
    flex: 1;
    min-width: 140px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .detector-layout {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .config-section {
        grid-template-columns: 1fr;
        padding: 1rem 1.25rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .header-btn .btn-text {
        display: none;
    }

    .header-btn {
        padding: 0.5rem;
        min-width: 40px;
        justify-content: center;
    }

    .action-btn .btn-text {
        display: none;
    }

    .action-btn {
        padding: 0.75rem 1rem;
        min-width: 48px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-item {
        padding: 0.875rem;
    }

    .duplicates-container {
        max-height: 400px;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .action-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .editor-wrapper {
        min-height: 300px;
    }

    .code-editor {
        min-height: 300px;
    }

    .duplicate-group {
        padding: 1rem;
    }

    .group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
