/* Replacement Timing Calculator Specific Styles */

/* Timing Analysis Display */
.timing-analysis {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    border: 2px solid #10b981;
}

.timing-header {
    text-align: center;
    margin-bottom: 20px;
}

.timing-title {
    font-size: 20px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 8px;
}

.timing-subtitle {
    font-size: 14px;
    color: #064e3b;
}

.timing-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.timing-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
}

.timing-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.timing-card.immediate {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.timing-card.soon {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fefbf3, #fef3c7);
}

.timing-card.optimal {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.timing-card.flexible {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.condition-checklist {
    margin-top: 20px;
}

.condition-checklist h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.issue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.issue-item:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.issue-item input[type="checkbox"] {
    display: none;
}

.issue-item input[type="checkbox"]:checked + .checkmark {
    background: #ef4444;
    border-color: #ef4444;
}

.issue-item input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.issue-item:has(input[type="checkbox"]:checked) {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.issue-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.issue-item .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.issue-details {
    flex: 1;
}

.issue-details strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.issue-details span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.timing-overview {
    margin-bottom: 32px;
}

.timing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.timing-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.timing-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.timing-card.immediate {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.timing-card.soon {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.timing-card.planned {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.timing-card.maintain {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.timing-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timing-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.timing-card.immediate .timing-value {
    color: #dc2626;
}

.timing-card.soon .timing-value {
    color: #d97706;
}

.timing-card.planned .timing-value {
    color: #2563eb;
}

.timing-card.maintain .timing-value {
    color: #059669;
}

.timing-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.condition-analysis {
    margin: 32px 0;
}

.condition-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.condition-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.condition-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.condition-card.excellent {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.condition-card.good {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.condition-card.fair {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.condition-card.poor {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.condition-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.condition-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.condition-card.excellent .condition-icon {
    background: #10b981;
}

.condition-card.good .condition-icon {
    background: #2563eb;
}

.condition-card.fair .condition-icon {
    background: #f59e0b;
}

.condition-card.poor .condition-icon {
    background: #ef4444;
}

.condition-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.condition-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.condition-card.excellent .condition-score {
    color: #065f46;
}

.condition-card.good .condition-score {
    color: #1e40af;
}

.condition-card.fair .condition-score {
    color: #92400e;
}

.condition-card.poor .condition-score {
    color: #dc2626;
}

.condition-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.economic-analysis {
    margin: 32px 0;
}

.economic-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.economic-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.economic-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.economic-card.positive {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.economic-card.neutral {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.economic-card.negative {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.economic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.economic-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.economic-card.positive .economic-icon {
    background: #10b981;
}

.economic-card.neutral .economic-icon {
    background: #f59e0b;
}

.economic-card.negative .economic-icon {
    background: #ef4444;
}

.economic-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.economic-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.economic-card.positive .economic-value {
    color: #065f46;
}

.economic-card.neutral .economic-value {
    color: #92400e;
}

.economic-card.negative .economic-value {
    color: #dc2626;
}

.economic-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.timing-recommendations {
    margin: 32px 0;
}

.strategy-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.strategy-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.strategy-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.strategy-item.immediate {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.strategy-item.soon {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.strategy-item.planned {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.strategy-item.maintain {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.strategy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.strategy-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-item.immediate .strategy-priority {
    background: #ef4444;
    color: white;
}

.strategy-item.soon .strategy-priority {
    background: #f59e0b;
    color: white;
}

.strategy-item.planned .strategy-priority {
    background: #2563eb;
    color: white;
}

.strategy-item.maintain .strategy-priority {
    background: #10b981;
    color: white;
}

.strategy-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.strategy-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.strategy-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.strategy-action {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.strategy-action:hover {
    background: #e2e8f0;
    border-color: #2563eb;
    color: #2563eb;
}

.timeline-chart {
    margin: 32px 0;
}

.timeline-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-top: 16px;
}

.timeline-bar {
    height: 60px;
    background: linear-gradient(90deg, #10b981 0% 30%, #f59e0b 30% 70%, #ef4444 70% 100%);
    border-radius: 8px;
    position: relative;
    margin: 20px 0;
}

.timeline-marker {
    position: absolute;
    top: -10px;
    width: 4px;
    height: 80px;
    background: #2563eb;
    border-radius: 2px;
    transition: left 0.8s ease;
}

.timeline-marker::after {
    content: "Current";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 12px;
    color: #64748b;
}

.timing-guidelines {
    space-y: 12px;
}

.guideline-item {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
}

.guideline-item.immediate {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #ef4444;
}

.guideline-item.soon {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.guideline-item.planned {
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
    border-color: #2563eb;
}

.guideline-item.maintain {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-color: #10b981;
}

.guideline-item strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.guideline-item span {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.guideline-item.immediate span {
    color: #dc2626;
}

.guideline-item.soon span {
    color: #d97706;
}

.guideline-item.planned span {
    color: #2563eb;
}

.guideline-item.maintain span {
    color: #059669;
}

.guideline-item small {
    color: #64748b;
    font-size: 12px;
}

.lifespan-types {
    space-y: 12px;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.type-name {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.type-lifespan {
    font-weight: 600;
    color: #2563eb;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .issue-grid {
        grid-template-columns: 1fr;
    }
    
    .timing-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .condition-breakdown {
        grid-template-columns: 1fr;
    }
    
    .economic-factors {
        grid-template-columns: 1fr;
    }
    
    .timeline-labels {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .timing-summary {
        grid-template-columns: 1fr;
    }
    
    .strategy-actions {
        flex-direction: column;
    }
    
    .type-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Animation for timing reveal */
@keyframes timingReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.timing-card.animate {
    animation: timingReveal 0.6s ease-out;
}

/* Loading states */
.timeline-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.timeline-container.loading::after {
    content: "Calculating optimal timing...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
