/* ============================================
   GYM-URMAH — Advanced Animations & Effects
   ============================================ */

/* ---- Glitch Text Effect on Hero ---- */
.title-line-2 {
    position: relative;
}

.title-line-2::before,
.title-line-2::after {
    content: 'GUERRERO URMAH';
    position: absolute;
    top: 0;
    left: 0;
    background: var(--bg-dark);
    -webkit-background-clip: text;
    overflow: hidden;
}

.title-line-2::before {
    left: 2px;
    text-shadow: -2px 0 var(--primary);
    clip-path: inset(0 0 65% 0);
    animation: glitch-top 3s infinite linear alternate-reverse;
}

.title-line-2::after {
    left: -2px;
    text-shadow: 2px 0 var(--energy);
    clip-path: inset(65% 0 0 0);
    animation: glitch-bottom 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-top {
    0%, 95% { clip-path: inset(0 0 65% 0); transform: translate(0); }
    96% { clip-path: inset(0 0 63% 0); transform: translate(-2px, 1px); }
    97% { clip-path: inset(0 0 67% 0); transform: translate(2px, -1px); }
    98% { clip-path: inset(0 0 64% 0); transform: translate(1px, 0); }
    100% { clip-path: inset(0 0 65% 0); transform: translate(0); }
}

@keyframes glitch-bottom {
    0%, 95% { clip-path: inset(65% 0 0 0); transform: translate(0); }
    96% { clip-path: inset(63% 0 0 0); transform: translate(2px, 1px); }
    97% { clip-path: inset(67% 0 0 0); transform: translate(-2px, -1px); }
    98% { clip-path: inset(64% 0 0 0); transform: translate(-1px, 0); }
    100% { clip-path: inset(65% 0 0 0); transform: translate(0); }
}

/* ---- Card Hover Glow Lines ---- */
.about-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--energy), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.about-card:hover::after {
    opacity: 0.6;
}

/* ---- Animated Border for Featured Pricing ---- */
.pricing-featured::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(
        45deg,
        var(--primary),
        var(--energy),
        var(--gold),
        var(--primary),
        var(--energy)
    );
    background-size: 300% 300%;
    border-radius: var(--radius-xl);
    z-index: -1;
    animation: borderGlow 4s ease infinite;
}

.pricing-featured::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-card);
    border-radius: calc(var(--radius-xl) - 1px);
    z-index: -1;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ---- Floating animation for Urmah energy ---- */
.urmah-energy-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.urmah-energy-particles::before,
.urmah-energy-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--energy);
    box-shadow: 0 0 10px var(--energy-glow);
}

.urmah-energy-particles::before {
    top: 20%;
    left: 30%;
    animation: particleFloat1 4s ease-in-out infinite;
}

.urmah-energy-particles::after {
    top: 60%;
    right: 20%;
    animation: particleFloat2 3s ease-in-out infinite 0.5s;
}

@keyframes particleFloat1 {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    25% { transform: translate(10px, -20px); opacity: 1; }
    50% { transform: translate(-5px, -40px); opacity: 0.5; }
    75% { transform: translate(15px, -25px); opacity: 0.8; }
}

@keyframes particleFloat2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    33% { transform: translate(-15px, -30px); opacity: 1; }
    66% { transform: translate(10px, -20px); opacity: 0.3; }
}

/* ---- Scale In Effect for Facility Cards ---- */
.facility-card {
    animation: none;
}

.facility-card.visible {
    animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- Hover Energy Border on Trainer Cards ---- */
.trainer-card {
    position: relative;
}

.trainer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, var(--primary) 50%, transparent 60%);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.trainer-card:hover::before {
    opacity: 1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ---- Smooth Nav Link Transitions ---- */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 80%, rgba(10, 143, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
}

/* ---- Pricing Card Shine ---- */
.pricing-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.02) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 55%,
        transparent 60%
    );
    transform: rotate(0deg);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.pricing-card:hover::after {
    transform: rotate(180deg);
}

/* ---- Facility Image Zoom on Scroll ---- */
.facility-card.visible .facility-image img {
    animation: subtleZoom 20s ease-in-out infinite alternate;
}

@keyframes subtleZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* ---- Schedule Row Animation ---- */
.schedule-table tbody tr {
    animation: fadeInRow 0.3s ease forwards;
    opacity: 0;
}

.schedule-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.schedule-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.schedule-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.schedule-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.schedule-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.schedule-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.schedule-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.schedule-table tbody tr:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeInRow {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---- Button Ripple ---- */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ---- Info Bar Pulse ---- */
.info-item i {
    animation: iconPulse 3s ease-in-out infinite;
}

.info-item:nth-child(2) i {
    animation-delay: 0.5s;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); text-shadow: 0 0 15px var(--primary-glow); }
}

/* ---- Gold Shimmer for Legend Card ---- */
.pricing-legend {
    position: relative;
    overflow: hidden;
}

.pricing-legend .pricing-card-bg {
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 165, 32, 0.08) 0%, transparent 70%);
}

/* ---- Loading State ---- */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--energy);
}