/* Custom styles for Critical Endurance Analytics */

/* Body adjustments for full-page scrolling */
body {
    background-color: #fafafa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    color: #1a1a1a;
}

/* Add padding to the main container for better scrolling experience */
.container {
    padding-bottom: 50px;
}

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

.navbar-dark.bg-primary {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 8px 0; /* Reduced padding for shorter height */
}

.navbar-brand {
    color: #1a1a1a !important;
}

.navbar-text {
    color: #374151 !important;
}

.btn-outline-light {
    color: #374151 !important;
    border-color: #d1d5db !important;
    background: transparent;
    font-size: 0.875rem;
    padding: 4px 12px;
}

.btn-outline-light:hover {
    color: #ffffff !important;
    background-color: #374151 !important;
    border-color: #374151 !important;
}

.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #ffffff;
}

.card-header {
    background: #f8f9fa;
    color: #1a1a1a;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    padding: 16px 20px; /* Slightly more padding for better proportions */
    border-bottom: 1px solid #e5e5e5;
}

.card-header h4 {
    margin-bottom: 0;
    font-size: 1.1rem; /* Smaller heading */
    font-weight: 600;
}

/* Fix GAP checkbox alignment */
.card-header .form-check {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.card-header .form-check-input {
    margin-top: 0;
    margin-right: 6px;
}

.card-header .form-check-label {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Make activities summary more compact */
.activities-summary {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    padding: 8px 12px !important; /* Reduced padding */
    font-size: 0.75rem !important; /* Smaller text */
    line-height: 1.2 !important; /* Tighter line spacing */
    background: #f3f4f6 !important;
    border: 1px solid #e5e5e7 !important;
}

/* Results cards styling */
.card.bg-light.h-100 {
    min-height: 140px;
}

.card.bg-light .card-body {
    padding: 1.5rem 1rem;
}

.card.bg-light .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Chart container spacing */
.chart-container {
    margin-bottom: 3rem !important;
}

/* Info alert styling */
.alert.alert-info {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

/* Tab styling */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: #64748b;
    padding: 12px 20px;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #3b82f6;
    background-color: #f1f5f9;
}

.nav-tabs .nav-link.active {
    color: #1e40af;
    background-color: #ffffff;
    border-color: #e2e8f0 #e2e8f0 #ffffff;
    border-width: 2px 2px 2px 2px;
    font-weight: 600;
}

/* Progress tracking summary cards */
.card.bg-light .card-body.py-2 {
    padding: 12px 16px !important;
}

/* Time window radio buttons */
.btn-group .btn-check:checked + .btn {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Modal styling */
.modal-xl {
    max-width: 90vw;
}

/* Chart containers */
.chart-container canvas {
    max-height: 300px;
}

.activities-summary small {
    font-size: inherit !important;
}

/* Compact header buttons */
.card-header .btn {
    padding: 6px 12px !important; /* Smaller button padding */
    font-size: 0.85rem !important; /* Smaller button text */
}

.card-header .btn-success {
    padding: 6px 15px !important; /* Slightly more padding for primary button */
}

.btn-warning {
    background: #000000;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 500;
    color: white;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: #333333;
    color: white;
}

.btn-success {
    background: #000000;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    color: white;
}

.btn-success:hover {
    background: #333333;
    color: white;
}

.btn-info {
    background: #6b7280;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    color: white;
}

.btn-info:hover {
    background: #4b5563;
    color: white;
}

.btn-outline-primary {
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.btn-outline-secondary {
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 8px 16px;
}

.btn-outline-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.form-check-input:checked {
    background-color: #000000;
    border-color: #000000;
}

.form-check-label {
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.form-check-label:hover {
    background-color: #f8f9fa;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
    width: 100%;
    overflow: visible;
}

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

/* Fix for durability chart sizing issues */
#durability-chart-container {
    position: relative;
    height: 400px !important;
    width: 100% !important;
    overflow: hidden !important;
}

#durability-chart {
    max-width: 100% !important;
    max-height: 400px !important;
}

.alert-info {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
}

.bg-light {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    color: white !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.2s ease !important;
}

.bg-light:hover {
    transform: translateY(-2px) !important;
}

.bg-light .card-body {
    min-height: 100px !important; /* Ensure consistent height */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 16px !important;
}

.bg-light .card-title {
    color: #e5e7eb !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    margin-bottom: 8px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-primary {
    color: white !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
    line-height: 1.2 !important;
}

.text-success {
    color: white !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
    line-height: 1.2 !important;
}

/* Ensure all text in bg-light cards is white */
.bg-light .text-muted,
.bg-light .fs-6.text-muted {
    color: #d1d5db !important;
}

.bg-light small,
.bg-light small.text-muted {
    color: #9ca3af !important;
    font-size: 1rem !important;
    margin-top: 4px !important;
}

.spinner-border {
    color: #000000;
}

/* Modern table styling for model comparison */
.table {
    font-size: 0.875rem;
}

.table th {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 8px;
}

.table td {
    border-bottom: 1px solid #f3f4f6;
    padding: 10px 8px;
    color: #4b5563;
}

.table-sm th,
.table-sm td {
    padding: 8px 6px;
}

/* Add some spacing between result cards and other elements */
.row.mb-4 {
    margin-bottom: 2rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Improve collapse card styling */
.collapse .card-body {
    background-color: #fafafa;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e5e7eb;
}

/* Modern table styling */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem; /* Smaller font size */
    background: white;
}

.activity-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    padding: 10px 12px; /* Reduced padding */
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    font-size: 0.85rem; /* Smaller header font */
    color: #374151;
}

.activity-header:hover {
    background-color: #f3f4f6;
}

.activity-header.sortable:after {
    content: ' ↕️';
    color: #9ca3af;
    font-size: 0.8rem;
}

.activity-header.sort-asc:after {
    content: ' ↑';
    color: #000000;
    font-size: 0.8rem;
}

.activity-header.sort-desc:after {
    content: ' ↓';
    color: #000000;
    font-size: 0.8rem;
}

.activity-row {
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.activity-row:hover {
    background-color: #f9fafb;
}

.activity-row.selected {
    background-color: #f0f9ff;
    border-left: 3px solid #000000;
}

.activity-cell {
    padding: 8px 12px; /* Reduced padding */
    border-right: 1px solid #f3f4f6;
    font-size: 0.85rem; /* Smaller cell font */
    color: #374151;
}

.activity-cell:last-child {
    border-right: none;
}

/* Loading animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .chart-container {
        height: 300px;
    }
}
