/**
 * Premium Corporate UX System Styles
 * Perspektif Metal - Apple/Tesla Level Experience
 */

/* ============================================
   INITIAL PAGE STATE (Prevent Flash)
   ============================================ */

html.loading-page body {
    overflow: hidden !important;
}

html.loading-page body > *:not(#premium-loader) {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   PREMIUM LOADER STYLES
   ============================================ */

.premium-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A3038 0%, #0B3A3A 25%, #0D4A4A 50%, #0F5C5C 75%, #0F766E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.premium-loader.loader-fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    animation: loaderContentFadeIn 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes loaderContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loader-logo-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 40px;
}

.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-8px);
    }
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: rgba(20, 184, 166, 0.4);
    border-right-color: rgba(20, 184, 166, 0.4);
    border-radius: 50%;
    animation: loaderRingSpin 2s linear infinite;
}

.loader-ring-secondary {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    border: 1.5px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: loaderRingSpin 2.5s linear infinite reverse;
}

@keyframes loaderRingSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loader-progress-container {
    width: 240px;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin: 0 auto 24px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #14B8A6 0%, #0F766E 100%);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.3);
}

.loader-text {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: loaderTextPulse 2s ease-in-out infinite;
}

.loader-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 16px;
}

.loader-brand-name {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.loader-brand-divider {
    width: 1px;
    height: 20px;
    background: rgba(20, 184, 166, 0.5);
}

.loader-brand-sub {
    font-size: 22px;
    font-weight: 300;
    color: #14B8A6;
    letter-spacing: 5px;
    text-transform: uppercase;
}

@keyframes loaderTextPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0.0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for multiple elements */
.reveal-on-scroll:nth-child(1) { transition-delay: 0ms; }
.reveal-on-scroll:nth-child(2) { transition-delay: 100ms; }
.reveal-on-scroll:nth-child(3) { transition-delay: 200ms; }
.reveal-on-scroll:nth-child(4) { transition-delay: 300ms; }
.reveal-on-scroll:nth-child(5) { transition-delay: 400ms; }
.reveal-on-scroll:nth-child(6) { transition-delay: 500ms; }

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleAnimation 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   ENHANCED BUTTON ANIMATIONS
   ============================================ */

.btn, .hero-cta, .btn-primary-modern, .btn-secondary-modern {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ============================================
   ENHANCED CARD ANIMATIONS
   ============================================ */

.service-card, .value-card, .capability-card-modern,
.intro-feature-card, .service-overview-card {
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ============================================
   SMOOTH SCROLL BEHAVIOR
   ============================================ */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media screen and (max-width: 767px) {
    .loader-logo-container {
        width: 140px;
        height: 140px;
    }

    .loader-logo {
        width: 80px;
        height: 80px;
    }

    .loader-progress-container {
        width: 180px;
    }

    .loader-brand-name,
    .loader-brand-sub {
        font-size: 16px;
        letter-spacing: 3px;
    }

    .loader-text {
        font-size: 10px;
        letter-spacing: 2px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for animations */
.premium-loader,
.loader-ring,
.loader-ring-secondary,
.loader-logo {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .premium-loader {
        transition: none !important;
    }
    
    .loader-logo {
        animation: none !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .premium-loader {
        display: none !important;
    }
}
