/* Galaxy Gym - Main Stylesheet */

/* ===== CSS Variables ===== */
:root {
    --color-bg: #000000;
    --color-accent: #f8ae1f;
    --color-accent-rgb: 248, 174, 31;
    --color-text: #ffffff;
    --color-text-muted: #777777;
    --color-footer-text: #555555;
    --color-overlay: rgba(0, 0, 0, 0.75);
    --color-card-overlay: rgba(0, 0, 0, 0.4);
    
    --font-viking: 'Viking', 'Cinzel', serif;
    --font-orbitron: 'Orbitron', sans-serif;
    --font-inter: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Custom Font - Viking ===== */
@font-face {
    font-family: 'Viking';
    src: url('../fonts/VIKING-N.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-inter);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Hero Section ===== */
.hero-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 100vh;
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Prevent size changes on mobile */
    overflow: hidden;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.6) contrast(1.1);
    transform: scale(1.1);
    /* Prevent any size changes on mobile scroll */
    max-height: 100vh;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.hero-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-wrapper {
    width: 389px;
    max-width: 90vw;
    height: auto;
}

.hero-logo {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
}

.hero-tagline {
    font-family: var(--font-viking);
    font-size: 36px;
    font-weight: 400;
    color: var(--color-accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

/* ===== Services Section ===== */
.services-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
    width: 100%;
    padding: 0;
    background: var(--color-bg);
}

.services-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    min-height: 600px;
}

.service-card {
    position: relative;
    flex: 1;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    contain: layout style paint;
}

.service-card.slide-in-visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover .service-image {
    transform: scale(1.05);
}

.service-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-card-overlay);
    transition: var(--transition-smooth);
}

.service-card:hover .service-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.service-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.service-label h3 {
    font-family: var(--font-orbitron);
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
}

/* ===== Location Section ===== */
.location-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 800px;
    width: 100%;
    padding: 80px 20px;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.location-content {
    text-align: center;
}

.location-title {
    font-family: var(--font-viking);
    font-size: 56px;
    font-weight: 400;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.location-title span {
    display: inline-block;
}

.map-container {
    width: 100%;
    max-width: 960px;
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: grayscale(20%) contrast(1.1);
}

/* ===== Training Section ===== */
.training-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 800px;
    width: 100%;
    padding: 80px 20px;
    background: var(--color-bg);
}

.training-header {
    text-align: center;
    margin-bottom: 60px;
}

.training-title {
    font-family: var(--font-viking);
    font-size: 56px;
    font-weight: 400;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.training-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.training-card {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.training-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
}

.training-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%);
    transition: var(--transition-smooth);
    will-change: transform, filter;
    contain: layout style;
}

.training-card:hover .training-image {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.training-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.training-group {
    font-family: var(--font-inter);
    font-size: 24px;
    font-weight: 650;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.training-time {
    font-family: var(--font-inter);
    font-size: 22px;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: -0.01em;
    line-height: 1.4;
}

/* ===== Footer ===== */
.footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 100px;
    width: 100%;
    padding: 20px;
    background: var(--color-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-footer-text);
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

.footer-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.footer-link span {
    font-family: var(--font-inter);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for cards */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ===== Responsive Design ===== */

/* Tablet (810px - 1199px) */
@media (max-width: 1199px) and (min-width: 810px) {
    .hero-tagline {
        font-size: 32px;
    }
    
    .logo-wrapper {
        width: 320px;
    }
    
    .services-container {
        height: 80vh;
        min-height: 500px;
    }
    
    .service-label h3 {
        font-size: 28px;
    }
    
    .location-title,
    .training-title {
        font-size: 48px;
    }
    
    .map-container {
        height: 482px;
    }
    
    .training-group {
        font-size: 20px;
    }
    
    .training-time {
        font-size: 18px;
    }
    
    .footer-links {
        gap: 30px;
    }
    
    .footer-link span {
        font-size: 20px;
    }
}

/* Mobile (< 810px) */
@media (max-width: 809px) {
    .hero-section {
        /* Full viewport coverage with fixed height to prevent resize */
        height: 850px;
        min-height: unset;
        max-height: 850px;
    }
    
    .hero-bg-img {
        /* Match section height exactly */
        height: 850px;
        min-height: unset;
        max-height: 850px;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .hero-content {
        padding: 10px;
    }
    
    .hero-logo-container {
        gap: 10px;
        margin-top: -20px;
    }
    
    .hero-tagline {
        font-size: 36px;
    }
    
    .logo-wrapper {
        width: 320px;
    }
    
    .services-section {
        padding: 20px 15px 0;
    }
    
    .services-container {
        flex-direction: column;
        height: auto;
        gap: 0;
    }
    
    .service-card {
        height: 180px;
        min-height: unset;
        width: 100% !important;
        flex: none !important;
    }
    
    .service-label {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .service-label h3 {
        font-size: 16px;
    }
    
    .location-section {
        padding: 40px 20px;
    }
    
    .location-title,
    .training-title {
        font-size: 36px;
    }
    
    .map-container {
        height: 300px;
        border-radius: 12px;
    }
    
    .training-section {
        padding: 40px 20px;
    }
    
    .training-header {
        margin-bottom: 40px;
    }
    
    .training-cards {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .training-card {
        width: 100%;
        max-width: 390px;
        min-width: unset;
    }
    
    .training-group {
        font-size: 18px;
    }
    
    .training-time {
        font-size: 14px;
    }
    
    .footer {
        padding: 15px 10px;
    }
    
    .footer-links {
        gap: 10px 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-link {
        gap: 4px;
        flex: 0 0 auto;
        justify-content: center;
    }
    
    .footer-link:nth-child(1),
    .footer-link:nth-child(2),
    .footer-link:nth-child(3) {
        width: calc(33.333% - 8px);
        max-width: 90px;
    }
    
    .footer-link:nth-child(4),
    .footer-link:nth-child(5) {
        width: calc(50% - 6px);
        max-width: 100px;
    }
    
    .footer-link span {
        font-size: 12px;
    }
    
    .footer-icon {
        width: 16px;
        height: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-tagline {
        font-size: 32px;
    }
    
    .logo-wrapper {
        width: 280px;
    }
    
    .location-title,
    .training-title {
        font-size: 28px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-overlay: rgba(0, 0, 0, 0.8);
        --color-card-overlay: rgba(0, 0, 0, 0.6);
    }
}
