/* Dashboard Layout */
.metrics-dashboard {
    margin-bottom: 2rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 3fr 4fr;
    gap:1rem;
}

/* Input Panel */
.input-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #111827;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

.input-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.control-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s;
}

.control-select:hover {
    border-color: #9ca3af;
}

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

.editor-container {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.code-editor {
    width: 100%;height: calc(100vh - 264px);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

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

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

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

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

.state-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: #ffffff;
    border-radius: 16px;
    border: 2px dashed #d1d5db;
}

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

.state-placeholder h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.state-placeholder p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    max-width: 400px;
}

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

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

/* Score Card */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

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

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

.score-badge {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.score-label {
    font-size: 1rem;
    opacity: 0.8;
}

.score-visualization {
    display: flex;
    justify-content: center;
}

.score-ring {
    position: relative;
    width: 160px;
    height: 160px;
}

.score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 12;
}

.score-progress {
    fill: none;
    stroke: #ffffff;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease-out;
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-grade {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

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

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Indicators Section */
.indicators-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .indicators-section {
        flex-direction: row;
    }
}

.indicator-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    flex: 1;
}

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

.indicator-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.indicator-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.indicator-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.indicator-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out, background-color 0.3s;
    width: 0%;
}

.indicator-fill.success {
    background: #10b981;
}

.indicator-fill.warning {
    background: #f59e0b;
}

.indicator-fill.danger {
    background: #ef4444;
}

.indicator-status {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Chart Card */
.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Issues Card */
.issues-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

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

.issues-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.issues-count {
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.issue-item {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f9fafb;
    transition: all 0.2s;
}

.issue-item:hover {
    background: #f3f4f6;
}

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

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

.issue-item.low {
    border-left-color: #10b981;
}

.issue-item.info {
    border-left-color: #3b82f6;
}

.issue-type {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.issue-severity {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

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

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

.issue-severity.low {
    background: #d1fae5;
    color: #065f46;
}

.issue-message {
    color: #374151;
    font-size: 0.9375rem;
    margin: 0.5rem 0 0 0;
}

.issue-line {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.no-issues {
    text-align: center;
    padding: 2rem;
    color: #10b981;
}

.no-issues-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Table Card */
.table-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.table-header {
    margin-bottom: 1.5rem;
}

.table-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.table-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.table-container {
    overflow-x: auto;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
}

.metrics-table thead {
    background: #f9fafb;
}

.metrics-table th {
    padding: 0.875rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.metrics-table td {
    padding: 0.875rem;
    font-size: 0.9375rem;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.metrics-table tbody tr:hover {
    background: #f9fafb;
}

.metrics-table .rating-good {
    color: #10b981;
    font-weight: 600;
}

.metrics-table .rating-fair {
    color: #f59e0b;
    font-weight: 600;
}

.metrics-table .rating-poor {
    color: #ef4444;
    font-weight: 600;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .input-panel {
        padding: 1.25rem;
    }

    .score-card {
        padding: 1.5rem;
    }

    .score-ring {
        width: 120px;
        height: 120px;
    }

    .score-number {
        font-size: 2rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }

    .metrics-table {
        font-size: 0.875rem;
    }

    .metrics-table th,
    .metrics-table td {
        padding: 0.625rem;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .input-panel,
    .state-placeholder,
    .metric-card,
    .indicator-card,
    .chart-card,
    .issues-card,
    .table-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .panel-header h2,
    .indicator-header h3,
    .chart-header h3,
    .issues-header h3,
    .table-header h3,
    .metric-value {
        color: #f9fafb;
    }

    .control-select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .issue-item {
        background: #374151;
    }
}
