.mrt-results-container {
    width: 100%;
    margin: 15px 0;
    background: transparent;
}

.mrt-results-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-bottom: 20px;
}

.mrt-result-card {
    background: #ffffff;
    border: 1px solid var(--mrt-border-light, #e2e8f0);
    border-radius: var(--mrt-radius, 18px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    overflow: hidden;
}

.mrt-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mrt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 8px;
    border-bottom: 1px solid var(--mrt-border-light, #e2e8f0);
}

.mrt-exercise-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.mrt-exercise-detail {
    font-size: 0.7rem;
    color: #718096;
    font-weight: 400;
}

.mrt-exercise-date {
    font-size: 0.8rem;
    color: #718096;
}

.mrt-card-body {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mrt-card-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.mrt-stat {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.mrt-stat-label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
}

.mrt-stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

.mrt-stat-maxrep .mrt-stat-value {
    color: var(--mrt-reps-color, #3182ce);
}

.mrt-stat-weight .mrt-stat-value {
    color: var(--mrt-weight-color, #dd6b20);
}

html.maxreptracker-dark-mode-enabled .mrt-stat-maxrep .mrt-stat-value,
body.dark-mode .mrt-stat-maxrep .mrt-stat-value {
    color: var(--mrt-reps-color, #3182ce) !important;
}

html.maxreptracker-dark-mode-enabled .mrt-stat-weight .mrt-stat-value,
body.dark-mode .mrt-stat-weight .mrt-stat-value {
    color: var(--mrt-weight-color, #dd6b20) !important;
}

.mrt-card-footer {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--mrt-bg-tertiary, #edf2f7);
    padding: 10px;
}

.mrt-footer-action {
    color: var(--mrt-primary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--mrt-radius);
    transition: background 0.2s;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}

.mrt-footer-action:hover,
.mrt-footer-action:focus {
    background-color: #f7fafc;
    color: var(--mrt-primary-hover);
    outline: none;
}

.mrt-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.mrt-category-header h6 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: "Inter", "Outfit", sans-serif;
    line-height: normal;
}

.mrt-category-header h6 span {
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

.mrt-category-header h6 svg {
    color: #0082fc;
    flex-shrink: 0;
}

/* Expandable Search Box */
.mrt-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px;
}

.mrt-search-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    border-radius: 50%;
    position: relative;
}

.mrt-search-wrapper.expanded .mrt-search-trigger {
    opacity: 0;
    pointer-events: none;
}

.mrt-search-trigger:hover {
    color: var(--mrt-primary, #4299e1);
    background-color: rgba(66, 153, 225, 0.1);
}

.mrt-search-expandable {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: transparent;
    border-radius: 20px;
    display: flex;
    align-items: center;
    transition:
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.3s ease,
        box-shadow 0.3s ease;
    overflow: hidden;
    z-index: 5;
    border: 1px solid transparent;
}

.mrt-search-wrapper.expanded .mrt-search-expandable {
    width: 250px;
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 15; /* Above trigger */
}

.mrt-search-icon-inner {
    display: none;
}

.mrt-search-wrapper.expanded .mrt-search-icon-inner {
    display: none;
}

.mrt-search-box {
    border: none !important;
    background: transparent;
    width: 100%;
    height: 100%;
    padding: 0 40px 0 15px; /* Right for clear, Standard left padding */
    outline: none;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    color: #2d3748;
}

.mrt-search-wrapper.expanded .mrt-search-box {
    opacity: 1;
    pointer-events: auto;
}

.mrt-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px; /* Reduced padding for tighter fit */
    opacity: 0;
    transition:
        opacity 0.2s,
        color 0.2s;
    -webkit-tap-highlight-color: transparent;
    z-index: 20;
}

.mrt-search-clear:hover {
    color: #e53e3e;
}

.mrt-search-wrapper.expanded .mrt-search-clear.visible {
    opacity: 1;
}

@media (max-width: 480px) {
    .mrt-search-wrapper.expanded .mrt-search-expandable {
        width: 200px;
    }
}

.mrt-category-filters {
    margin-top: 15px;
    margin-bottom: 10px;
    background: #f7fafc;
    padding: 15px;
    border-radius: var(--mrt-radius);
    border: 1px solid #e2e8f0;
    gap: 8px;
}

.mrt-category-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mrt-category-filter-btn {
    padding: 8px 15px;
    border: 1px solid #cbd5e0;
    background: #edf2f7;
    border-radius: var(--mrt-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: #4a5568 !important;
}

.mrt-category-filter-btn:hover {
    background: var(--mrt-primary) !important;
    color: white !important;
    border-color: var(--mrt-primary);
}

.mrt-category-filter-btn.active {
    background: var(--mrt-primary);
    color: white !important;
    border-color: var(--mrt-primary);
}

.mrt-history-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-bottom: 20px;
}

.mrt-history-card {
    background: #ffffff;
    border: 1px solid var(--mrt-border-light, #e2e8f0);
    border-radius: var(--mrt-radius, 18px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    overflow: hidden;
}

.mrt-history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mrt-history-card-header {
    padding: 12px 15px;
    background: var(--mrt-bg-secondary, #f7fafc);
    border-bottom: 1px solid var(--mrt-bg-tertiary, #edf2f7);
    font-weight: 600;
    color: #2d3748;
    text-align: center;
}

.mrt-history-card-body {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.mrt-history-card-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--mrt-bg-tertiary, #edf2f7);
    background: var(--mrt-bg-secondary, #f7fafc);
    display: flex;
    justify-content: center;
    gap: 15px;
}

.mrt-back-link {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    border: 1px solid #969696;
    border-radius: var(--mrt-radius);
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.mrt-show-more-container {
    text-align: center;
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.mrt-show-more-btn,
.mrt-show-less-btn {
    background: var(--mrt-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--mrt-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    font-weight: 500;
}

.mrt-show-more-btn:hover {
    background: var(--mrt-primary-hover);
}

.mrt-show-less-btn {
    background: #a0aec0;
}

.mrt-show-less-btn:hover {
    background: #718096;
}

.mrt-no-entries {
    grid-column: 1/-1;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--mrt-radius);
    padding: 40px 20px;
    text-align: center;
    color: #718096;
}

.mrt-no-entries h3 {
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 600;
}

.mrt-no-entries .button {
    background: var(--mrt-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--mrt-radius);
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
    font-weight: 500;
}

.mrt-no-entries .button:hover {
    background: var(--mrt-primary-hover);
}

.mrt-arrow.up {
    color: #10b981;
}
.mrt-arrow.down {
    color: #ef4444;
}
.mrt-arrow.same {
    color: #6b7280;
}

@media (max-width: 768px) {
    .mrt-results-grid,
    .mrt-history-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mrt-category-filter-buttons {
        justify-content: center;
    }

    .mrt-category-filter-btn {
        flex: 1 1 45%;
        text-align: center;
        padding: 10px 0;
        font-size: 0.8rem;
    }

    .mrt-show-more-container {
        flex-direction: column;
        align-items: center;
    }

    .mrt-history-actions {
        flex-direction: column;
        gap: 8px;
    }

    .mrt-back-link {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }

    .mrt-show-more-btn,
    .mrt-show-less-btn {
        width: 100%;
        max-width: 300px;
        padding: 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mrt-card-body,
    .mrt-history-card-body {
        padding: 12px;
    }

    .mrt-stat-value {
        font-size: 1.2rem;
    }

    .mrt-category-filter-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .mrt-history-actions {
        gap: 6px;
    }

    .mrt-back-link {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Visibility Toggle Button */
.mrt-visibility-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 6px 8px;
    color: #718096;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}

.mrt-visibility-toggle:hover,
.mrt-visibility-toggle:focus {
    color: var(--mrt-primary);
    transform: scale(1.1);
    outline: none;
}

/* ====================================
   HISTORY TOOLBAR (Modern Mobile Style) - Moved to Shared Design
   ==================================== */

/* ====================================
   DARK MODE SUPPORT
   ==================================== */

html.maxreptracker-dark-mode-enabled .mrt-result-card,
body.dark-mode .mrt-result-card,
html.maxreptracker-dark-mode-enabled .mrt-history-card,
body.dark-mode .mrt-history-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--mrt-dark-border, rgba(255, 255, 255, 0.1));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html.maxreptracker-dark-mode-enabled .mrt-card-header,
body.dark-mode .mrt-card-header,
html.maxreptracker-dark-mode-enabled .mrt-history-card-header,
body.dark-mode .mrt-history-card-header {
    background: transparent;
    border-bottom-color: var(--mrt-dark-border, rgba(255, 255, 255, 0.1));
}

html.maxreptracker-dark-mode-enabled .mrt-card-footer,
body.dark-mode .mrt-card-footer,
html.maxreptracker-dark-mode-enabled .mrt-history-card-footer,
body.dark-mode .mrt-history-card-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: var(--mrt-dark-border, rgba(255, 255, 255, 0.1));
}

html.maxreptracker-dark-mode-enabled .mrt-exercise-name,
body.dark-mode .mrt-exercise-name,
html.maxreptracker-dark-mode-enabled .mrt-history-card-header,
body.dark-mode .mrt-history-card-header {
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-exercise-detail,
html.maxreptracker-dark-mode-enabled .mrt-exercise-date,
html.maxreptracker-dark-mode-enabled .mrt-stat-label,
body.dark-mode .mrt-exercise-detail,
body.dark-mode .mrt-exercise-date,
body.dark-mode .mrt-stat-label {
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled .mrt-stat-value,
body.dark-mode .mrt-stat-value {
    color: #f1f5f9;
}

html.maxreptracker-dark-mode-enabled .mrt-category-header h6,
body.dark-mode .mrt-category-header h6 {
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled .mrt-no-entries,
body.dark-mode .mrt-no-entries {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--mrt-dark-border, rgba(255, 255, 255, 0.1));
}

html.maxreptracker-dark-mode-enabled .mrt-no-entries h3,
body.dark-mode .mrt-no-entries h3 {
    color: #e2e8f0;
}
