/* Custom Styles for TrainAI Dashboard */

/* ============================================
   GOAL BANNER COMPONENT STYLES
============================================ */

/* Goal Banner Container Control */
.goal-banner-desktop {
    display: block;
}

.goal-banner-mobile {
    display: none;
}

.goal-banner {
    background: white;
    border-radius: 12px;
    padding: 16px 20px 14px 20px;  /* Reduced top/bottom padding for compactness */
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
}

/* ============================================
   ONBOARDING BANNER
============================================ */

.onboarding-banner {
    background: #ffffff;
    border: 1px solid rgba(45, 86, 82, 0.15);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(12, 44, 71, 0.08);
}

.onboarding-banner.onboarding-hidden {
    display: none;
}

.onboarding-banner__header h2 {
    margin: 0;
    font-family: 'Bitter', serif;
    font-size: 1.4rem;
    color: #0C2C47;
}

.onboarding-banner__header p {
    margin: 6px 0 0 0;
    font-family: 'Chivo', sans-serif;
    color: #607080;
    font-size: 0.95rem;
}

.onboarding-steps {
    list-style: none;
    margin: 18px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.onboarding-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(12, 44, 71, 0.08);
    background: #f8fbfb;
}

.onboarding-step__sequence {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 40px;
    margin-top: 4px;
}

.onboarding-step__number {
    font-family: 'Bitter', serif;
    font-size: 1.15rem;
    color: #0C2C47;
    font-weight: 600;
}

.onboarding-step.is-complete {
    background: #f5fbf8;
    border-color: rgba(45, 86, 82, 0.25);
}

.onboarding-step.is-active {
    background: #f7faff;
    border-color: rgba(12, 44, 71, 0.2);
}

.onboarding-step__status {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #96D3CC;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #96D3CC;
}

.onboarding-step.is-active .onboarding-step__status {
    border-color: #2D5652;
    color: #2D5652;
}

.onboarding-step.is-complete .onboarding-step__status {
    background: #2D5652;
    border-color: #2D5652;
    color: #ffffff;
}

.onboarding-step__body {
    flex: 1;
}

.onboarding-step__title {
    font-family: 'Bitter', serif;
    font-size: 1.05rem;
    color: #0C2C47;
    margin-bottom: 4px;
}

.onboarding-step__description {
    font-family: 'Chivo', sans-serif;
    font-size: 0.92rem;
    color: #5c6b79;
    margin-bottom: 8px;
}

.onboarding-step__meta {
    font-family: 'Chivo', sans-serif;
    font-size: 0.85rem;
    color: #607080;
    margin-top: 6px;
    font-style: italic;
}

.onboarding-step__action {
    background: #2D5652;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 6px 16px;
    font-family: 'Chivo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.onboarding-step__action:hover,
.onboarding-step__action:focus {
    background: #23433f;
    outline: none;
    transform: translateY(-1px);
}

.onboarding-step.is-complete .onboarding-step__action {
    background: rgba(45, 86, 82, 0.1);
    color: #2D5652;
}

@media (max-width: 768px) {
    .onboarding-banner {
        padding: 16px;
    }

    .onboarding-step {
        flex-direction: row;
        align-items: flex-start;
    }

    .onboarding-step__action {
        width: 100%;
        text-align: center;
    }

    .onboarding-step__sequence {
        flex-direction: row;
        gap: 10px;
    }
}

/* Desktop: Ensure proper header alignment */
@media (min-width: 769px) {
    /* Ensure Goal header has consistent line-height */
    .goal-header-section .goal-title h3 {
        line-height: 1.2;
    }
}

/* Goal Header */
.goal-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;  /* Further reduced for compactness */
    gap: 10px;
}

.goal-icon {
    width: 32px;
    height: 32px;
}

.goal-svg {
    width: 100%;
    height: 100%;
    fill: #0C2C47;
}

.goal-title {
    flex: 1;
}

.goal-title h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0C2C47;
    font-family: 'Bitter', serif;
    line-height: 1.2;
}

.goal-title-line {
    width: 60px;  /* Match the width of "Goal" text */
    height: 1px;
    background-color: #0C2C47;
    margin-top: 4px;
}

/* Active Goal Layout */
.goal-content {
    display: flex;
    flex-direction: column;
}

.goal-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* Align to top for more compact layout */
    gap: 20px;               /* Reduced gap to bring elements closer */
    min-height: 70px;        /* Further reduced height for maximum compactness */
}

.goal-race-info {
    flex: 1;
}

.race-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0C2C47;
    margin: 0 0 8px 0;
    font-family: 'Bitter', serif;
}

.time-remaining {
    font-size: 1rem;
    color: #7BC4C4;
    margin: 0 0 12px 0;
    font-weight: 400;
}

.time-goal, .pace-goal {
    font-size: 0.95rem;
    color: #0C2C47;
    margin: 6px 0;
    font-weight: 500;
}

/* Goal Status & Progress Gauge */
.goal-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -25px;      /* Pull gauge much higher to eliminate whitespace */
    margin-left: -40px;     /* Move much further left for optimal positioning */
}

.progress-gauge {
    margin-bottom: 8px;
}

.gauge-container {
    position: relative;
    width: 160px;        /* Increased back to larger size */
    height: 100px;       /* Increased back to more prominent size */
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;  /* Align to top for tighter layout */
}

.gauge-svg {
    width: 100%;
    height: 100%;
    margin-bottom: -35px; /* Adjusted for downward arrow from above */
}

/* Smart Arrow positioning based on status - uses percentage-based calculations */
.gauge-arrow {
    transition: transform 0.3s ease;
    /* Arrow starts at x=30 in 154px viewBox, now points down from above */
}

.on_track .gauge-arrow {
    /* Position at 16% of gauge width (clearly above green area) */
    transform: translateX(calc(-13% - 5px));   
}

.progressing .gauge-arrow {
    /* Position at 50% of gauge width (center above yellow area) */
    transform: translateX(calc(30% + 15px));    
}

.off_track .gauge-arrow {
    /* Position at 84% of gauge width (clearly above red area) */
    transform: translateX(calc(65% + 25px));   
}

.gauge-fill {
    display: none; /* Hide the fill as we're using the background gradient now */
}

/* Status-specific gauge colors - harmonized with dashboard palette */
.on_track .gauge-fill {
    background: #6CB4A8;  /* Soft green matching teal theme */
    transform: rotate(30deg);  /* Position in green zone */
    transform-origin: bottom center;
}

.progressing .gauge-fill {
    background: #D4A574;  /* Soft amber harmonizing with palette */
    transform: rotate(0deg);  /* Position in middle */
    transform-origin: bottom center;
}

.off_track .gauge-fill {
    background: #D47A6A;  /* Soft red matching the softer theme */
    transform: rotate(-30deg);  /* Position in red zone */
    transform-origin: bottom center;
}

