/* ===== Deterioration Curve Page ===== */

.dc-container {
    padding: 20px;
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dc-section {
    background: var(--background-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.dc-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dc-section-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
}

/* ===== FILTERS ===== */
.dc-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.dc-filter-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.dc-filter-group select,
.dc-filter-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--background-dark);
    color: var(--text-primary);
    font-family: 'Vazirmatn', sans-serif;
    transition: border-color 0.2s;
}

.dc-filter-group select:focus,
.dc-filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.dc-asset-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-dark);
}

.dc-asset-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

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

.dc-asset-item:hover {
    background: var(--background-hover);
}

.dc-asset-item.selected {
    background: rgba(14, 165, 233, 0.12);
    border-right: 3px solid var(--primary-color);
}

.dc-asset-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dc-asset-loc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dc-no-result,
.dc-placeholder {
    text-align: center;
    padding: 28px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* ===== CHART + SCENARIO LAYOUT ===== */
.dc-chart-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.dc-scenarios-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dc-scenarios-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Scenario Cards */
.dc-scenario-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--background-hover);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dc-scenario-card:hover {
    border-color: var(--primary-color);
}

.dc-scenario-card.active {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.dc-scenario-card.best {
    border-color: #22c55e;
}

.dc-scenario-card.best.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.dc-scenario-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dc-scenario-radio.checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: inset 0 0 0 3px var(--background-card);
}

.dc-scenario-info {
    flex: 1;
}

.dc-scenario-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dc-scenario-detail {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dc-best-badge {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #22c55e;
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 6px;
}

.dc-best-tag {
    background: #22c55e;
    color: white;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

/* Chart Panel */
.dc-chart-panel {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    position: relative;
}

.dc-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dc-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dc-legend {
    display: flex;
    gap: 16px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.dc-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dc-legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

#dcChart {
    width: 100%;
    display: block;
    border-radius: 8px;
}

/* ===== TABLES ===== */
.dc-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.dc-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    font-size: 0.82rem;
}

.dc-table th {
    background: var(--background-hover);
    padding: 10px 14px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.dc-table td {
    padding: 9px 14px;
    text-align: right;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.dc-table tbody tr:hover {
    background: var(--background-hover);
}

.dc-best-row {
    background: rgba(34, 197, 94, 0.08) !important;
}

.dc-best-row td {
    font-weight: 600;
}

.dc-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
}

.dc-status-dot.green {
    background: #22c55e;
}

.dc-status-dot.lightgreen {
    background: #84cc16;
}

.dc-status-dot.yellow {
    background: #f59e0b;
}

.dc-status-dot.red {
    background: #ef4444;
}

.dc-safe {
    color: #22c55e;
    font-weight: 600;
}

.dc-unsafe {
    color: #ef4444;
    font-weight: 600;
}

/* ===== DECISION ===== */
.dc-decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.dc-decision-item {
    padding: 16px;
    background: var(--background-hover);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.dc-decision-item.highlight {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.08);
}

.dc-decision-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.dc-decision-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dc-decision-value.danger {
    color: #ef4444;
}

.dc-decision-value.safe {
    color: #22c55e;
}

.dc-decision-value.best {
    color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .dc-chart-row {
        grid-template-columns: 1fr;
    }

    .dc-scenarios-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dc-scenario-card {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 600px) {
    .dc-filters {
        grid-template-columns: 1fr 1fr;
    }

    .dc-decision-grid {
        grid-template-columns: 1fr;
    }
}