/* Calendar Showcase Styles — self-contained replica */

.mrt-calendar-container {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    background: #ffffff;
    border: none;
    box-shadow: none;
    border-radius: 20px;
    padding: 24px;
    color: #333333;
    transition: padding-bottom 0.3s ease;
}

.mrt-calendar-container.mrt-calendar-collapsed {
    padding-bottom: 16px;
}

.mrt-calendar-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: normal;
}

.mrt-calendar-label h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: normal;
}

.mrt-calendar-label svg {
    color: #0082fc;
    flex-shrink: 0;
}

.mrt-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    cursor: pointer;
    position: relative;
}

.mrt-calendar-header h2 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mrt-calendar-current-week {
    display: none;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.mrt-calendar-collapsed .mrt-calendar-current-week {
    display: grid;
}

.mrt-calendar-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.mrt-calendar-btn::-moz-focus-inner {
    border: 0;
}

.mrt-calendar-btn:hover,
.mrt-calendar-btn:focus,
.mrt-calendar-btn:focus-visible,
.mrt-calendar-btn:active {
    color: #764ba2;
    transform: scale(1.2);
    opacity: 1;
    background: none !important;
    outline: none;
    box-shadow: none;
}

.mrt-calendar-toggle-icon {
    color: #667eea;
    font-size: 0.8rem;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.mrt-calendar-collapsed .mrt-calendar-toggle-icon {
    transform: rotate(-90deg);
}

.mrt-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #888888;
    margin-bottom: 12px;
}

.mrt-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.mrt-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f2eb;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: default;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    color: #333333;
}

.mrt-day:hover:not(.mrt-day-workout) {
    background: #eeeeee;
    transform: scale(1.02);
}

.mrt-day-workout {
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
    color: #ffffff;
    font-weight: 800;
    box-shadow: none;
    position: relative;
    z-index: 1;
    border: none;
}

.mrt-day-workout:hover {
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
    color: #ffffff;
    transform: translateY(-4px) scale(1.1);
    box-shadow: none;
    z-index: 2;
    border: none;
}

.mrt-workout-dot {
    display: none;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
}

.mrt-day-workout .mrt-workout-dot {
    display: block;
}

.mrt-day-note::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e74c3c'%3E%3Cpath d='M16 9V4l1-1V2H7v1l1 1v5c0 3.39-2 4-2 6h5v7l1 1 1-1v-7h5c0-2-2-2.61-2-6z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.mrt-day-workout.mrt-day-note::before,
.mrt-day-note.mrt-day-workout::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 9V4l1-1V2H7v1l1 1v5c0 3.39-2 4-2 6h5v7l1 1 1-1v-7h5c0-2-2-2.61-2-6z'%3E%3C/path%3E%3C/svg%3E") !important;
}

.mrt-day-reminder {
    border: 1.5px solid #6c5ce7;
    color: #6c5ce7;
    position: relative;
}

.mrt-day-reminder::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 3px;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23feca57'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.mrt-day-reminder.mrt-day-workout {
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
    border: none;
    color: #ffffff;
}

.mrt-day-today.mrt-day-reminder {
    border: 2px solid #6c5ce7;
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.mrt-day-other-month {
    opacity: 0.25;
    cursor: default;
}

.mrt-day-today {
    border: 2px solid #feca57;
    font-weight: 800;
    color: #6c5ce7;
    box-shadow: 0 0 0 2px rgba(254, 202, 87, 0.4);
    position: relative;
    z-index: 1;
}

.mrt-day-today.mrt-day-workout {
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
    border: 2px solid #feca57;
    box-shadow:
        0 0 0 2px rgba(254, 202, 87, 0.4),
        0 8px 16px -4px rgba(0, 210, 211, 0.4);
    color: #ffffff;
}

.mrt-calendar-legend {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #666666;
}

.mrt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mrt-legend-workout {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mrt-legend-workout::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
    border-radius: 4px;
    box-shadow: none;
}

.mrt-legend-note {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mrt-legend-note::before {
    content: "";
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e74c3c'%3E%3Cpath d='M16 9V4l1-1V2H7v1l1 1v5c0 3.39-2 4-2 6h5v7l1 1 1-1v-7h5c0-2-2-2.61-2-6z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
}

.mrt-legend-reminder {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mrt-legend-reminder::after {
    content: "";
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23feca57'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
}

/* Collapsible animation */
.mrt-calendar-collapsible {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
    transition:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.4s ease,
        margin 0.4s ease;
    padding: 16px;
    margin: -16px;
}

.mrt-calendar-collapsed .mrt-calendar-collapsible {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.mrt-calendar-container:not(.mrt-calendar-collapsed) .mrt-calendar-collapsible {
    overflow: visible;
}

/* Dark mode */
html.maxreptracker-dark-mode-enabled .mrt-calendar-container {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html.maxreptracker-dark-mode-enabled .mrt-day {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

html.maxreptracker-dark-mode-enabled .mrt-day:hover:not(.mrt-day-workout) {
    background: rgba(255, 255, 255, 0.15);
}

html.maxreptracker-dark-mode-enabled .mrt-day-today {
    border-color: #feca57;
    background: rgba(254, 202, 87, 0.15);
    box-shadow:
        0 0 0 2px rgba(254, 202, 87, 0.3),
        0 0 20px rgba(254, 202, 87, 0.4),
        0 0 8px rgba(254, 202, 87, 0.2);
}

html.maxreptracker-dark-mode-enabled .mrt-calendar-weekdays {
    color: rgba(255, 255, 255, 0.5);
}

html.maxreptracker-dark-mode-enabled .mrt-day-reminder {
    border-color: #a29bfe !important;
    color: #a29bfe !important;
}

html.maxreptracker-dark-mode-enabled .mrt-day-today.mrt-day-reminder {
    border-color: #a29bfe;
    background: rgba(254, 202, 87, 0.15);
    box-shadow:
        0 0 0 2px rgba(254, 202, 87, 0.3),
        0 0 20px rgba(254, 202, 87, 0.4),
        0 0 8px rgba(254, 202, 87, 0.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mrt-calendar-collapsible {
        transition: none;
    }
    .mrt-calendar-btn,
    .mrt-day,
    .mrt-calendar-toggle-icon {
        transition: none;
    }
    .mrt-day-workout:hover {
        transform: none;
    }
    .mrt-day:hover:not(.mrt-day-workout) {
        transform: none;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .mrt-calendar-container {
        padding: 16px;
    }
    .mrt-calendar-grid {
        gap: 4px;
    }
    .mrt-day {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    .mrt-day-note::before {
        width: 8px;
        height: 8px;
        top: 2px;
        left: 2px;
    }
    .mrt-day-reminder::after {
        width: 8px;
        height: 8px;
        top: 1px;
        right: 2px;
    }
    .mrt-workout-dot {
        width: 3px;
        height: 3px;
        bottom: 2px;
    }
}

@media (max-width: 360px) {
    .mrt-calendar-container {
        padding: 12px;
    }
    .mrt-day {
        font-size: 0.75rem;
    }
}
