/* ==============================
   WORKOUT HISTORY MODAL - DEDICATED STYLES
   ============================== */

/* Ensure modal content provides consistent width reference */
.standard-modal-body {
    --workout-item-max-width: min(700px, calc(100vw - 64px));
}

/* Constrain history content container to match workout items width */
#history-content-container {
    max-width: min(700px, calc(100vw - 64px));
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Ensure all sections provide full width to their children */
#last-week-section,
#monthly-weeks-section,
.history-section {
    width: 100%;
}

/* History workout item - Direct dynamic width approach */
.history-workout-item {
    border-radius: 28px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
    padding: 16px;

    /* Use container width with margins, not viewport width */
    width: calc(100% - 16px);
    max-width: 700px;
    margin: 0 auto 16px auto;

    /* Ensure consistent block display */
    display: block;
}

.history-workout-item:hover {
    background-color: #2d2d2d;
    transform: translateY(-1px);
}

/* History workout header */
.history-workout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.history-workout-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex: 1;
}

.history-workout-date {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 500;
}

/* History workout details */
.history-workout-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* Week title styling */
.history-week-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f3f4f6;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #374151;
}

.history-week-title::before {
    font-size: 0.9rem;
}

/* Mobile layout adjustments - content only, width handled dynamically above */
@media (max-width: 768px) {
    .history-workout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .history-workout-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* All parent containers - ensure consistent width allowance for children */
.history-workouts-container,
.history-weeks-container,
.history-week-group,
#last-week-workouts,
#monthly-weeks-container,
#last-week-section,
#monthly-weeks-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    /* Ensure containers don't constrain children width */
    min-width: 0;
    overflow: visible;
}

/* Container-specific spacing */
.history-workouts-container {
    gap: 12px;
}

.history-weeks-container {
    gap: 24px;
}

.history-week-group {
    gap: 16px;
    margin-bottom: 24px;
    /* Remove any padding to align with other sections */
    padding: 0;
}

/* History bottom container - holds icons and duration */
.history-workout-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 0;
}

/* History bottom icons - single horizontal row */
.history-bottom-icons {
    flex-wrap: nowrap !important;
    display: flex;
    align-items: center;
    gap: 8px;
}