/**
 * PT Aliyah Mudahari Sejahtera
 * Custom Styles & Animations
 * 
 * Only for styles not covered by Tailwind CSS
 */

/* ============================================ */
/* NAVBAR - CTI STYLE (Transparent → Solid)     */
/* ============================================ */
#navbar {
    background: transparent;
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(30, 64, 175, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================ */
/* ROOT VARIABLES - LIGHT PROFESSIONAL THEME    */
/* ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-accent: #F1F5F9;

    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;

    /* Brand Colors - BLUE MODERN */
    --blue-primary: #2563EB;
    --blue-dark: #1E40AF;
    --orange-primary: #F97316;
    --orange-dark: #EA580C;

    /* Borders & Dividers */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Legacy (for backwards compatibility - will be removed) */
    --navy-dark: #0A1628;
    --navy: #1A2332;
    --electric-blue: #2563EB;
    --purple: #F97316;
    --teal-primary: #2563EB;
    --teal-dark: #1E40AF;
}

/* ============================================ */
/* HERO GRADIENT ANIMATION                      */
/* ============================================ */
.hero-gradient {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #60A5FA 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Hero Background Zoom Effect */
.hero-zoom-bg {
    animation: hero-zoom-bg 20s ease-in-out infinite alternate;
}

@keyframes hero-zoom-bg {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* ============================================ */
/* GRADIENT TEXT EFFECT                         */
/* ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #F97316 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 5s ease infinite;
}

@keyframes gradientTextShift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

/* ============================================ */
/* FLOATING SHAPES                              */
/* ============================================ */
.floating-shape {
    position: absolute;
    opacity: 0.1;
    border-radius: 50%;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #60A5FA, #2563EB);
    top: 10%;
    left: -10%;
    animation: float 20s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #2563EB, #60A5FA);
    top: 50%;
    right: -5%;
    animation: float 15s ease-in-out infinite reverse;
    animation-delay: 2s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #60A5FA, #FFFFFF);
    bottom: 10%;
    left: 20%;
    animation: float 18s ease-in-out infinite;
    animation-delay: 4s;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #2563EB, #FFFFFF);
    bottom: 20%;
    right: 10%;
    animation: float 22s ease-in-out infinite reverse;
    animation-delay: 1s;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* ============================================ */
/* SCROLL INDICATOR                             */
/* ============================================ */
.scroll-indicator {
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ============================================ */
/* FADE IN ANIMATIONS (Triggered by JS)         */
/* ============================================ */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================ */
/* LOGOS INFINITE SCROLL */
/* ============================================ */
.logos-scroll {
    animation: marquee 30s linear infinite;
    -webkit-animation: marquee 30s linear infinite;
    width: max-content;
    display: flex;
    /* Ensure flex context */
    will-change: transform;
    animation-play-state: running;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@-webkit-keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Pause on hover */
.logos-scroll:hover {
    animation-play-state: paused;
}

/* Reverse Scroll (for 2-way carousel) */
.logos-scroll-reverse {
    animation: scrollReverse 30s linear infinite;
    width: max-content;
}

@keyframes scrollReverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* Pause on hover */
.logos-scroll-reverse:hover {
    animation-play-state: paused;
}


/* ============================================ */
/* NAVIGATION ACTIVE STATE                      */
/* ============================================ */
.nav-link.active {
    color: var(--blue-primary);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-primary);
    border-radius: 2px;
}

/* ============================================ */
/* SMOOTH SCROLLBAR (WebKit)                    */
/* ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #94A3B8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue-primary);
}

/* ============================================ */
/* SELECTION COLOR                              */
/* ============================================ */
::selection {
    background: var(--blue-primary);
    color: #FFFFFF;
}

::-moz-selection {
    background: var(--blue-primary);
    color: #FFFFFF;
}

/* ============================================ */
/* FOCUS STATES (Accessibility)                 */
/* ============================================ */
a:focus,
button:focus {
    outline: 2px solid var(--blue-primary);
    outline-offset: 2px;
}

/* ============================================ */
/* LOADING ANIMATION (Optional - for images)    */
/* ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right,
            #F1F5F9 0%,
            #E2E8F0 50%,
            #F1F5F9 100%);
    background-size: 1000px 100%;
}

/* ============================================ */
/* RESPONSIVE UTILITIES                         */
/* ============================================ */
@media (max-width: 768px) {
    .floating-shape {
        opacity: 0.05;
    }

    .shape-1,
    .shape-2 {
        width: 250px;
        height: 250px;
    }

    .shape-3,
    .shape-4 {
        width: 150px;
        height: 150px;
    }
}

/* ============================================ */
/* PAGE LOAD ANIMATIONS                         */
/* ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Animation */
.animate-logo {
    animation: scaleIn 0.6s ease-out;
}

/* Navigation Animation */
.animate-nav {
    animation: slideDown 0.6s ease-out 0.2s both;
}

/* Hero Title Animation */
.animate-hero-title {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Hero Subtitle */
.animate-hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* CTA Buttons */
.animate-cta {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

/* Breadcrumb */
.animate-breadcrumb {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

/* ============================================ */
/* STAGGERED GRID ANIMATIONS                    */
/* ============================================ */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-item:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-item:nth-child(8) {
    animation-delay: 0.8s;
}

.stagger-item:nth-child(9) {
    animation-delay: 0.9s;
}

/* ============================================ */
/* MICRO-INTERACTIONS                           */
/* ============================================ */

/* Button Hover Effects */
button,
.btn,
a[class*="bg-"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover,
.btn:hover {
    transform: scale(1.05);
}

button:active,
.btn:active {
    transform: scale(0.95);
}

/* Electric Blue Button Glow */
@keyframes buttonGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.8), 0 0 30px rgba(37, 99, 235, 0.4);
    }
}

.btn-glow {
    animation: buttonGlow 2s ease-in-out infinite;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Link Underline Animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue-primary);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Image Zoom on Hover */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.05);
}

/* ============================================ */
/* INTERSECTION OBSERVER UTILITIES              */
/* ============================================ */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================ */
/* STICKY NAVIGATION TRANSITIONS                */
/* ============================================ */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ============================================ */
/* MOBILE MENU ANIMATIONS                       */
/* ============================================ */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.mobile-menu-enter {
    animation: slideInRight 0.3s ease-out;
}

.mobile-menu-item {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}

.mobile-menu-item:nth-child(1) {
    animation-delay: 0.05s;
}

.mobile-menu-item:nth-child(2) {
    animation-delay: 0.1s;
}

.mobile-menu-item:nth-child(3) {
    animation-delay: 0.15s;
}

.mobile-menu-item:nth-child(4) {
    animation-delay: 0.2s;
}

.mobile-menu-item:nth-child(5) {
    animation-delay: 0.25s;
}

/* Hamburger to X Animation */
.hamburger-line {
    transition: all 0.3s ease;
}

.menu-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================ */
/* IMAGE LAZY LOAD BLUR-UP                      */
/* ============================================ */
.lazy-image {
    filter: blur(10px);
    transition: filter 0.5s ease;
}

.lazy-image.loaded {
    filter: blur(0);
}

/* ============================================ */
/* COUNTER ANIMATION (JS Triggered)             */
/* ============================================ */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ============================================ */
/* SKIP TO MAIN CONTENT (Accessibility)         */
/* ============================================ */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--electric-blue);
    color: var(--navy-dark);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 0.5rem 0;
    transition: top 0.3s ease;
    z-index: 9999;
}

.skip-to-main:focus {
    top: 0;
}

/* ============================================ */
/* REDUCED MOTION (Accessibility)               */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-shape {
        animation: none !important;
    }

    .hero-gradient,
    .cta-gradient {
        animation: none !important;
    }
}

