/**
 * 📈 Price History CSS - NexaWeb
 * ===============================
 */

/* Price History Section on product page */
.price-history-section {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.price-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.price-history-header h3 {
    font-size: 1rem;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-history-header h3 i {
    color: #667eea;
}

.price-history-tabs {
    display: flex;
    gap: 6px;
}

.price-history-tabs button {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.price-history-tabs button:hover {
    border-color: #667eea;
    color: #667eea;
}

.price-history-tabs button.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Stats Cards */
.price-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.price-stat-card {
    background: #f9fafb;
    padding: 12px 10px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.2s ease;
}

.price-stat-card:hover {
    transform: translateY(-2px);
}

.price-stat-card.lowest {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.price-stat-card.highest {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.price-stat-card.current {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.price-stat-label {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.price-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.price-stat-card.lowest .price-stat-value {
    color: #059669;
}

.price-stat-card.highest .price-stat-value {
    color: #dc2626;
}

.price-stat-card.current .price-stat-value {
    color: #2563eb;
}

/* Chart Container */
.price-chart-container {
    position: relative;
    height: 180px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.price-chart-container canvas {
    max-height: 100%;
    width: 100% !important;
}

/* Recommendation Badge */
.price-recommendation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: 500;
    margin-top: auto; /* Push to bottom of flex container */
}

.price-recommendation.best_price {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.price-recommendation.good_price {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.price-recommendation.wait {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.price-recommendation i {
    font-size: 1.2rem;
}

.price-recommendation-text {
    flex: 1;
}

.price-recommendation-text strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.price-recommendation-text span {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Price Change Indicator */
.price-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.price-change.up {
    background: #fee2e2;
    color: #dc2626;
}

.price-change.down {
    background: #d1fae5;
    color: #059669;
}

.price-change.stable {
    background: #f3f4f6;
    color: #6b7280;
}

/* Loading State */
.price-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6b7280;
}

.price-history-loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

/* No Data State */
.price-history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.price-history-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 15px;
}

.price-history-empty p {
    margin: 0;
}

/* Alert Button in Price History */
.price-alert-prompt {
    margin-top: 15px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.price-alert-prompt p {
    margin: 0;
    color: #374151;
    font-size: 0.8rem;
}

.price-alert-prompt button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-alert-prompt button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .price-history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .price-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .price-chart-container {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .price-history-section {
        padding: 15px;
    }
    
    .price-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .price-stat-card {
        padding: 10px 8px;
    }
    
    .price-stat-value {
        font-size: 0.9rem;
    }
    
    .price-stat-label {
        font-size: 0.6rem;
    }
}
