/* Monitor Page Styles - Premium UI */

/* Collapsible section styling */
.transition-transform {
    transition: transform 0.2s ease;
}

[data-bs-toggle="collapse"][aria-expanded="false"] .transition-transform {
    transform: rotate(-90deg);
}

[data-bs-toggle="collapse"]:hover {
    background-color: rgba(0,0,0,0.02) !important;
}

/* Color Variables to match branding */
:root {
    --primary-color: #266bc2; /* Link Blue */
    --secondary-color: #03193b; /* Dark Blue */
    --success-color: #02a189; /* OK Green */
    --danger-color: #f63838; /* Alert Red */
    --warning-color: #ebf20e; /* Highlight Green */
    --font-family: 'Archivo', sans-serif;
}

/* Base styling */
body {
    font-family: var(--font-family);
}

/* Card styling */
.card {
    border-radius: 0.75rem;
    border: none;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Metric cards styling */
.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-soft-primary {
    background-color: rgba(38, 107, 194, 0.15);  /* Link Blue */
    color: var(--primary-color);
}

.bg-soft-success {
    background-color: rgba(2, 161, 137, 0.15);  /* OK Green */
    color: var(--success-color);
}

.bg-soft-danger {
    background-color: rgba(246, 56, 56, 0.15);  /* Alert Red */
    color: var(--danger-color);
}

.bg-soft-info {
    background-color: rgba(235, 242, 14, 0.15);  /* Highlight Green */
    color: var(--warning-color);
}

/* Timeline styling */
.timeline-container {
    position: relative;
    overflow: hidden;
}

.timeline {
    position: relative;
    padding: 1.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 3rem;
    border-left: 2px solid #e9ecef;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -8px;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c757d;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-marker.new-product {
    background: #28a745;
}

.timeline-marker.price-change {
    background: #007bff;
}

.timeline-marker.stock-change,
.timeline-marker.product-removed {
    background: #dc3545;
}

.timeline-marker.discount-change,
.timeline-marker.sale-change {
    background: #fd7e14;
}

.timeline-marker.status-change,
.timeline-marker.generic-change {
    background: #6f42c1;
}

.timeline-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-date {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.change-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.change-icon.new-product {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.change-icon.price-change {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.change-icon.stock-change {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.change-icon.product-removed {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.change-icon.discount-change,
.change-icon.sale-change {
    background: linear-gradient(135deg, #fd7e14, #e8690b);
}

.change-icon.status-change,
.change-icon.generic-change {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
}

.change-details {
    line-height: 1.5;
}

.change-details strong {
    color: #495057;
}

/* Price styling */
.old-price {
    text-decoration: line-through;
    color: #6c757d;
    font-weight: 500;
}

.new-price {
    font-weight: 600;
    color: #495057;
}

.new-price.price-up {
    color: #dc3545;
}

.new-price.price-down {
    color: #28a745;
}

/* Discount styling */
.old-discount,
.new-discount {
    font-weight: 600;
    color: #fd7e14;
}

/* Badge enhancements */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Store monitoring table styling */
#monitoring-stores td {
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline {
        padding: 1rem;
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .store-config-card {
        margin-bottom: 1rem;
    }
    
    .run-now-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    .change-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        margin-right: 0.5rem;
    }
    
    .timeline-body h6 {
        font-size: 0.9rem;
    }
    
    .timeline-body p {
        font-size: 0.8rem;
    }
    
    .config-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .config-value {
        margin-top: 0.25rem;
        margin-left: 0;
    }
    
    .timeline-item {
        padding-left: 2.5rem;
    }
    
    .change-icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .timeline-content {
        padding: 0.75rem;
    }
    
    .change-details {
        font-size: 0.875rem;
    }
}

/* Log container styling */
.log-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

/* Empty timeline message */
.empty-timeline {
    padding: 2rem;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Animation for timeline items */
.timeline-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Store monitoring status styles */
#auto-monitor-status.active {
    background-color: var(--success-color);
    color: white;
}

#auto-monitor-status.inactive {
    background-color: #6c757d;
    color: white;
}

#next-check-time {
    font-weight: 600;
    color: var(--primary-color);
}

/* Filter section styling */
.form-select-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    padding-right: 1.75rem;
}

/* Store action buttons */
.store-actions {
    display: flex;
    gap: 0.5rem;
}

/* Table hover styles */
.table-hover tbody tr:hover {
    background-color: rgba(38, 107, 194, 0.05);
}

/* Error text */
.text-danger {
    color: var(--danger-color) !important;
}

/* Loading state styles */
[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Refresh animation */
.refresh-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Timeline item highlight effect */
.timeline-item.highlight {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% { background-color: rgba(38, 107, 194, 0.2); }
    100% { background-color: transparent; }
}

/* Monitoring status badge */
.bg-success {
    background-color: var(--success-color) !important;
}

/* Enhanced timeline styles for better change visualization */
.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 3rem;
    border-left: 2px solid #e9ecef;
}

.timeline-marker {
    position: absolute;
    left: -8px;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c757d;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-marker.new-product {
    background: #28a745;
}

.timeline-marker.price-change {
    background: #007bff;
}

.timeline-marker.stock-change,
.timeline-marker.product-removed {
    background: #dc3545;
}

.timeline-marker.discount-change,
.timeline-marker.sale-change {
    background: #fd7e14;
}

.timeline-marker.status-change,
.timeline-marker.generic-change {
    background: #6f42c1;
}

.timeline-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-date {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.change-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.change-icon.new-product {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.change-icon.price-change {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.change-icon.stock-change {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.change-icon.product-removed {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.change-icon.discount-change,
.change-icon.sale-change {
    background: linear-gradient(135deg, #fd7e14, #e8690b);
}

.change-icon.status-change,
.change-icon.generic-change {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
}

.change-details {
    line-height: 1.5;
}

.change-details strong {
    color: #495057;
}

/* Price styling */
.old-price {
    text-decoration: line-through;
    color: #6c757d;
    font-weight: 500;
}

.new-price {
    font-weight: 600;
    color: #495057;
}

.new-price.price-up {
    color: #dc3545;
}

.new-price.price-down {
    color: #28a745;
}

/* Discount styling */
.old-discount,
.new-discount {
    font-weight: 600;
    color: #fd7e14;
}

/* Badge enhancements */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Animation for new items */
.timeline-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced metric cards */
.metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Loading states */
.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.timeline-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
}

/* Empty state */
.timeline-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.timeline-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Filter enhancements */
.filter-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-section .form-select {
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-section .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced product display styles */
.product-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
}

.product-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.brand-name {
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.8rem;
}

.brand-name i {
    color: #007bff;
}

/* Product image styling */
.product-image-wrapper {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.product-image-wrapper:hover .product-image {
    transform: scale(1.05);
}

/* Responsive product images */
@media (max-width: 768px) {
    .product-image-wrapper {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .product-image-wrapper {
        width: 50px;
        height: 50px;
    }
} 