/* typography */
:root {
    --font-serif: 'Newsreader', serif;
    --font-sans: 'Inter Tight', sans-serif;
}

body { 
    background-color: #000000; 
    color: #FFFFFF; 
    font-family: var(--font-sans); 
    scroll-behavior: smooth; 
    position: relative;
    line-height: 1.6;
}

h1, h2, h3, h4, .font-headline {
    font-family: var(--font-serif);
    font-weight: 600;
}

/* ... existing body::before noise ... */

/* [NEW] LIVE BADGE - HEADER VERSION */
#next-training {
    display: none; /* Shown via JS */
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

#next-training.is-visible {
    display: flex;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #666;
    position: relative;
}

.status-dot.active {
    background-color: #ff3b30; /* Matrix Red */
    box-shadow: 0 0 10px #ff3b30;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.next-training-label {
    font-size: 9px;
    letter-spacing: 0.15em;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
}

.next-training-text {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Remove old float styles if they exist or overwrite them */
.whatsapp-float {
    bottom: 2rem;
    right: 2rem;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Navigation */
.glass-nav { 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    background-color: rgba(0, 0, 0, 0); 
    border-bottom: 1px solid rgba(255, 255, 255, 0);
    transition: background-color 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
    will-change: transform, background-color, backdrop-filter;
}

.glass-nav.scrolled {
    background-color: rgba(0, 0, 0, 0.86);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#mobile-menu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hero Elements */
.hero-gradient-cinematic { 
    background: linear-gradient(
        to top, 
        rgba(0,0,0,1) 0%, 
        rgba(0,0,0,0.9) 15%, 
        rgba(0,0,0,0.7) 40%, 
        rgba(0,0,0,0.55) 65%, 
        rgba(0,0,0,0.5) 100%
    ); 
}

.hero-text-shadow { 
    text-shadow: 0 4px 40px rgba(0,0,0,0.9), 0 2px 10px rgba(0,0,0,0.8); 
}

/* Funnel & Conversion */
.cta-gradient { 
    background: linear-gradient(135deg, #d81e25 0%, #8b0000 50%, #1a0000 100%); 
}

/* Float Elements */
.whatsapp-float { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 100; 
}

@media (max-width: 767px) {
    .whatsapp-float {
        bottom: 20px;
        right: 16px;
    }
    .whatsapp-float > div {
        width: 52px;
        height: 52px;
    }
    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}

/* Effects & Hover */
.grayscale-hover { 
    filter: grayscale(100%); 
    transition: filter 0.5s ease; 
}

.grayscale-hover:hover { 
    filter: grayscale(0%); 
}

/* Gallery - Masonry */
.gallery-item { 
    break-inside: avoid; 
    margin-bottom: 1.5rem; 
}

.masonry-gallery { 
    column-count: 2; 
    column-gap: 1.5rem; 
}

@media (min-width: 768px) { 
    .masonry-gallery { column-count: 3; } 
}

@media (min-width: 1024px) { 
    .masonry-gallery { column-count: 4; } 
}

/* Gallery - Bento Grid */
.gallery-bento {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.bento-item {
    position: relative;
    min-height: 280px;
}

.bento-item img,
.bento-item video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .gallery-bento {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 320px;
    }
    .bento-wide { grid-column: span 2; }
    .bento-tall { grid-row: span 2; }
    .bento-full { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
    .bento-item { min-height: 240px; }
    .gallery-bento { gap: 3px; }
}

/* Google Reviews - Profile Photo Fix */
.sk-ww-google-reviews .sk-reviewer-avatar img,
.sk-ww-google-reviews img[src*="googleusercontent"],
.sk-ww-google-reviews img[src*="lh3.google"] {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 44px !important;
    max-width: 44px !important;
}

.sk-ww-google-reviews .sk-reviewer-avatar,
.sk-ww-google-reviews [class*="avatar"] {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* bSport Widget Integration (Dark Mode Overrides) */
.bsport-container { 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    background: rgba(255, 255, 255, 0.02); 
    overflow-x: hidden; 
}

.bsport-container .mat-toolbar,
.bsport-container .mat-sidenav-content,
.bsport-container .mat-card,
.bsport-container .mat-dialog-container { 
    background-color: #0e0e0e !important; 
    color: #e2e2e2 !important; 
}

.bsport-container .mat-button, 
.bsport-container .mat-raised-button { 
    color: #e2e2e2 !important; 
}

/* Animations & Transitions */
[data-aos] {
    pointer-events: none;
}
.aos-animate {
    pointer-events: auto;
}

/* Custom Micro-Interactions */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(216, 30, 37, 0.25);
}

.reveal-text {
    overflow: hidden;
}

.reveal-text span {
    display: block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-text.active span {
    transform: translateY(0);
}

/* Image reveal effect */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #d81e25;
    transform: translateX(-101%);
    z-index: 2;
}

.img-reveal.active::after {
    animation: reveal-swipe 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes reveal-swipe {
    0% { transform: translateX(-101%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(101%); }
}

/* Loading state */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Photo Sequence Crossfade === */
.photo-sequence {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.photo-sequence img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: crossfade3 12s ease-in-out infinite;
}

.photo-sequence img:nth-child(1) { animation-delay: 0s; }
.photo-sequence img:nth-child(2) { animation-delay: 4s; }
.photo-sequence img:nth-child(3) { animation-delay: 8s; }

@keyframes crossfade3 {
    0%    { opacity: 0; }
    4%    { opacity: 1; }
    33%   { opacity: 1; }
    37%   { opacity: 0; }
    100%  { opacity: 0; }
}

/* === Hero Video Background === */
.hero-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.hero-video-wrap .hero-video-fallback {
    display: none;
}

/* Mobile: video plays on all devices (playsinline + muted required for iOS) */

/* === Expanded Community Gallery (Über uns) === */
.community-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

@media (min-width: 768px) {
    .community-gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 280px;
    }
    .community-gallery .cg-wide {
        grid-column: span 2;
    }
}

.community-gallery .cg-item {
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.community-gallery .cg-item img,
.community-gallery .cg-item .cg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.community-gallery .cg-item img {
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.7s ease, transform 1s ease;
}

.community-gallery .cg-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Video in community gallery */
.community-gallery .cg-item .cg-video {
    object-fit: cover;
    filter: grayscale(80%) brightness(0.9);
    transition: filter 0.7s ease, transform 1s ease;
}

.community-gallery .cg-item:hover .cg-video {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* === Podium Collage (under trainer photo) === */
.podium-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-top: 3px;
}

.podium-collage-item {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.podium-collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
    filter: grayscale(70%) brightness(0.85);
    transition: filter 0.7s ease, transform 0.8s ease;
}

.podium-collage-item:hover img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.08);
}

@media (max-width: 767px) {
    .podium-collage-item {
        height: 120px;
    }
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Preloader (#3)
   ═══════════════════════════════════════════ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader-logo {
    width: 140px;
    height: auto;
    animation: preloader-pulse 1.5s ease-in-out infinite;
    filter: invert(1);
}

@keyframes preloader-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1); }
}

.preloader-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.no-scroll {
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Scroll Progress Bar (#4)
   ═══════════════════════════════════════════ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #d81e25;
    z-index: 99998;
    transition: width 0.05s linear;
    will-change: width;
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Scroll Animations (#1)
   ═══════════════════════════════════════════ */
[data-animate] {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-in"] {
    transform: none;
}

[data-animate="slide-left"] {
    transform: translateX(-40px);
}

[data-animate="slide-right"] {
    transform: translateX(40px);
}

[data-animate="scale-in"] {
    transform: scale(0.92);
}

[data-animate].is-visible {
    opacity: 1;
    transform: none;
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Page Transitions (#7)
   ═══════════════════════════════════════════ */
#page-transition {
    position: fixed;
    inset: 0;
    z-index: 99997;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#page-transition.transition-active {
    opacity: 1;
    pointer-events: all;
}

body.page-loaded {
    animation: page-fade-in 0.3s ease forwards;
}

@keyframes page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Custom Cursor (#9)
   ═══════════════════════════════════════════ */
.matrix-cursor {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(216, 30, 37, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99996;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    mix-blend-mode: difference;
}

.matrix-cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #d81e25;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99996;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}

.matrix-cursor.cursor-hover {
    width: 56px;
    height: 56px;
    border-color: rgba(216, 30, 37, 0.8);
    background-color: rgba(216, 30, 37, 0.08);
}

.matrix-cursor-dot.cursor-hover {
    width: 0;
    height: 0;
    opacity: 0;
}

/* Hide custom cursor on touch devices */
@media (hover: none) {
    .matrix-cursor,
    .matrix-cursor-dot {
        display: none !important;
    }
}

/* When custom cursor is active, hide default */
body:has(.matrix-cursor) {
    cursor: none;
}

body:has(.matrix-cursor) a,
body:has(.matrix-cursor) button,
body:has(.matrix-cursor) [role="button"],
body:has(.matrix-cursor) input,
body:has(.matrix-cursor) textarea,
body:has(.matrix-cursor) select,
body:has(.matrix-cursor) details summary {
    cursor: none;
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Next Training Badge (#10)
   ═══════════════════════════════════════════ */
#next-training {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 90;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    max-width: 240px;
}

#next-training.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767px) {
    #next-training {
        bottom: 80px;
        right: 16px;
        max-width: 200px;
        padding: 10px 14px;
    }
}

/* ═══════════════════════════════════════════
   ENHANCEMENT: Reduced Motion
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .preloader-logo { animation: none; }
    .matrix-cursor, .matrix-cursor-dot { display: none; }
    #page-transition { transition: none; }
    body.page-loaded { animation: none; }
}
