/* Custom CSS for dashCoachAI - Consolidated styles */

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding-top: 5px;
}

.dash-template {
    background-color: #f8f9fa;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
}

/* Z1 activity card - Recovery */
.bg-z1-teal {
    background-color: #5EBFB2 !important;
    color: black !important;
}

/* Z2 activity card - Endurance */
.bg-z2-green {
    background-color: #4CAF50 !important;
    color: black !important;
}
/* Z3 activity card - Tempo */
.bg-z3-yellow {
    background-color: #FFEB3B !important;
    color: black !important;
}
/* Z4 activity card - Threshold */
.bg-z4-orange {
    background-color: #FF9800 !important;
    color: black !important;
}
/* Z5 activity card - VO2 Max */
.bg-z5-red {
    background-color: #E91E63 !important;
    color: black !important;
}
/* Z6 activity card - Anaerobic */
.bg-z6-red {
    background-color: #673AB7 !important;
    color: black !important;
}   
/* Z7 activity card - Neuromuscular */
.bg-z7-danger {
    background-color: #757575 !important;
    color: black !important;
}   

/* Card Styling */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Welcome Page Hero Section Styles */
.welcome-page .hero-section {
    background: linear-gradient(135deg, #2980b9, #3498db, #2c3e50);
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
    padding: 10px 0;
    margin-top: -40px;
    border-bottom-left-radius: 50% 5%;
    border-bottom-right-radius: 50% 5%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Feature Card Styling */
.feature-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.feature-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-icon-bg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* Step Number Styling */
.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Activity Cards */
.activity-card {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Welcome Card */
.welcome-card {
    border-radius: 15px;
}

/* Button Styling */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
    border-radius: 5px;
    font-weight: 600;
    padding: 10px 20px;
}

.btn-secondary {
    background-color: #95a5a6;
    border-color: #95a5a6;
}

/* Hero buttons */
#hero-upload-button {
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#hero-upload-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#hero-learn-button {
    font-weight: 500;
    transition: all 0.3s ease;
}

#hero-learn-button:hover {
    transform: translateY(-3px);
}

/* Donation Button */
.donation-button {
    transition: transform 0.2s;
    max-width: 200px;
}

.donation-button:hover {
    transform: scale(1.05);
}

/* Sidebar Styling */
@media (min-width: 992px) {
    .sidebar-fixed {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        max-width: 250px; /* Reduce sidebar width */
        width: 250px; /* Enforce fixed width */
    }
    
    /* Adjust column widths in the main container */
    #sidebar-container {
        flex: 0 0 250px !important;
        max-width: 250px !important;
    }
    
    /* Give more space to the main content */
    #sidebar-container + div {
        flex: 1 !important;
        max-width: calc(100% - 250px) !important;
    }
    
    .main-content-scrollable {
        overflow-y: auto;
        max-height: 100vh;
        padding-bottom: 20px;
    }
}

/* Prevent sidebar content from overflowing */
.sidebar-fixed .card {
    overflow-y: auto;
}

#sidebar-container .card {
    border-right: none;
}

/* Dropdown Styling */
.Select-control {
    border-radius: 5px !important;
    border: 1px solid #ccc !important;
}

/* Table Styling */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: #f1f1f1;
    font-weight: 600;
}

/* Upload Area Styling */
.dcc_upload {
    border: 2px dashed #ccc !important;
    border-radius: 10px !important;
    transition: border 0.3s;
}

.dcc_upload:hover {
    border: 2px dashed #2c3e50 !important;
}

/* Step Circles for Welcome Page */
.step-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* Metric Styling */
.metric-icon {
    font-size: 2rem;
}

.metric-name {
    font-size: clamp(0.75rem, 1.1vw, 1rem);
    font-weight: 600;
}