/* ============================================ */
/* HIGH CONTRAST MODE                           */
/* ============================================ */
@media (prefers-contrast: high) {
    :root {
        --navy-dark: #000000;
        --navy: #000000;
        --electric-blue: #00FFFF;
        --purple: #FF00FF;
    }
}

/* ============================================ */
/* TOUCH TARGET SIZES (Mobile)                  */
/* ============================================ */
@media (max-width: 768px) {

    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================ */
/* PRINT STYLES                                 */
/* ============================================ */
@media print {

    .hero-gradient,
    .cta-gradient {
        background: var(--navy-dark) !important;
    }

    .floating-shape {
        display: none !important;
    }

    header,
    footer {
        background: white !important;
        color: black !important;
    }

    /* Hide non-essential elements */
    nav,
    .floating-shape,
    #mobile-menu-button {
        display: none !important;
    }

    /* Ensure readability */
    * {
        color: black !important;
        background: white !important;
    }

    a {
        text-decoration: underline;
    }

    /* Page breaks */
    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }
}
/* ============================================ */
/* MODERN NAVBAR ENHANCEMENTS                   */
/* ============================================ */

/* Dropdown Menu - Clickable Fix */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    padding: 8px 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown .dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-dropdown .dropdown-menu a:hover {
    background: #F3F4F6;
    color: #2563EB;
    padding-left: 24px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.lang-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #6B7280;
}

