/* Custom CSS for Commodity Price Prediction System */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.commodity-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* Price Change Styling */
.price-change {
    font-weight: 600;
}

.price-change.positive {
    color: var(--success-color);
}

.price-change.negative {
    color: var(--danger-color);
}

.price-change.neutral {
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Status Messages */
.alert {
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

canvas {
    border-radius: 10px;
    background: white;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Metrics Table */
.metrics-table {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 600;
    color: var(--dark-color);
}

.metric-value {
    color: var(--primary-color);
    font-weight: 500;
}

/* Model Name Hover Effects */
.model-name {
    position: relative;
    cursor: help !important;
    text-decoration: underline dotted !important;
    text-decoration-color: var(--primary-color);
    transition: all 0.3s ease;
}

.model-name:hover {
    color: var(--primary-color);
    text-decoration-color: var(--info-color);
}

/* Tabs */
.nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    background: white;
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    border-bottom: 1px solid white;
}

/* Footer */
footer {
    border-top: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .commodity-card .row .col-6 {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Data Table Styling */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Custom Progress Bar */
.prediction-confidence {
    height: 20px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
    margin-bottom: 10px;
}

.confidence-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--danger-color) 0%, var(--warning-color) 50%, var(--success-color) 100%);
    transition: width 0.5s ease;
}

/* Icon Styling */
.fas, .far {
    color: inherit;
}

.card-header .fas {
    color: inherit;
}

/* Custom Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Real-time Dashboard Animations */
.price-update {
    animation: priceFlash 0.8s ease-in-out;
}

@keyframes priceFlash {
    0% { 
        background-color: transparent; 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(40, 167, 69, 0.3); 
        transform: scale(1.05);
    }
    100% { 
        background-color: transparent; 
        transform: scale(1);
    }
}

/* Dashboard specific styles */
.dashboard-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Live indicator glow effect */
.live-indicator {
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.8);
}

/* Chart container hover effects */
.chart-container:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Status message fade in */
.dashboard-status {
    animation: fadeInStatus 0.5s ease-in;
}

@keyframes fadeInStatus {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Current Price Cards */
.current-price-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.current-price-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.current-price-card h3 {
    font-weight: 700;
    font-size: 2rem;
    margin: 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.current-price-card h6 {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-price-card small {
    font-size: 0.8rem;
}

/* Price Update Animation */
.price-update {
    animation: priceFlash 0.8s ease-in-out;
}

@keyframes priceFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: rgba(255, 255, 255, 0.3); }
    100% { transform: scale(1); }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}
