/* ==========================================================================
   IRONPULSE FITNESS - CUSTOM PREMIUM STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --bg-dark: #0B0B0B;
    --card-dark: #161616;
    --card-dark-hover: #222222;
    --primary-red: #FF2D2D;
    --primary-red-glow: rgba(255, 45, 45, 0.4);
    --accent-green: #39FF14;
    --accent-green-glow: rgba(57, 255, 20, 0.4);
    --text-light: #FFFFFF;
    --text-muted: #8A8A8A;
    --glass-bg: rgba(22, 22, 22, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 45, 45, 0.3);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
}

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

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

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
    box-shadow: 0 0 10px var(--primary-red);
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--accent-green) 100%);
    z-index: 100;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Glassmorphism Styles */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 45, 45, 0.1);
}

.glass-nav {
    background: rgba(11, 11, 11, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Neon Glows */
.text-glow-red {
    text-shadow: 0 0 10px var(--primary-red-glow), 0 0 20px rgba(255, 45, 45, 0.2);
}

.text-glow-green {
    text-shadow: 0 0 10px var(--accent-green-glow), 0 0 20px rgba(57, 255, 20, 0.2);
}

.border-glow-red {
    box-shadow: 0 0 15px var(--primary-red-glow);
}

.border-glow-green {
    box-shadow: 0 0 15px var(--accent-green-glow);
}

.glow-btn-red {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.glow-btn-red::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 45, 45, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.glow-btn-red:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.glow-btn-red:hover {
    box-shadow: 0 0 20px var(--primary-red-glow);
    transform: translateY(-2px);
}

/* Background Glowing Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.orb-red {
    background: var(--primary-red);
    width: 400px;
    height: 400px;
}

.orb-green {
    background: var(--accent-green);
    width: 350px;
    height: 350px;
}

/* Scroll Reveal System */
.scroll-reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Children Transitions */
.stagger-container > *:nth-child(1) { transition-delay: 100ms; }
.stagger-container > *:nth-child(2) { transition-delay: 200ms; }
.stagger-container > *:nth-child(3) { transition-delay: 300ms; }
.stagger-container > *:nth-child(4) { transition-delay: 400ms; }
.stagger-container > *:nth-child(5) { transition-delay: 500ms; }
.stagger-container > *:nth-child(6) { transition-delay: 600ms; }

/* Before/After Comparison Image Slider */
.ba-slider {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

@media (max-width: 640px) {
    .ba-slider {
        height: 300px;
    }
}

.ba-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.ba-before {
    z-index: 1;
}

.ba-after {
    z-index: 2;
    width: 50%; /* JS will control this */
    border-right: 3px solid var(--primary-red);
}

.ba-handle {
    position: absolute;
    top: 0;
    left: 50%; /* JS will control this */
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: 205px; /* (slider-height / 2) - 20px */
    border-radius: 50%;
    background: var(--primary-red);
    box-shadow: 0 0 15px var(--primary-red-glow);
    z-index: 3;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: transform 0.2s ease;
}

@media (max-width: 640px) {
    .ba-handle {
        margin-top: 130px;
    }
}

.ba-handle:hover {
    transform: scale(1.1);
}

.ba-handle::before, .ba-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.ba-handle::before {
    border-right: 8px solid var(--text-light);
    left: 8px;
}

.ba-handle::after {
    border-left: 8px solid var(--text-light);
    right: 8px;
}

/* Floating Scroll Indicator Animation */
@keyframes scrollIndicator {
    0% { transform: translateY(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

.scroll-indicator-dot {
    animation: scrollIndicator 2s infinite ease-in-out;
}

/* Workout Timer Circular Progress */
.timer-svg {
    transform: rotate(-90deg);
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: var(--primary-red);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* Testimonial Slider Transitions */
.testimonial-slide {
    display: none;
    transition: opacity 0.5s ease-in-out;
}

.testimonial-slide.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Popup Core */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Custom Checkbox Red / Neon Green Styling */
.custom-checkbox {
    accent-color: var(--primary-red);
}

/* Live Chat Widget Styles */
.chat-widget-btn {
    box-shadow: 0 4px 20px rgba(255, 45, 45, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-widget-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.chat-box {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-box.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chat-bubble {
    border-radius: 12px;
    max-width: 80%;
}

.chat-bubble-trainer {
    background: var(--card-dark);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.chat-bubble-user {
    background: var(--primary-red);
    color: var(--text-light);
    margin-left: auto;
}

/* Loading Overlay Animation */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-bar {
    width: 150px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-red), var(--accent-green));
    position: absolute;
    left: 0;
    top: 0;
    animation: loaderAnim 2s infinite cubic-bezier(0.65, 0.05, 0.36, 1);
}

@keyframes loaderAnim {
    0% { width: 0; left: 0; }
    50% { width: 100%; left: 0; }
    100% { width: 0; left: 100%; }
}

/* BMI Gauge styles */
.bmi-gauge-track {
    height: 10px;
    background: linear-gradient(90deg, #38BDF8 0%, #34D399 30%, #FBBF24 60%, #EF4444 100%);
    border-radius: 5px;
    position: relative;
}

.bmi-pointer {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 20px;
    background: #FFFFFF;
    border: 1px solid #000;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    transform: translateX(-50%);
    transition: left 0.5s ease-out;
}

/* Card hover glow states */
.glow-card {
    transition: all 0.3s ease;
}
.glow-card:hover {
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.15);
    border-color: rgba(57, 255, 20, 0.4);
}
