/* Bundle Savings Calculator Specific Styles */

.bundle-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

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

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

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

.item-header {
    margin-bottom: 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

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

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.item-details {
    transition: all 0.3s ease;
    overflow: hidden;
}

.item-details.show {
    display: block !important;
}

.item-details .form-group {
    margin-bottom: 12px;
}

.item-details .form-group:last-child {
    margin-bottom: 0;
}

.item-details label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
    display: block;
}

.savings-percentage {
    text-align: center;
    margin-top: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.savings-percentage.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.comparison-breakdown {
    margin: 24px 0;
}

.comparison-table {
    overflow-x: auto;
    margin-top: 16px;
}

.comparison-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.comparison-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.comparison-table tr:nth-child(even) {
    background: #f8fafc;
}

.comparison-table .item-name {
    font-weight: 500;
    color: #1e293b;
}

.comparison-table .price {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

.comparison-table .individual-price {
    color: #64748b;
}

.comparison-table .bundle-price {
    color: #2563eb;
}

.comparison-table .savings {
    color: #10b981;
    font-weight: 600;
}

.comparison-table .savings.negative {
    color: #ef4444;
}

.comparison-table .total-row {
    background: #2563eb !important;
    color: white;
    font-weight: 600;
}

.comparison-table .total-row td {
    border-bottom: none;
}

.value-analysis {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

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

.value-metric {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.metric-value.positive {
    color: #10b981;
}

.metric-value.negative {
    color: #ef4444;
}

.metric-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.recommendations {
    margin: 24px 0;
}

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

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

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

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

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

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

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

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

.recommendation-card.positive .recommendation-icon {
    background: #10b981;
    color: white;
}

.recommendation-card.negative .recommendation-icon {
    background: #ef4444;
    color: white;
}

.recommendation-card.neutral .recommendation-icon {
    background: #f59e0b;
    color: white;
}

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

.recommendation-description {
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.bundle-tips {
    space-y: 16px;
}

.tip-item {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
}

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

.tip-item p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.bundle-items-list {
    space-y: 12px;
}

.bundle-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.category-name {
    font-weight: 600;
    color: #2563eb;
    font-size: 13px;
}

.category-items {
    color: #64748b;
    font-size: 12px;
}

/* Primary result styling */
.primary-result .result-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.primary-result .result-value.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bundle-items-grid {
        grid-template-columns: 1fr;
    }
    
    .value-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recommendation-cards {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 14px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .value-metrics {
        grid-template-columns: 1fr;
    }
    
    .bundle-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

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

.primary-result.animate .result-value {
    animation: savingsReveal 0.6s ease-out;
}

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

.comparison-table.loading::after {
    content: "Calculating savings...";
    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;
}