.lang-btn.active {
    background: #2563EB;
    color: white;
    box-shadow: 0 2px 4px rgba(37,99,235,0.3);
}

.lang-btn:hover:not(.active) {
    background: #E5E7EB;
    color: #374151;
}

/* ============================================ */
/* BACK TO TOP BUTTON                           */
/* ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2563EB, #1E40AF);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(37,99,235,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(37,99,235,0.5);
}

.back-to-top i {
    font-size: 20px;
}

/* ============================================ */
/* LOGO VISIBILITY FIX                          */
/* ============================================ */
.logo-container {
    background: linear-gradient(135deg, #1E40AF, #2563EB);
    padding: 8px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-container img {
    height: 40px;
    width: auto;
}

/* Footer Logo Fix */
.footer-logo-container {
    background: linear-gradient(135deg, #2563EB, #1E40AF);
    padding: 12px 16px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-container img {
    height: 48px;
    width: auto;
}

/* ============================================ */
/* MODERN NAVBAR STYLING                        */
/* ============================================ */
.navbar-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.navbar-modern.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Nav Link Hover Effect */
.nav-link-modern {
    position: relative;
    color: #374151;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-link-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563EB, #60A5FA);
    transition: width 0.3s ease;
}

.nav-link-modern:hover {
    color: #2563EB;
}

.nav-link-modern:hover::after,
.nav-link-modern.active::after {
    width: 100%;
}

.nav-link-modern.active {
    color: #2563EB;
}

/* Mobile Menu Enhancement */
.mobile-menu-modern {
    background: white;
    border-top: 1px solid #E5E7EB;
}

.mobile-menu-modern a {
    display: block;
    padding: 12px 0;
    color: #374151;
    font-weight: 500;
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.2s ease;
}

.mobile-menu-modern a:hover {
    color: #2563EB;
    padding-left: 8px;
}

/* Mobile Dropdown */
.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #F9FAFB;
    border-radius: 8px;
    margin: 8px 0;
}

.mobile-dropdown-content.open {
    max-height: 200px;
}

.mobile-dropdown-content a {
    padding: 10px 20px;
    font-size: 14px;
}

/* ============================================ */
/* DROPDOWN FIX - Enhanced Hover States        */
/* ============================================ */

/* Ensure dropdown shows on parent hover */
.nav-dropdown:hover > .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Add padding to prevent gap issue */
.nav-dropdown .dropdown-trigger {
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.nav-dropdown .dropdown-menu {
    margin-top: 0;
    padding-top: 10px;
}

/* Ensure proper positioning */
.nav-dropdown {
    position: relative;
}

/* Active state for click support */
.nav-dropdown.active > .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Hero Zoom Animation */
@keyframes zoomOutBg {
    from { transform: scale(1.15); }
    to { transform: scale(1.0); }
}

.animate-zoom-out {
    animation: zoomOutBg 20s ease-out forwards;
}

/* Hero Zoom Animation - Slower for CTI Style */
@keyframes zoomOutSlow {
    0% { 
        transform: scale(1.2);
        opacity: 0.2;
    }
    100% { 
        transform: scale(1.0);
        opacity: 0.3;
    }
}

.animate-zoom-out-slow {
    animation: zoomOutSlow 25s ease-out infinite alternate;
}

/* Fade In Up Animation for Hero Content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}
