/* 
   Matrix BJJ - Global Styles
   Minimalist, High-Contrast, Premium Cine-Aesthetic
*/

/* Core Fixes */
body { 
    background-color: #000000; 
    color: #FFFFFF; 
    font-family: 'Inter', sans-serif; 
    scroll-behavior: smooth; 
    position: relative;
}

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; 
}

/* 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: show poster image instead of video to save data */
@media (max-width: 767px) {
    .hero-video-wrap video {
        display: none;
    }
    .hero-video-wrap .hero-video-fallback {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: brightness(0.7);
    }
}

/* === 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;
    }
}