/* Profile Image Styling */
.profile-image {
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Alert Styling */
.alert {
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    padding: 12px 15px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Loading Indicators */
#custom-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-message {
    font-size: 18px;
    color: #333;
}

._dash-loading {
    margin: 200px auto;
    width: 100px;
    height: 100px;
    border: 10px solid #f3f3f3;
    border-top: 10px solid #3498db;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
.nine-day-grid .day-column {
    font-size: 1rem !important;
}

@media (max-width: 768px) {
    .nine-day-grid .day-column {
        font-size: 0.8rem !important;
    }
    
    .welcome-page .hero-section {
        padding: 60px 0;
    }
}

/* Mobile optimization for welcome page */
@media (max-width: 576px) {
    .welcome-page .hero-section {
        padding: 40px 0;
    }
    
    .welcome-page .hero-section h1 {
        font-size: 2rem;
    }
    
    .welcome-page .hero-section h4 {
        font-size: 1.2rem;
    }
    
    .welcome-page .hero-section .lead {
        font-size: 1rem;
    }
}

/* Make text smaller in daily activity cards */
.day-column .activity-card {
    font-size: 0.75rem; /* Reduce base font size */
}

.day-column .activity-card strong {
    font-size: 0.85rem; /* Make activity type slightly larger than other text */
}

.day-column .metric-row {
    margin-bottom: 0.1rem;
    gap: 0.1rem;
}

.day-column .text-column {
    font-size: 0.75rem; /* Smaller text for metrics */
    white-space: normal;
    overflow-wrap: break-word;
}

/* Make zone visualizations more compact */
.day-column .activity-card .small.text-center.mb-1 {
    font-size: 0.7rem;
    margin-bottom: 0px !important;
}

/* Responsive training load day column text - with improved text wrapping */
.day-column .activity-card {
    font-size: clamp(0.7rem, 1.2vw, 1.1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.day-column .activity-card strong {
    font-size: clamp(0.8rem, 1.3vw, 1.2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Add containment for all text elements in activity cards */
.day-column .activity-card .card-body {
    padding: 0.5rem;
    width: 100%;
    overflow: hidden;
}

.day-column .metric-name {
    font-size: clamp(0.75rem, 1.1vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-column .metric-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    overflow: hidden;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.day-column .small {
    font-size: clamp(0.65rem, 0.95vw, 0.85rem);
    white-space: normal;
    word-break: break-word;
}

/* Ensure all text elements in day columns are contained */
.day-column * {
    max-width: 100%;
}

/* Force long numbers to wrap or be truncated */
.day-column .activity-card span {
    max-width: 100%;
    word-break: break-all;
    display: inline-block;
    white-space: normal;
    word-break: keep-all;
}

/* Day column specific containment */
.day-column {
    overflow: hidden;
    box-sizing: border-box;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    min-width: 10% !important;  /* Reduce minimum width */
    flex: 1 0 10% !important;   /* Make more flexible */
}

/* Ensure divs inside day columns don't overflow */
.day-column .d-flex {
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
}

/* Layout spacing adjustments for better text fit */
.day-column .d-flex.align-items-center {
    margin-bottom: 0.15rem;
    gap: 0.1rem;
}

/* Responsive breakpoints for day columns */
@media (max-width: 1200px) {
    .day-column .activity-card {
        font-size: 0.75rem;
    }
}

@media (max-width: 992px) {
    .day-column .activity-card {
        font-size: 0.7rem;
    }
    
    .day-column .activity-card .card-body {
        padding: 0.25rem !important;
    }
    
    .day-column .d-flex.align-items-center {
        margin-bottom: 0.1rem;
        gap: 0.05rem;
    }
}

@media (max-width: 768px) {
    .day-column .activity-card {
        font-size: 0.65rem;
    }
}

/* Make card bodies more compact to fit more content */
.day-column .activity-card .card-body {
    padding: 0.25rem !important;
}

/* Add these classes to support the new icon-column and text-column layout */

.icon-column {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
}

 .text-column {
    font-size: 0.9rem;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    display: inline-block;
    max-width: 100%;
    text-align: center;
    unicode-bidi: plaintext;
}

.metric-row.long-wrap .text-column {
    white-space: normal;
    word-break: break-word;
}
.metric-row {
    width: 100%;
    overflow: hidden;
}

.nine-day-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.metric-row.zone-group {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Intervals.icu Auth Button styling */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    cursor: pointer;
}

/* Header and navbar styling */
.nav-pills .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    margin: 0 2px;
}

.nav-pills .nav-link.active {
    background-color: rgba(52, 152, 219, 0.85);
}

/* Make the sticky header more prominent with a subtle shadow */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
