/* MaxRepTracker AI Frontend Core Styles */
/* Contains: AI tips, animations, loading states, debug mode */

/* Global MRT Tap Highlight Reset */
[class^="mrt-"],
[class*=" mrt-"] {
    -webkit-tap-highlight-color: transparent;
}

/* AI SVG Icons */
.mrt-ai-icon {
    display: inline-block;
    vertical-align: text-bottom;
    position: relative;
    top: -1px;
}

/* AI Tip Components */
.mrt-ai-tip {
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #cbd5e0;
    background: #ffffff;
    transition: all 0.3s ease;
}

/* Coach Label */
/* Coach Label */
.mrt-ai-coach-label {
    display: block;
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 0.8em;
    font-weight: 600;
}

/* Breathing Glow Animations */
@keyframes aiBreathingDefault {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(102, 126, 234, 0.2),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px rgba(102, 126, 234, 0.35),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

@keyframes aiBreathingStrength {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(16, 185, 129, 0.25),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px rgba(16, 185, 129, 0.4),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

@keyframes aiBreathingHypertrophy {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(59, 130, 246, 0.25),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px rgba(59, 130, 246, 0.4),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

@keyframes aiBreathingEndurance {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(239, 68, 210, 0.25),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px rgba(239, 68, 210, 0.4),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

.mrt-ai-tip.active {
    border-radius: 10px;
    padding: 20px;
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow:
        0 0 20px rgba(102, 126, 234, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: aiBreathingDefault 3s ease-in-out infinite;
}

/* Phase-specific gradient colors for AI Coach (when mode is "form") */
.mrt-ai-tip.active.phase-strength {
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.25),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: aiBreathingStrength 3s ease-in-out infinite;
}

.mrt-ai-tip.active.phase-hypertrophy {
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow:
        0 0 20px rgba(59, 130, 246, 0.25),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: aiBreathingHypertrophy 3s ease-in-out infinite;
}

.mrt-ai-tip.active.phase-endurance {
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow:
        0 0 20px rgba(239, 68, 210, 0.25),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: aiBreathingEndurance 3s ease-in-out infinite;
}

/* Respect user's motion preferences for accessibility */
@media (prefers-reduced-motion: reduce) {
    .mrt-ai-tip.active,
    .mrt-ai-tip.active.phase-strength,
    .mrt-ai-tip.active.phase-hypertrophy,
    .mrt-ai-tip.active.phase-endurance {
        animation: none;
    }
}

/* Loading States */
.mrt-ai-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.mrt-ai-loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Blur Reveal Animation */
@keyframes mrtBlurReveal {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(10px) scale(0.98);
        text-shadow: 0 0 15px rgba(118, 75, 162, 0.5); /* Magical glow */
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
        text-shadow: none;
    }
}

.mrt-reveal-item {
    opacity: 0; /* Start hidden */
    animation: mrtBlurReveal 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Shimmer Skeleton Loader */
.mrt-ai-skeleton-line {
    height: 14px;
    margin-bottom: 12px;
    border-radius: 4px;
    background: #f0f0f0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    opacity: 0.7;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Debug Mode Styles */
.mrt-ai-debug {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.mrt-ai-debug-header {
    background: #ffc107;
    color: #856404;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mrt-ai-debug-header:hover {
    background: #ffca2c;
}

.mrt-debug-toggle {
    margin-left: auto;
    transition: transform 0.3s ease;
}

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

.mrt-ai-debug-content {
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
    transition:
        max-height 0.3s ease,
        padding 0.3s ease;
}

.mrt-debug-collapsed {
    max-height: 0 !important;
    padding: 0 16px !important;
    overflow: hidden !important;
}

.mrt-debug-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mrt-debug-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mrt-debug-section strong {
    display: block;
    color: #856404;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.mrt-debug-section pre {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    overflow-x: auto;
    font-family: "Courier New", monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: #3a3a3a;
    max-height: 300px;
    overflow-y: auto;
}
