/*
 * Sapheneia TimesFM Web Application Styles
 * Professional styling for time series forecasting interface
 */

:root {
    --sapheneia-primary: #0066cc;
    --sapheneia-secondary: #6c757d;
    --sapheneia-success: #28a745;
    --sapheneia-warning: #ffc107;
    --sapheneia-info: #17a2b8;
    --sapheneia-light: #f8f9fa;
    --sapheneia-dark: #343a40;
}

/* Global Styles */
body {
    background-color: var(--sapheneia-light);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom: none;
    font-weight: 600;
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--sapheneia-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

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

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

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

/* Status Badge */
.badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Column Selection Styles */
.column-checkbox {
    transform: scale(1.1);
}

.column-checkbox:checked {
    background-color: var(--sapheneia-success);
    border-color: var(--sapheneia-success);
}

.form-check-label {
    font-weight: 500;
    color: var(--sapheneia-dark);
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    font-size: 0.85rem;
}

.form-check-label:hover {
    color: var(--sapheneia-primary);
}

/* Data Definition Styles */
.column-definition {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
}

.column-definition:hover {
    border-color: var(--sapheneia-primary);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 102, 204, 0.1);
}

.column-name {
    font-weight: 600;
    color: var(--sapheneia-primary);
    font-family: 'Courier New', monospace;
}

.column-type {
    font-size: 0.875rem;
    color: var(--sapheneia-secondary);
}

/* Data Info Table */
.data-info-table {
    background-color: white;
    border-radius: 0.375rem;
}

.data-info-table th {
    background-color: var(--sapheneia-light);
    font-weight: 600;
    border-top: none;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

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

/* Tab Enhancements */
.nav-tabs .nav-link {
    border: none;
    border-radius: 0.375rem 0.375rem 0 0;
    color: var(--sapheneia-secondary);
    font-weight: 500;
}

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

/* Chart Container */
.chart-container {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    max-height: 800px;
    margin: 0 auto;
    position: relative;
}

#forecastChart {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: white;
    width: 100%;
    height: 100%;
    resize: both;
    overflow: hidden;
}

/* Summary Cards */
.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Data Table */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--sapheneia-primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 102, 204, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .row .col-md-3,
    .row .col-md-4,
    .row .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Mobile chart adjustments */
    .chart-container {
        height: 50vh;
        min-height: 300px;
    }
}

/* Chart responsiveness for different screen sizes */
@media (min-width: 1200px) {
    .chart-container {
        height: 75vh;
        max-height: 900px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .chart-container {
        height: 65vh;
        max-height: 700px;
    }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Success/Error States */
.is-valid {
    border-color: var(--sapheneia-success);
}

.is-invalid {
    border-color: #dc3545;
}

.valid-feedback {
    color: var(--sapheneia-success);
}

.invalid-feedback {
    color: #dc3545;
}

/* Progress Indicator */
.progress-step {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #e9ecef;
    color: var(--sapheneia-secondary);
    text-align: center;
    line-height: 2rem;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.completed {
    background-color: var(--sapheneia-success);
    color: white;
}

.progress-step.active {
    background-color: var(--sapheneia-primary);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Utility Classes */
.text-sapheneia {
    color: var(--sapheneia-primary) !important;
}

.bg-sapheneia {
    background-color: var(--sapheneia-primary) !important;
}

.border-sapheneia {
    border-color: var(--sapheneia-primary) !important;
}

/* File Upload Enhancement */
.form-control[type="file"] {
    padding: 0.5rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    background-color: var(--sapheneia-primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

/* Error Display Styles */
.error-details pre {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 300px;
    overflow-y: auto;
}

.alert-danger .alert-heading {
    color: #721c24;
    font-weight: 600;
}

.alert-danger hr {
    border-top-color: #f5c6cb;
}

.alert-danger ul {
    margin-bottom: 0;
}

.alert-danger li {
    margin-bottom: 0.25rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--sapheneia-primary);
    border-radius: 4px;
}

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