.gauge-text {
    text-align: center;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.gauge-text strong {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0C2C47;
    display: inline-block;
    letter-spacing: 0.5px;
}

.status-text span {
    color: #666;
    font-size: 0.8rem;
}

/* Ask TrainAI Button */
.ask-trainai-btn {
    background-color: transparent;
    color: #0C2C47;
    border: 1.5px solid #0C2C47;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Chivo', sans-serif;
    margin-top: 8px;
}

.ask-trainai-btn:hover {
    background-color: rgba(12, 44, 71, 0.05);
    transform: translateY(-1px);
}

/* No Goal State */
.goal-no-goal-info {
    width: 100%;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
    font-family: 'Chivo', sans-serif;
}

/* Goal Chat Input Styling */
.goal-chat-input {
    width: 100%;
    margin-top: 20px; /* Increased from 15px for more prominence */
}

#goal-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 28px; /* Slightly larger radius */
    padding: 6px; /* More padding */
    border: 2px solid #dee2e6; /* Thicker border for prominence */
    transition: all 0.3s ease;
}

#goal-chat-form:focus-within {
    border-color: #2D5652;
    box-shadow: 0 0 0 3px rgba(45, 86, 82, 0.1);
}

.goal-input-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px; /* Increased vertical padding */
    font-size: 1rem; /* Slightly larger font */
    font-family: 'Chivo', sans-serif;
    outline: none;
}

.goal-input-field::placeholder {
    color: #999;
    font-family: 'Chivo', sans-serif;
}

.goal-send-btn {
    background: #2D5652;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px; /* Slightly larger button */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(45, 86, 82, 0.2);
    position: relative;
    overflow: hidden;
}

.goal-send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.goal-send-btn:hover {
    background: #0C2C47;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 86, 82, 0.3);
}

.goal-send-btn:hover::before {
    width: 45px;
    height: 45px;
}

.goal-send-btn:active {
    transform: scale(0.95);
}

.goal-send-btn i {
    font-size: 16px;
    z-index: 1;
    line-height: 1.4;
    font-weight: 400 !important;
}

/* Desktop Goal Layout - Header and Action aligned */
.goal-desktop-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Top alignment to reduce whitespace */
    gap: 20px;
}

.goal-header-section {
    flex: 1;
}

.goal-action-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px; /* Increased from 4px to prevent text cutoff */
    /* Align with the Goal header */
    padding-top: 0;
    padding-bottom: 4px; /* Ensure hint text has space from bottom */
}

.goal-set-btn {
    background: #2D5652;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Chivo', sans-serif;
    margin: 0;  /* Remove all margins to align with top */
}

.goal-set-btn:hover {
    background: #1e3a37;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 86, 82, 0.3);
}

.goal-set-btn i {
    font-size: 16px;
}

.goal-hint {
    font-size: 11px; /* Reduced from 12px to prevent cutoff */
    color: #666;
    font-style: italic;
    margin: 0;
    line-height: 1.2; /* Tighter line height */
}

/* Ensure consistent subtitle styling in goal banner */
.goal-banner .subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
    font-weight: 400;
    font-family: 'Chivo', sans-serif;  /* Changed to match body text */
    line-height: 1.2;  /* Tighter line height */
}

/* Desktop subtitle spacing */
.goal-header-section .subtitle {
    margin-top: 8px;  /* Small gap between header and subtitle */
}

/* Desktop Layout - All elements in one row */
.goal-desktop-layout {
    display: flex;
    align-items: flex-start; /* Top alignment to reduce whitespace */
    justify-content: space-between;
    gap: 20px;
}

.goal-header-section {
    flex: 1;
}

.goal-action-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px; /* Increased from 4px to prevent text cutoff */
    padding-top: 0; /* Ensure no top padding */
    padding-bottom: 4px; /* Ensure hint text has space from bottom */
}

/* Chat input focus state when setting goal */
.chat-input-field.goal-focused {
    border-color: #2D5652 !important;
    box-shadow: 0 0 0 3px rgba(45, 86, 82, 0.1) !important;
    animation: pulse-border 2s ease-in-out;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(45, 86, 82, 0.1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(45, 86, 82, 0.2);
    }
}

/* Mobile/Desktop visibility classes */
.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

