/* --- Root Variables for Colors and Spacing --- */
:root {
    --primary-50: #e0f2f7;
    --primary-100: #b3e0f2;
    --primary-200: #87ceeb;
    --primary-300: #64b5f6;
    --primary-400: #42a5f5;
    --primary-500: #2196f3;
    --primary-600: #1e88e5;
    --primary-700: #1976d2;
    --primary-800: #1565c0;
    --primary-900: #0d47a1;

    --secondary-50: #fce4ec;
    --secondary-100: #f48fb1;
    --secondary-200: #f06292;
    --secondary-300: #ec407a;
    --secondary-400: #e91e63;
    --secondary-500: #d81b60;
    --secondary-600: #c2185b;
    --secondary-700: #ad1457;
    --secondary-800: #9c0057;
    --secondary-900: #880e4f;

    --neutral-50: #f8f9fa;
    --neutral-100: #f1f3f5;
    --neutral-200: #e9ecef;
    --neutral-300: #dee2e6;
    --neutral-400: #ced4da;
    --neutral-500: #adb5bd;
    --neutral-600: #6c757d;
    --neutral-700: #495057;
    --neutral-800: #343a40;
    --neutral-900: #212529;

    --success-500: #28a745;
    --warning-500: #ffc107;
    --danger-500: #dc3545;
    --info-500: #17a2b8;

    --border-radius: 0.4rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
}

/* --- General Body Styles (Optional - Adjust as needed) --- */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--neutral-100);
    color: var(--neutral-800);
    margin: 0;
    padding: 0;
}

#root {
    margin: 2rem auto;
    padding: 0 var(--spacing-md);
}

/* --- Card Styles (General) --- */
.card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: var(--spacing-md);
}

.card-header {
    background-color: var(--neutral-100);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--neutral-200);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    justify-content: space-between; /* To align title and actions */
    align-items: center;
}

.week-header {
    cursor: pointer;
    font-size: 1.2rem;
    margin-bottom: 0; /* Remove default margin */
}

.week-actions button {
    margin-left: var(--spacing-sm); /* Space out the buttons */
    font-size: 0.8rem;
}

/* --- Weekly Plan Section --- */
.calendar-week {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Responsive columns with a minimum width */
    gap: 0.5rem;
}

/* --- Day Card --- */
.calendar-day {
    background-color: var(--neutral-50);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--neutral-200);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    min-width: 120px; /* Ensure a minimum width for responsiveness */
}

.calendar-day.is-current {
    border-color: var(--primary-500);
    box-shadow: 0 0.25rem 0.5rem rgba(33, 150, 243, 0.2);
    transform: scale(1.02);
}

.day-name {
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
    color: var(--neutral-700);
}

/* --- Workout Item --- */
.workout-item {
    padding: 0; /* Removed inner padding to extend text to borders */
    font-size: 0.9rem;
    line-height: 1.4;
    border-left: 5px solid var(--primary-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    background-color: transparent;
    border: none;
}

.workout-run {
    border-left-color: #28a745;
}

.workout-bike {
    border-left-color: #007bff;
}

.workout-cross-train {
    border-left-color: #ffc107;
}

.workout-strength {
    border-left-color: #dc3545;
}

.workout-rest {
    border-left-color: #6c757d;
    font-style: italic;
    color: var(--neutral-500);
}

/* --- Edit Mode Styles --- */
.calendar-day.edit-mode {
    cursor: grab;
}

.calendar-day.edit-mode:active {
    cursor: grabbing;
}

.calendar-day.drag-over {
    background-color: var(--primary-100);
}

.being-dragged {
    opacity: 0.5;
}

.workout-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.workout-actions button {
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

/* --- Legend Styles --- */
.legend-compact {
    /* Styles for the compact legend */
    margin-bottom: var(--spacing-md);
}

.legend-compact .row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.legend-compact .col-md-4,
.legend-compact .col-lg-3 {
    flex-basis: calc(50% - 0.5rem); /* Adjust for smaller screens */
}

@media (min-width: 768px) {
    .legend-compact .col-md-4 {
        flex-basis: calc(33.33% - 0.5rem);
    }
}

@media (min-width: 992px) {
    .legend-compact .col-lg-3 {
        flex-basis: calc(25% - 0.5rem);
    }
}

.legend-compact .border {
    border: 1px solid var(--neutral-200) !important;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.legend-compact small {
    display: block; /* Ensure acronym and description are on separate lines if needed */
}

/* Modal styles */
.modal.show {
    display: block;
}

/* AI Modal Styles */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
}

.ai-modal .modal-dialog {
    position: relative;
    z-index: 1051;
}

/* Progress tracking styles */
.week-card {
    cursor: pointer;
}

.achievement-sticker {
    display: flex;
    justify-content: center;
    align-items: center;
}

.achievement-sticker-emoji {
    font-size: 2rem;
}

.progress-summary {
    background-color: var(--neutral-50);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    border-left: 4px solid var(--primary-500);
}

.progress-summary h6 {
    color: var(--primary-700);
    margin-bottom: var(--spacing-sm);
}

.card.border-primary {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
}

/* Achievement card styles */
.achievement-card {
    background: linear-gradient(145deg, #ffd700, #ffa500);
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.achievement-sticker {
    padding: 20px;
    text-align: center;
}

.achievement-sticker-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.activity-totals {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}