/* Desktop specific styles */
@media (min-width: 769px) {
    .goal-banner {
        max-width: 600px;
        margin: 0 auto 10px auto; /* Reduced from 20px to bring components closer */
        padding: 16px 24px; /* More compact vertical padding */
    }
    
    /* Make goal header more compact on desktop */
    .goal-desktop-layout .goal-header {
        margin-bottom: 0; /* Remove bottom margin on desktop */
    }
    
    /* Align action section with header top */
    .goal-desktop-layout .goal-action-section {
        margin-top: -15px; /* Slight negative margin to align with header */
    }
    
    /* Slightly smaller icon on desktop for compactness */
    .goal-desktop-layout .goal-icon {
        width: 28px;
        height: 28px;
    }
    
    .mobile-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Mobile Responsive Styles for Goal Banner */
@media (max-width: 768px) {
    /* Switch banner display for mobile */
    .goal-banner-desktop {
        display: none;
    }
    
    .goal-banner-mobile {
        display: block;
        padding: 0;  /* Remove side padding for full-width */
        margin-top: 16px;  /* Keep top margin for spacing from navigation */
        margin-bottom: 16px;
    }
    
    .goal-banner {
        margin-bottom: 0;
        padding: 12px 16px 10px 16px;  /* Reduced padding for mobile compactness */
        border-radius: 0;  /* Remove border radius for edge-to-edge look */
        border-left: 4px solid #e3f2fd;  /* Add blue left border like other containers */
        border-right: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    /* Keep two-column layout on mobile */
    .goal-details {
        flex-direction: row; /* Keep horizontal layout */
        gap: 15px;           /* Reduced gap for mobile compactness */
        align-items: flex-start;
        min-height: 65px;    /* Reduced height for mobile */
    }
    
    .goal-race-info {
        text-align: left; /* Left align text */
        flex: 1; /* Take available space */
    }
    
    .goal-status {
        align-items: center;
        text-align: center;
        flex-shrink: 0; /* Prevent shrinking */
        margin-top: -20px;   /* Less aggressive negative margin */
        margin-left: -100px;  /* Move much further left for mobile */
    }
    
    .race-name {
        font-size: 1.3rem;
    }
    
    .time-remaining {
        font-size: 0.95rem;
    }
    
    .gauge-container {
        width: 100px;        /* Slightly smaller for mobile compactness */
        height: 70px;        /* Reduced height for mobile */
    }
    
    /* Mobile gauge indicators - use same smart positioning as desktop */
    .on_track .gauge-arrow {
        transform: translateX(calc(-13% - 3px));   /* Points down above green area (mobile) */
    }
    
    .progressing .gauge-arrow {
        transform: translateX(calc(30% + 10px));   /* Points down above yellow area (mobile) */
    }
    
    .off_track .gauge-arrow {
        transform: translateX(calc(65% + 20px));   /* Points down above red area (mobile) */
    }
    
    .gauge-fill {
        border-radius: 110px 110px 0 0;
    }
    
    .ask-trainai-btn {
        padding: 5px 14px;
        font-size: 0.75rem;
        margin-top: 4px;
    }
    
    /* Mobile goal chat input adjustments - more prominent */
    .goal-chat-input {
        margin-top: 12px; /* Reduced from 24px for more compact look */
    }
    
    #goal-chat-form {
        padding: 5px;
        border-width: 2px;
    }
    
    .goal-input-field {
        padding: 10px 14px; /* Bigger touch target */
        font-size: 0.95rem; /* Slightly larger text */
    }
    
    .goal-send-btn {
        width: 40px; /* Keep larger size on mobile too */
        height: 40px;
    }
    
    .goal-send-btn i {
        font-size: 16px; /* Keep icon size consistent */
    }
}

/* Professional Workout Details Modal Styles */
.workout-details-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.workout-details-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.workout-details-header {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.workout-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workout-delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.workout-delete-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.workout-details-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #2c3e50;
}

.workout-details-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.workout-details-close:hover {
    color: #2c3e50;
}

.workout-details-body {
    padding: 32px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Workout Content Sections */
.workout-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.workout-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workout-stat label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin: 0;
}

.workout-stat span {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* Intensity styling */
.intensity-easy { color: #28a745; }
.intensity-moderate { color: #ffc107; }
.intensity-hard { color: #fd7e14; }
.intensity-very-hard { color: #dc3545; }

.workout-description {
    margin-bottom: 32px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.workout-description label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.workout-description p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Workout Description */
.workout-description {
    margin-bottom: 24px;
}

.workout-description h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2D5652;
}

.workout-description p {
    margin: 0;
    font-size: 15px;
    color: #495057;
    line-height: 1.6;
}

/* Workout Structure */
.workout-structure {
    margin-bottom: 32px;
}

.workout-structure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.workout-structure h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2D5652;
}

/* Removed duplicate .ask-trainai-btn styles - using the transparent version above */

.ask-trainai-section {
    display: flex;
    justify-content: center;
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
}

.workout-segments {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workout-segment {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.workout-segment:hover {
    border-color: #2D5652;
    box-shadow: 0 4px 12px rgba(45, 86, 82, 0.1);
}

.segment-number {
    background: linear-gradient(135deg, #2D5652 0%, #0C2C47 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.segment-content {
    flex: 1;
}

.segment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.segment-type {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.segment-duration {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.segment-effort {
    font-size: 14px;
    font-weight: 600;
    color: #E2A54D;
    font-style: italic;
    margin-bottom: 4px;
}

.segment-description {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

/* Notes and Metadata */
.workout-notes {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 8px;
    border-left: 4px solid #E2A54D;
}

.workout-notes label {
    font-size: 14px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
    display: block;
}

.workout-notes p {
    margin: 0;
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
}

.workout-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 24px;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metadata-item label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-proposed {
    background: #fff3cd;
    color: #856404;
}

.status-scheduled {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* Action Buttons */
.workout-details-actions {
    padding: 24px 32px;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    border-top: 1px solid #dee2e6;
}

.workout-download-btn {
    background: linear-gradient(135deg, #2D5652 0%, #0C2C47 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.workout-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 86, 82, 0.3);
    color: white;
}

.workout-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Delete button styling */
.workout-download-btn.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.workout-download-btn.delete-btn:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.workout-actions-note {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    font-style: italic;
    margin-bottom: 8px;
}

.workout-actions-note i {
    color: #ffc107;
}

.workout-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .workout-details-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .workout-details-header {
        padding: 20px 24px;
    }
    
    .workout-details-header h2 {
        font-size: 20px;
    }
    
    .workout-details-body {
        padding: 24px 20px;
    }
    
    .workout-title {
        font-size: 24px;
    }
    
    .workout-summary {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }
    
    .workout-segment {
        flex-direction: column;
        gap: 12px;
    }
    
    .segment-number {
        align-self: flex-start;
    }
    
    .workout-metadata {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .workout-details-actions {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .workout-actions-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .workout-download-btn {
        justify-content: center;
        width: 100%;
    }
    
    .workout-actions-note {
        justify-content: center;
        text-align: center;
        margin-bottom: 12px;
    }
}

body {
    background-color: #f0f2f5; /* A slightly different, modern background color */
    color: #0C2C47; /* Navy Blue */
    font-family: 'Chivo', sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(180px, 200px) 1fr; /* Much narrower sidebar: min 180px, max 200px - maximized chat space */
    grid-template-rows: 1fr;
    grid-template-areas:
        "sidebar main";
    height: calc(100vh - 76px); /* Subtract header height */
    gap: 6px; /* Minimal gap for maximum chat space */
    padding: 6px; /* Minimal padding for maximum chat space */
    box-sizing: border-box;
    margin-top: 0;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        grid-template-rows: auto auto; /* Two auto rows to allow natural height */
        grid-template-areas:
            "sidebar"
            "main";
        height: auto; /* Allow content to flow naturally */
        gap: 4px; /* Minimal gap for mobile */
        padding: 2px; /* Minimal padding for mobile */
        overflow-y: auto; /* Enable scrolling for the entire grid */
        width: 100%;
        max-width: calc(100vw - 4px); /* Account for minimal padding */
        box-sizing: border-box;
        margin: 0;
    }
    
    .sidebar {
        max-height: none; /* Remove height limit to show all content */
        overflow-y: visible; /* Remove separate scrolling on mobile only */
        width: 100%;
        max-width: calc(100vw - 8px); /* Account for grid padding */
        box-sizing: border-box;
        padding: 4px; /* Minimal padding for mobile */
        margin: 0;
    }
    
    .main-content {
        grid-template-rows: auto; /* Single auto row for natural height */
        gap: 4px; /* Minimal gap for mobile */
        min-height: auto; /* Remove minimum height constraint */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent horizontal overflow */
        margin: 0;
        padding: 0; /* Remove padding to allow edge-to-edge */
    }
    
    .analysis-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0; /* Remove all padding on mobile */
        overflow-x: hidden; /* Prevent horizontal overflow */
        margin: 0;
        border-radius: 0; /* Remove border radius for edge-to-edge */
        box-shadow: none; /* Remove shadow for flat design */
        background: transparent; /* Remove background */
    }
    
    /* Slider container mobile adjustments */
    .slider-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent horizontal overflow */
        padding: 0; /* Remove any padding */
        margin: 0; /* Remove any margin */
    }
    
    .slider-item {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0; /* Remove any padding */
        margin: 0; /* Remove any margin */
    }
    
    .card-body {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent horizontal overflow */
        padding: 4px; /* Reduce padding */
    }
    
    /* Calendar mobile adjustments */
    .training-plan {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 6px; /* Reduce padding */
    }
    
    /* Mobile Calendar Container */
    .calendar-container {
        width: 100%;
        max-width: calc(100vw - 20px);
        box-sizing: border-box;
        margin: 0 auto;
    }
    
    /* Mobile Calendar Header */
    .calendar-header {
        gap: 2px;
        margin-bottom: 4px;
    }
    
    .header-day {
        font-size: 0.7rem;
        padding: 4px 2px;
        font-weight: 600;
    }
    
    /* Mobile Calendar Grid */
    .calendar {
        gap: 2px;
        grid-template-columns: repeat(7, minmax(35px, 1fr));
        width: 100%;
        max-width: calc(100vw - 20px);
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .calendar-day {
        height: 25px;
        padding: 2px;
        min-width: 35px;
        border-radius: 6px;
    }
    
    .calendar-day .date-number {
        font-size: 0.8rem;
        top: 2px;
        right: 4px;
    }
    
    .workout-icon {
        font-size: 12px;
    }
    
    .calendar-day .workout-indicator {
        top: 50%;
        left: 3px;
        transform: translateY(-50%);
    }
    
    /* Mobile Month Navigation */
    .month-navigation {
        gap: 15px;
        margin-bottom: 8px;
    }
    
    .month-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .current-month {
        font-size: 1rem;
        min-width: 80px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: minmax(180px, 220px) 1fr; /* Much smaller sidebar on tablets */
    }
}

/* Small desktop screens */
@media (min-width: 1025px) and (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: minmax(170px, 200px) 1fr; /* Much smaller sidebar on small screens */
        gap: 6px;
        padding: 6px;
    }
}

.sidebar {
    grid-area: sidebar;
    background-color: #fff;
    padding: 16px; /* Reduce padding */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 16px; /* Reduce gap */
    overflow-y: auto; /* Allow scrolling if content is too tall */
}

/* Tablet sidebar adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        padding: 12px; /* Even more compact on tablets */
        gap: 12px;
    }
    
    .data-snapshot h3, .training-plan h3 {
        font-size: 1.2rem; /* Slightly smaller headings */
        margin-bottom: 12px;
    }
    
    .calendar {
        gap: 4px; /* Even smaller calendar gaps for mobile */
        grid-template-columns: repeat(7, minmax(0, 1fr)); /* Ensure columns don't exceed container */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .calendar-day {
        min-height: 40px; /* Smaller calendar cells */
        font-size: 0.8rem;
        padding: 4px; /* Reduced padding */
        min-width: 0; /* Allow shrinking */
        box-sizing: border-box;
    }
}

.main-content {
    grid-area: main;
    display: grid;
    grid-template-rows: 1fr 1.5fr; /* Give more space to chat interface */
    gap: 10px; /* Keep reduced gap */
    overflow: hidden; /* Prevent double scrollbars */
}

.analysis-content {
    background-color: #fff;
    padding: 12px; /* Reduce padding further */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.plots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 380px); /* Adjusted height to match new plot dimensions */
    gap: 12px; /* Slightly reduced gap for better fit */
}

/* Mobile plot adjustments */
@media (max-width: 768px) {
    /* Remove padding from analysis content container on mobile */
    .analysis-content {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .plots-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        grid-template-rows: repeat(4, 550px); /* Increased height for better mobile space utilization */
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0; /* Remove any padding */
        margin: 0; /* Remove any margin */
    }
    
    /* Ensure Plotly charts are properly constrained on mobile */
    .js-plotly-plot {
        width: 100% !important;
        max-width: calc(100vw - 20px) !important; /* Account for margins */
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Ensure plot containers don't overflow */
    .plotly-graph-div {
        width: 100% !important;
        max-width: calc(100vw - 20px) !important; /* Account for margins */
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Ensure all plot-related elements are constrained */
    .card-body > div {
        width: 100%;
        max-width: calc(100vw - 20px); /* Account for margins */
        box-sizing: border-box;
        overflow: hidden;
    }
    
    /* Ensure plots don't overflow horizontally */
    .card-body {
        overflow: hidden; /* Prevent any overflow */
        padding: 2px; /* Minimal padding */
    }
    
    /* Ensure the main plot area doesn't exceed viewport */
    .plotly-graph-div .svg-container {
        width: 100% !important;
        max-width: calc(100vw - 20px) !important; /* Account for margins */
        overflow: hidden !important;
    }
    
    /* Force plot responsiveness */
    .plot-container {
        width: 100% !important;
        max-width: calc(100vw - 16px) !important;
        overflow: hidden !important;
        padding: 2px;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    /* Ensure all mobile elements fit properly */
    .slider-item.card {
        width: calc(100vw - 4px) !important; /* Account for parent padding */
        max-width: calc(100vw - 4px) !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: none !important;
        border-radius: 0 !important;
    }
    
    .slider-item .card-body {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important; /* Small padding to prevent chart cutoff */
        margin: 0 !important;
    }

    /* Enhanced mobile chart display for race performance analysis */
    .plot-slide .card-body {
        padding: 10px !important; /* Small padding to prevent chart cutoff */
        height: 100%; /* Full height utilization */
        border: none; /* Remove borders for maximum space */
        background: transparent; /* No background */
        display: flex; /* Flex to ensure content fills space */
        flex-direction: column;
    }
    
    /* Remove card borders on mobile for charts - fill entire container */
    .plot-slide.card {
        border: none; /* No border - seamless integration */
        box-shadow: none; /* No shadow - clean flat design */
        background: transparent; /* Transparent background */
        border-radius: 0; /* No rounded corners */
        margin: 0; /* No margins */
        padding: 0; /* No padding */
        height: 100%; /* Ensure card takes full height */
    }
    
    /* Force Plotly charts to fill container height on mobile */
    .plot-slide .js-plotly-plot,
    .plot-slide .plotly-graph-div {
        height: 100% !important; /* Fill available height */
        min-height: 500px !important; /* Minimum height for usability */
    }
    
    /* Ensure plot container fills available space */
    .plot-slide .plot-container {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Maximize chart plotting area on mobile */
    .plot-slide {
        height: 550px !important; /* Match grid height */
        background: white; /* White background for the entire container */
        border-radius: 0; /* Remove rounded corners for edge-to-edge */
        overflow: hidden; /* Ensure chart doesn't overflow */
        box-shadow: none; /* Remove shadow for flat design */
        display: flex;
        flex-direction: column;
        border-left: 4px solid #e3f2fd; /* Blue left border like other containers */
        border-right: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        margin: 0 -2px; /* Negative margin to extend to edges */
        padding: 0; /* Remove all padding */
        width: calc(100% + 4px); /* Compensate for negative margins */
        max-width: calc(100% + 4px);
    }
    
    /* Desktop responsive layout */
    @media (min-width: 769px) {
        .plots-grid {
            grid-template-rows: repeat(4, minmax(400px, 1fr)); /* Responsive height for desktop */
            gap: 16px; /* Larger gap for desktop */
        }
        
        .plot-slide.card {
            border: 1px solid #ddd; /* Restore desktop borders */
            box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Restore desktop shadow */
            background: white; /* Restore desktop background */
            border-radius: 8px; /* Restore desktop rounded corners */
            margin: 0; /* No margins for full space utilization */
            padding: 0; /* Keep no padding for chart area */
            height: 100%; /* Full height of grid cell */
        }
        
        .plot-slide .card-body {
            padding: 16px; /* Optimal desktop padding */
            height: calc(100% - 32px); /* Account for padding */
            background: white; /* Restore desktop background */
        }
        
        .plot-slide {
            background: transparent; /* Remove mobile container styling on desktop */
            border-radius: 0;
            box-shadow: none;
            height: 100%; /* Full available height */
        }
        
        /* Desktop chart responsiveness */
        .js-plotly-plot .plotly-graph-div {
            min-height: 400px; /* Minimum height for desktop */
            height: 100% !important; /* Use available space */
            width: 100% !important; /* Full width utilization */
        }
        
        /* Ensure plot containers are fully responsive on desktop */
        .plot-container {
            width: 100% !important;
            height: 100% !important;
        }
    }
}

/* Tablet plot adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .plots-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 300px); /* Adjusted for tablet screens */
        gap: 10px;
    }
}

/* Small desktop adjustments */
@media (min-width: 1025px) and (max-width: 1200px) {
    .plots-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 320px); /* Adjusted for small desktop screens */
        gap: 10px;
    }
}

.plot-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 8px 4px; /* Reduced padding for better space utilization */
    box-sizing: border-box;
}

/* Ensure Plotly charts are responsive */
.plot-container .plotly-graph-div {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile plot responsiveness */
@media (max-width: 768px) {
    .plot-container {
        min-height: 180px;
        padding: 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .plot-container .plotly-graph-div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        /* Removed height constraint to allow proper responsiveness */
    }
}


.chat-placeholder {
    background-color: #fff;
    padding: 12px; /* Increase padding for better spacing */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px; /* Set minimum height to ensure input is visible */
}

.data-snapshot, .training-plan {
    background-color: #f8f9fa;
    padding: 16px; /* Reduce padding */
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.data-snapshot h3, .training-plan h3 {
    font-size: 1.3rem;
    margin-bottom: 18px;
    font-weight: 700;
    color: #0C2C47;
    font-family: 'Bitter', serif;
    position: relative;
    padding-bottom: 10px;
}

/* Add underline to section titles like Goal banner */
.data-snapshot h3 {
    display: inline-block;
    position: relative;
}

.data-snapshot h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #0C2C47;
}

/* Responsive sidebar content */
@media (max-width: 1200px) and (min-width: 769px) {
    .data-snapshot, .training-plan {
        padding: 12px;
    }
    
    .data-snapshot h3, .training-plan h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .data-snapshot p, .training-plan p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Calendar Container */
.calendar-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Calendar Title */
.training-plan h3 {
    text-align: center;
    margin-bottom: 16px;
}

/* Month Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    gap: 20px;
}

.month-nav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #0C2C47;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.month-nav-btn:hover {
    background-color: rgba(45, 86, 82, 0.1);
    color: #2D5652;
}

.current-month {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0C2C47;
    font-family: 'Chivo', sans-serif;
    min-width: 100px;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

/* Add underline to calendar month/year */
.current-month::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background-color: #0C2C47;
}

/* Calendar Header */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.header-day {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0C2C47;
    padding: 8px 4px;
    font-family: 'Chivo', sans-serif;
}

/* Calendar Grid */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    background-color: #fff;
    border: 1px solid #e9ecef;
    padding: 4px;
    border-radius: 8px;
    height: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    font-family: 'Chivo', sans-serif;
    cursor: pointer;
}

.calendar-day:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Stronger hover effect */
    transform: translateY(-2px);
    border-color: #2D5652; /* Green border on hover */
}

/* Date Number Styling */
.calendar-day .date-number {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0C2C47;
    font-family: 'Chivo', sans-serif;
}

/* Workout Indicator Styling */
.calendar-day .workout-indicator {
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Add Workout Indicator for Empty Days - Minimal Style */
.calendar-day .add-workout-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.15; /* Very subtle */
    transition: opacity 0.2s ease;
    pointer-events: none; /* Don't interfere with day click */
}

.calendar-day:hover .add-workout-indicator {
    opacity: 0.4; /* Still subtle on hover */
}

.add-workout-icon {
    font-size: 10px; /* Much smaller */
    color: #6c757d; /* More neutral gray */
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-workout-icon:hover {
    color: #495057; /* Slightly darker gray on hover */
}

/* Workout Icons */
.workout-icon {
    font-size: 14px;
}

.completed-icon {
    color: white;
    text-shadow: 
        -1px -1px 0 rgba(0, 0, 0, 0.8),  
         1px -1px 0 rgba(0, 0, 0, 0.8),
        -1px  1px 0 rgba(0, 0, 0, 0.8),
         1px  1px 0 rgba(0, 0, 0, 0.8),
         0px  0px 2px rgba(0, 0, 0, 0.9);
}

.planned-icon {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Today Styling */
.calendar-day.today {
    border: 2px solid #0C2C47;
    background-color: #f8f9ff;
    box-shadow: 0 2px 8px rgba(12, 44, 71, 0.2);
}

.calendar-day.today .date-number {
    color: #0C2C47;
    font-weight: 700;
}

/* Completed Activities */
.calendar-day.completed {
    background-color: #2D5652;
    border: 1px solid #2D5652;
}

.calendar-day.completed .date-number {
    color: white;
    font-weight: 700;
}

/* Planned Activities */
.calendar-day.planned {
    background-color: #E2A54D;
    border: 1px solid #E2A54D;
}

.calendar-day.planned .date-number {
    color: white;
    font-weight: 700;
}

/* Different workout types - remove solid backgrounds, use border colors */
.calendar-day .event.run {
    border-left-color: #2D5652;
    color: #2D5652;
}

.calendar-day .event.bike {
    border-left-color: #96D3CC;
    color: #2D5652;
}

.calendar-day .event.swim {
    border-left-color: #97D3CD;
    color: #0C2C47;
}

.calendar-day .event.strength {
    border-left-color: #0C2C47;
    color: #0C2C47;
}

.chat-interface {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 300px; /* Reduce minimum height */
    font-family: 'Chivo', sans-serif;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px; /* Reduce padding to minimum */
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px; /* Increase margin for better separation */
    min-height: 200px; /* Increased minimum height for better readability */
    max-height: calc(100% - 80px); /* Reduced space reserved for input controls */
    background-color: #fafbfc;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #2D5652;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #0C2C47;
}

.chat-input {
    display: flex;
    flex-direction: column; /* Stack quick actions above input controls */
    gap: 1px; /* Ultra-minimal gap between quick actions and input controls */
    padding: 0 12px 2px 12px; /* Ultra-compact padding for desktop */
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-shrink: 0; /* Prevent shrinking */
    min-height: auto; /* Let height be determined by content */
}

.chat-input-controls {
    display: flex;
    gap: 8px; /* Gap between controls */
    align-items: center;
    width: 100%; /* Take full width */
}

.chat-input-controls input {
    flex-grow: 1; /* Make input field take remaining space */
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 10px 12px; /* Reduce padding slightly */
    font-size: 0.95rem; /* Slightly smaller font */
    font-family: 'Chivo', sans-serif;
    background-color: white;
}

.chat-input-controls button {
    border-radius: 6px;
    padding: 10px 14px; /* Reduce padding more */
    font-size: 0.9rem; /* Smaller font */
    font-weight: 600;
    font-family: 'Chivo', sans-serif;
    background-color: #0C2C47; /* Navy Blue */
    border-color: #0C2C47;
    color: white;
    flex: 0 0 auto; /* Don't allow to shrink */
}

.chat-input-controls button:hover {
    background-color: #2D5652; /* Green */
    border-color: #2D5652;
}

.data-snapshot p, .training-plan p {
    margin-bottom: 6px; /* Reduce margin */
    font-size: 0.95rem; /* Slightly smaller font */
    line-height: 1.4;
    color: #0C2C47;
    font-family: 'Chivo', sans-serif;
}

.data-snapshot i, .training-plan i {
    color: #2D5652;
    margin-right: 8px;
    width: 16px;
}

.data-snapshot strong {
    font-weight: 600;
    color: #0C2C47;
    font-family: 'Chivo', sans-serif;
}

.sidebar {
    border-left: 5px solid #2D5652; /* Green accent */
}

.analysis-content, .chat-placeholder {
    border-left: 5px solid #E2A54D; /* Yellow accent */
}

.data-snapshot, .training-plan {
    border: 1px solid #eee;
}

/* Remove conflicting event styling - handled in specific calendar day states above */

.btn-primary {
    background-color: #0C2C47; /* Navy Blue */
    border-color: #0C2C47;
    border-radius: 16px; /* Match the rounded design */
    padding: 4px 16px; /* Better padding */
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #2D5652; /* Green */
    border-color: #2D5652;
    transform: translateY(-1px); /* Consistent hover effect */
}

.chat-input button {
    background-color: #0C2C47; /* Navy Blue */
    border-color: #0C2C47;
    color: white;
    border-radius: 16px; /* Match the rounded design */
    padding: 4px 16px; /* Better padding */
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Chivo', sans-serif;
}

.chat-input button:hover {
    background-color: #2D5652; /* Green */
    border-color: #2D5652;
    transform: translateY(-1px); /* Consistent hover effect */
}

.alert-info {
    background-color: #97D3CD; /* Aqua */
    color: #0C2C47; /* Navy Blue */
    border-color: #97D3CD;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Chivo', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px; /* Reduce gap */
}

.chat-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    max-width: 85%;
    font-family: 'Chivo', sans-serif;
    line-height: 1.5;
    font-size: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

.user-message {
    background-color: #0C2C47;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: white;
    color: #0C2C47;
    align-self: flex-start;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.thinking-message {
    background-color: #97D3CD;
    color: #0C2C47;
    align-self: flex-start;
    font-style: italic;
    border-bottom-left-radius: 4px;
}

/* Slider Styles */
.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slider-item {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Enable vertical scrolling */
}

.slider-item.active {
    display: block;
}


.plot-slide .card-body {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 4px;  /* Minimal padding to maximize chart space */
    overflow: visible;  /* Allow chart to utilize full space */
    box-sizing: border-box;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 100;
}

/* Hide slider navigation on mobile for cleaner chart display */
@media (max-width: 768px) {
    .slider-btn {
        display: none;
    }
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.chat-input .form-select {
    flex: 0 0 auto; /* Don't grow or shrink */
    font-size: 0.8rem; /* Smaller font */
    font-family: 'Chivo', sans-serif;
    border-radius: 16px; /* Match quick action chips */
    border: 1px solid #ddd;
    padding: 4px 12px; /* Match quick action chips padding */
    background-color: white;
    font-weight: 500; /* Match quick action chips */
    cursor: pointer;
    transition: all 0.2s ease; /* Smooth transitions */
    color: #0C2C47;
    appearance: none; /* Remove default dropdown arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 32px; /* Space for custom arrow */
}

.chat-input .form-select:hover {
    background-color: #0C2C47;
    color: white;
    border-color: #0C2C47;
    transform: translateY(-1px); /* Match quick action chips hover */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.chat-input .form-select:focus {
    outline: none;
    border-color: #2D5652;
    box-shadow: 0 0 0 3px rgba(45, 86, 82, 0.1);
    background-color: #f8f9fa;
}

/* Specific styling for the mode selector (Coach/Analyst) */
.chat-input .form-select:first-of-type {
    max-width: 95px; /* Slightly wider for better text fit */
    min-width: 80px;
}

/* Specific styling for the model selector */
.chat-input .form-select:nth-of-type(2) {
    max-width: 160px; /* Slightly wider for better text fit */
    min-width: 140px;
}

.chat-input .form-check {
    font-family: 'Chivo', sans-serif;
    font-size: 0.75rem; /* Even smaller font */
    color: #0C2C47;
    flex: 0 0 auto; /* Don't grow */
    white-space: nowrap; /* Prevent wrapping */
    margin-right: 0; /* Remove any extra margin */
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bitter', serif;
    color: #0C2C47;
}

.card-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0C2C47;
    margin: 0;
}

/* Enhanced chat welcome message styling */
.chat-messages .alert {
    margin: 0 0 15px 0;
    font-weight: 500;
}

/* Better form styling */
.form-select, .form-control {
    font-family: 'Chivo', sans-serif;
}

/* Global form-select styling improvements */
.form-select {
    border-radius: 16px;
    border: 1px solid #ddd;
    padding: 4px 12px;
    background-color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #0C2C47;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 32px;
    font-family: 'Chivo', sans-serif !important;
    font-size: 0.8rem;
}

.form-select:hover {
    background-color: #0C2C47;
    color: white;
    border-color: #0C2C47;
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Override Bootstrap form-select defaults for consistent styling */
.form-select option {
    background-color: white !important;
    color: #0C2C47 !important;
    padding: 8px 12px;
    font-family: 'Chivo', sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
}

/* Style the dropdown menu itself (when opened) */
.form-select:focus option:checked,
.form-select option:checked {
    background-color: #0C2C47 !important;
    color: white !important;
}

.form-select option:hover {
    background-color: #f8f9fa !important;
    color: #0C2C47 !important;
}

/* Ensure dropdowns work properly on all browsers */
.form-select::-ms-expand {
    display: none; /* Remove default arrow in IE */
}

/* Improved button styling */
.btn {
    font-family: 'Chivo', sans-serif;
    font-weight: 500; /* Consistent with other elements */
    transition: all 0.2s ease;
    border-radius: 16px; /* Consistent rounded corners */
    padding: 4px 12px; /* Consistent padding */
}

.btn:hover {
    transform: translateY(-1px); /* Consistent hover effect */
}

/* Better table styling for workout data */
.table {
    font-family: 'Chivo', sans-serif;
    font-size: 14px;
    margin-bottom: 0;
}

.table th {
    color: #0C2C47;
    font-weight: 700;
    border-bottom: 2px solid #2D5652;
    background-color: #f8f9fa;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 13px;
}

.table td {
    color: #0C2C47;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

/* Workout column (first column) left-aligned for better readability */
.table td:first-child,
.table th:first-child {
    text-align: left;
    min-width: 140px;
}

/* Responsive table container */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(12, 44, 71, 0.1);
}

/* Hover effect for table rows */
.table tbody tr:hover {
    background-color: rgba(45, 86, 82, 0.05);
    transition: background-color 0.2s ease;
}

/* Better spacing for table in card */
.card-body .table-responsive {
    margin: -15px;
    margin-top: 0;
}

/* Zebra striping for better readability */
.table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Ensure all elements are properly contained */
    * {
        box-sizing: border-box;
    }
    
    .calendar-day {
        min-height: 50px;
    }
    
    .calendar-day:hover {
        transform: none; /* Disable transform on mobile to prevent layout issues */
    }
    
    .add-workout {
        opacity: 1; /* Always visible on mobile */
        font-size: 0.9rem;
    }
    
    /* Make add-workout indicators touch-friendly but still minimal on mobile */
    .calendar-day .add-workout-indicator {
        opacity: 0.25; /* Slightly more visible on mobile for touch */
    }
    
    .calendar-day:hover .add-workout-indicator,
    .calendar-day:active .add-workout-indicator {
        opacity: 0.6; /* More subtle than before */
        transform: translate(-50%, -50%); /* No scaling */
    }
    
    .add-workout-icon {
        font-size: 12px; /* Slightly larger for touch but still minimal */
    }
    
    /* Add touch feedback for mobile calendar interactions */
    .calendar-day:active {
        background-color: rgba(45, 86, 82, 0.1);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    .quick-action-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .context-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* Form select mobile improvements */
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 6px 32px 6px 12px;
        font-family: 'Chivo', sans-serif;
        font-weight: 500;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .form-select option {
        font-size: 16px; /* Consistent font size on mobile */
        font-family: 'Chivo', sans-serif;
        font-weight: 500;
        padding: 10px 12px;
    }
    
    .chat-input .form-select {
        font-size: 14px;
        padding: 4px 28px 4px 10px;
        background-size: 14px 10px;
        background-position: right 6px center;
        width: auto;
        max-width: 100%;
    }
    
    .chat-input .form-select option {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Floating Action Button for Mobile Chat */
.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    background-color: #0C2C47;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.7rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(12, 44, 71, 0.4);
    z-index: 1000;
    /* Temporarily show on all screen sizes for debugging */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Force show on mobile - this will override the display: none */
@media (max-width: 768px) {
    .chat-fab {
        display: flex !important;
        z-index: 9999 !important;
    }
}

/* Hide on desktop after mobile is working */
@media (min-width: 769px) {
    .chat-fab {
        display: none !important;
    }
}

.chat-fab:hover {
    background-color: #2D5652;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(45, 86, 82, 0.4);
}

.chat-fab.active {
    display: none !important;
}

/* Mobile Chat Modal */
.mobile-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1001;
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-chat-modal.active {
    display: flex !important;
    transform: translateY(0);
}

.mobile-chat-header {
    background-color: #0C2C47;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    flex-shrink: 0;
}

.mobile-chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.mobile-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
    min-height: 0;
}

.mobile-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
    background-color: #fafbfc;
    min-height: 200px;
}

.mobile-chat-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.mobile-chat-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-chat-controls select {
    flex: 1;
    min-width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mobile-chat-message-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-chat-message-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.mobile-chat-message-input button {
    padding: 12px 16px;
    background-color: #0C2C47;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Contextual Action Buttons */
.context-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .context-actions,
.plot-slide:hover .context-actions {
    opacity: 1;
}

.context-btn {
    background-color: rgba(12, 44, 71, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(8px);
}

.context-btn:hover {
    background-color: #2D5652;
    transform: scale(1.05);
    backdrop-filter: blur(12px);
}

/* Quick Action Chips */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Ultra-minimal gap between buttons */
    margin-bottom: 0; /* Remove bottom margin since it's now inside chat-input */
    padding: 0; /* Remove all padding to eliminate white space */
    background-color: transparent; /* Remove background since chat-input provides it */
    border: none; /* Remove border since chat-input provides it */
    border-radius: 0; /* Remove border radius */
    justify-content: center; /* Center the buttons */
}

.quick-action-chip {
    background-color: #2D5652; /* Use brand-mid color like the other action buttons */
    border: 1px solid #2D5652;
    border-radius: 20px; /* Slightly more rounded */
    padding: 2px 12px; /* Very compact padding for desktop */
    font-size: 0.8rem; /* Compact font size */
    cursor: pointer;
    transition: all 0.2s ease;
    color: white; /* White text on brand color background */
    font-weight: 600; /* Slightly bolder */
    min-height: 24px; /* Very compact height for desktop */
    display: flex;
    align-items: center;
    gap: 6px; /* Space between icon and text */
    margin: 0 4px; /* Minimal margins for compact layout */
}

.quick-action-chip:hover {
    background-color: #0D2C48; /* Use brand-dark on hover */
    color: white;
    border-color: #0D2C48;
    transform: translateY(-1px); /* Subtle lift effect */
}

.quick-action-chip.selected {
    background-color: #2D5652;
    color: white;
    border-color: #2D5652;
}

/* New Chat Button - Minimalist Design */
.new-chat-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 8px;
}

.new-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.new-chat-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.new-chat-icon {
    width: 28px;
    height: 28px;
    display: block;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .new-chat-icon {
        width: 24px;
        height: 24px;
    }
    
    .new-chat-btn {
        padding: 6px;
        margin: 0 4px;
    }
}

/* Main Mobile Responsive Design */
@media (max-width: 768px) {
    /* Force proper mobile container behavior */
    .container, .container-fluid {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        box-sizing: border-box;
        margin: 0 !important;
    }
    
    /* Ensure proper scrolling for mobile */
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }
    
    /* Layout adjustments */
    .plots-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .plot-container {
        min-height: 300px;
    }

    /* Hide desktop chat on mobile */
    .chat-placeholder {
        display: none !important;
    }

    /* Show mobile chat FAB - make sure it's visible */
    .chat-fab {
        display: flex !important;
    }

    /* Ensure mobile chat modal is properly sized */
    .mobile-chat-modal {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for better mobile support */
    }

    .mobile-chat-messages {
        max-height: none;
    }

    /* Touch-friendly context buttons - hide on mobile for cleaner race performance chart */
    .context-actions {
        display: none; /* Completely hide on mobile to prevent bleeding edges */
    }

    .context-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .calendar-day {
        min-height: 50px;
    }
    
    .calendar-day:hover {
        transform: none; /* Disable transform on mobile to prevent layout issues */
    }
    
    .add-workout {
        opacity: 1; /* Always visible on mobile */
        font-size: 0.9rem;
    }
    
    .quick-action-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 32px; /* Restore normal height on mobile */
    }
    
    .context-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    /* Ensure mobile elements are hidden on desktop */
    .chat-fab,
    .mobile-chat-modal {
        display: none !important;
    }
    
    /* Desktop-only ultra-compact chat toolbar */
    .chat-input {
        gap: 0px; /* No gap for desktop */
        padding: 0 12px 1px 12px; /* Ultra-compact padding */
        margin: 0; /* Remove any margin */
        align-items: flex-start; /* Align children to top */
        margin-top: 0; /* No top margin */
    }
    
    .quick-actions {
        gap: 4px; /* Even smaller gap for desktop */
        padding: 0; /* No padding for desktop */
        margin: 0; /* Remove any margin */
        align-items: flex-start; /* Align to top to eliminate space */
        min-height: 22px; /* Match button height */
        line-height: 1; /* Tight line height */
    }
    
    .quick-action-chip {
        padding: 1px 10px; /* Ultra-compact padding for desktop */
        min-height: 22px; /* Ultra-compact height for desktop */
        font-size: 0.75rem; /* Smaller font for desktop */
        margin: 0; /* Remove any margin */
        align-self: flex-start; /* Align to top */
    }
    
    /* Maximize chat messages area on desktop */
    .chat-messages {
        min-height: 300px; /* Larger minimum height on desktop */
        max-height: calc(100% - 50px); /* Minimize space for compact input */
        margin-bottom: 5px; /* Reduce margin for more space */
    }
    
    .chat-interface {
        min-height: 500px; /* Increase overall chat interface height */
    }
}

/* Additional browser-specific fixes for dropdown styling */
.form-select {
    /* Ensure font inheritance */
    font-synthesis: none;
    -webkit-font-feature-settings: normal;
    font-feature-settings: normal;
    font-variant: normal;
}

/* Mobile viewport fixes */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .dashboard-grid {
        overflow-y: visible; /* Allow natural scrolling */
        width: 100%;
        max-width: 100vw; /* Ensure grid doesn't exceed viewport width */
        box-sizing: border-box;
        padding: 4px; /* Minimal padding on mobile */
        gap: 4px; /* Minimal gap to fit better */
        margin: 0;
    }
    
    .analysis-content {
        overflow-y: visible; /* Remove forced scrolling */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px; /* Reduce padding for mobile */
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px; /* Reduce padding for mobile */
    }
    
    /* Ensure calendar is properly visible on mobile */
    .calendar {
        gap: 1px; /* Minimal gaps for better mobile spacing */
        width: 100%;
        max-width: calc(100vw - 20px); /* Account for all parent padding */
        box-sizing: border-box;
        margin: 0 auto;
        overflow: hidden;
    }
    
    .calendar-day {
        min-height: 50px; /* Optimize height for mobile */
        padding: 2px;
        font-size: 0.8rem;
        box-sizing: border-box;
    }
    
    .calendar-day .day-name {
        font-size: 0.65rem;
    }
    
    .calendar-day .date {
        font-size: 0.7rem;
        top: 2px;
        right: 2px;
        padding: 1px 4px;
    }
    
    .calendar-day .event {
        font-size: 0.6rem;
        padding: 1px 2px;
    }
    
    /* Ensure stats grid is properly spaced */
    .stats-grid {
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .data-snapshot, .training-plan {
        padding: 4px;
        width: 100%;
        max-width: calc(100vw - 16px); /* Account for all parent padding */
        box-sizing: border-box;
        margin: 0;
    }
    
    .data-snapshot h3, .training-plan h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .data-snapshot p, .training-plan p {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }
    
    /* Ensure charts fit properly on mobile */
    .slider-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .slider-item {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    .card-body {
        padding: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure Plotly charts are responsive on mobile */
    .plot-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 5px;
    }
    
    .plot-container .plotly-graph-div {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
        box-sizing: border-box;
    }
    
    /* Ensure table is responsive on mobile */
    .table-responsive {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
    }
    
    .table {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
}

/* WebKit browsers (Safari, Chrome) specific fixes */
.form-select::-webkit-calendar-picker-indicator {
    display: none; /* Hide any additional picker indicators */
}

/* Firefox specific fixes */
.form-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #0C2C47;
}

/* Force consistent font rendering */
.form-select,
.form-select option {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   GARMIN BRANDING STYLES
============================================ */

/* Garmin icon in buttons */
.garmin-icon-btn {
    height: 16px;
    width: 16px;
    margin-right: 4px;
    vertical-align: middle;
    display: inline-block;
}

/* Batch sync button - minimal icon-only style */
.batch-sync-btn {
    background: transparent;
    color: #6c757d;
    border: 1px solid transparent;
    padding: 8px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
    margin-right: -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}

.batch-sync-btn:hover {
    background: rgba(0, 125, 188, 0.1);
    color: #007dbc;
}

.batch-sync-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Synced button state */
.workout-download-btn.synced {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.workout-download-btn.synced:hover {
    background: #c3e6cb;
    border-color: #b1dfbb;
}

/* Adjust month navigation to accommodate batch sync button */
.month-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden; /* Prevent overflow on mobile */
}

.month-navigation .current-month {
    flex: 1;
    text-align: center;
}

/* Mobile-specific overflow protection */
@media (max-width: 768px) {
    .batch-sync-btn {
        margin-right: -10px; /* Less aggressive margin on mobile */
    }
    
    .calendar-container {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }
}

/* ===== Garmin Data Attribution (non-intrusive, minimal) ===== */
.data-attribution {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280; /* Muted gray used elsewhere */
    text-align: right;
    line-height: 1.2;
}

.garmin-attribution {
    font-weight: 400; /* Regular weight to stay subtle */
}

/* Ensure chart flexes above caption without overflow */
.plot-slide .plotly-graph-div,
.plot-slide .js-plotly-plot {
    flex: 1 1 auto;
    height: auto !important;      /* Allow caption to occupy space below */
    min-height: 480px !important; /* Keep a comfortable minimum */
}

/* Mobile: left-align attribution for readability */
@media (max-width: 768px) {
    .data-attribution {
        text-align: center;
    }
}
