/* Enhanced styles for index.html - Homepage specific styles */

/* Skip Navigation for Accessibility */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden-focusable:focus {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 9999 !important;
    width: auto !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* ========================
   ULTRA-FINE SCROLL ANIMATIONS - Y AXIS
   ======================== */

/* Base animation class with micro-interactions */
.scroll-animate {
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

/* When element becomes visible - ultra smooth entrance */
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Specific animation for objective section */
.objective-animate {
    opacity: 0;
    transform: translateY(35px) scale(0.97);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.objective-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Enhanced objective section styling with gradient shadow animation */
.objective-section {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: box-shadow, transform;
}

.objective-section.visible {
    box-shadow: 
        0 8px 25px rgba(0, 184, 148, 0.12),
        0 4px 15px rgba(0, 184, 148, 0.08),
        0 2px 8px rgba(0, 184, 148, 0.05) !important;
    transform: translateY(-1px);
}

/* Ultra-fine staggered animations for cards */
.scroll-animate .card {
    opacity: 0;
    transform: translateY(18px) scale(0.99) rotateX(2deg);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.scroll-animate.visible .card {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
}

/* Micro-staggered delays with fibonacci-like progression */
.scroll-animate.visible .card:nth-child(1) { transition-delay: 0.08s; }
.scroll-animate.visible .card:nth-child(2) { transition-delay: 0.13s; }
.scroll-animate.visible .card:nth-child(3) { transition-delay: 0.21s; }
.scroll-animate.visible .card:nth-child(4) { transition-delay: 0.34s; }
.scroll-animate.visible .card:nth-child(5) { transition-delay: 0.55s; }
.scroll-animate.visible .card:nth-child(6) { transition-delay: 0.89s; }

/* Ultra-refined card hover effects with floating sensation */
.scroll-animate .card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 
        0 15px 35px rgba(0, 184, 148, 0.15),
        0 8px 20px rgba(0, 184, 148, 0.1),
        0 4px 12px rgba(0, 184, 148, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    will-change: transform, box-shadow !important;
}

/* Breathing animation for cards */
@keyframes cardBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

.scroll-animate.visible .card {
    animation: cardBreathe 6s ease-in-out infinite;
}

/* Ultra-smooth button animations with magnetic effect */
.scroll-animate .btn {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity, box-shadow;
    position: relative;
    overflow: hidden;
}

.scroll-animate.visible .btn {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scroll-animate.visible .btn:first-child { transition-delay: 0.15s; }
.scroll-animate.visible .btn:last-child { transition-delay: 0.25s; }

/* Magnetic button hover with ripple effect - Only on hover-capable devices */
@media (hover: hover) {
    .scroll-animate .btn:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 
            0 8px 20px rgba(0, 184, 148, 0.2),
            0 4px 12px rgba(0, 184, 148, 0.15);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .scroll-animate .btn:hover::before {
        width: 300px;
        height: 300px;
    }
}

/* Ripple effect for buttons - Only show on hover-capable devices */
.scroll-animate .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

/* Mobile-friendly button improvements */
@media (max-width: 991.98px) {
    .btn {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }
    
    /* Remove hover effects on mobile completely */
    .scroll-animate .btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .scroll-animate .btn::before {
        display: none !important;
    }
}



.scroll-animate .btn > * {
    position: relative;
    z-index: 1;
}

/* Parallax-like effect for section headers */
.scroll-animate h2 {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.05s;
}

/* Fade-in effect for icons with micro-rotation */
.scroll-animate h2 i,
.scroll-animate .card-title i {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible h2 i,
.scroll-animate.visible .card-title i {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.2s;
}

/* Ultra-smooth text reveal */
.scroll-animate p,
.scroll-animate .card-text {
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible p,
.scroll-animate.visible .card-text {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* ========================
   SPECIAL TABLE ANIMATIONS
   ======================== */

/* RACI Table ultra-fine animations */
.scroll-animate .table-responsive {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible .table-responsive {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.4s;
}

/* Table rows staggered animation */
.scroll-animate .table tbody tr {
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible .table tbody tr {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate.visible .table tbody tr:nth-child(1) { transition-delay: 0.6s; }
.scroll-animate.visible .table tbody tr:nth-child(2) { transition-delay: 0.7s; }
.scroll-animate.visible .table tbody tr:nth-child(3) { transition-delay: 0.8s; }
.scroll-animate.visible .table tbody tr:nth-child(4) { transition-delay: 0.9s; }

/* Table header animation */
.scroll-animate .table thead {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible .table thead {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Badge animations */
.scroll-animate .badge {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.scroll-animate.visible .badge {
    opacity: 1;
    transform: scale(1);
}

.scroll-animate.visible .badge:nth-child(1) { transition-delay: 1.0s; }
.scroll-animate.visible .badge:nth-child(2) { transition-delay: 1.1s; }
.scroll-animate.visible .badge:nth-child(3) { transition-delay: 1.2s; }
.scroll-animate.visible .badge:nth-child(4) { transition-delay: 1.3s; }

/* Enhanced table hover effects */
.scroll-animate .table tbody tr:hover {
    background-color: rgba(0, 184, 148, 0.05) !important;
    transform: translateX(3px) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Gradient backgrounds */
.bg-gradient {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.min-vh-75 {
    min-height: 75vh;
}

/* Card styling - no animations */
.card:hover {
    /* Subtle hover effect without animation */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* Navigation hover effects */
.nav-link:hover {
    color: #ffffff !important;
}

/* Tree Structure Styles */
.tree-structure {
    font-size: 0.95rem;
}

/* Hero Section Styles */
.hero-card {
    /* Removed animation */
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.hero-title {
    font-size: 2.2rem;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.objective-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.hero-card:hover {
    /* Removed animation */
    box-shadow: 0 6px 20px rgba(0,123,255,0.1) !important;
}

/* Tree navigation styling */
.tree-item {
    margin-bottom: 8px;
    padding: 4px 0;
}

.tree-item a {
    /* Removed transitions */
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    color: #000000 !important;
}

.tree-item a:hover {
    background-color: rgba(0, 0, 0, 0.3);
    /* Removed transform animation */
    color: #000000 !important;
}

.tree-item strong {
    color: #ffffff;
    font-weight: 600;
}

.tree-item i {
    width: 16px;
    text-align: center;
}

/* Nagarro Brand Colors */
.bg-nagarro-green {
    background-color: #00B894 !important;
}

.text-nagarro-green {
    color: #00B894 !important;
}

.border-nagarro-green {
    border-color: #00B894 !important;
}

.bg-nagarro-dark {
    background-color: #2d3436 !important;
}

.text-nagarro-dark {
    color: #2d3436 !important;
}

/* Override navbar to use Nagarro colors */
.navbar-dark.bg-primary {
    background-color: #00B894 !important;
}

/* Enhanced tree hover effects with Nagarro colors */
.tree-item a:hover {
    background-color: rgba(0, 184, 148, 0.15) !important;
    /* Removed transform animation */
    color: #2d3436 !important;
    border-left: 3px solid #00B894;
}

/* Enhanced card hover effects */
.card:hover {
    /* Removed transform animation */
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.1) !important;
}

/* Nagarro-style gradient for special sections */
.bg-nagarro-gradient {
    background: linear-gradient(135deg, #00B894 0%, #00A085 100%) !important;
}

/* Enhanced homepage color system */
.bg-nagarro-light {
    background-color: rgba(0, 184, 148, 0.05) !important;
}

.bg-nagarro-gradient-light {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1) 0%, rgba(0, 184, 148, 0.05) 100%) !important;
}

/* Mobile navigation buttons - Fix double-tap issue */
@media (max-width: 767.98px) {
    .mobile-nav-btn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
        /* Fix mobile touch issues */
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        cursor: pointer;
    }
    .mobile-nav-btn i {
        font-size: 0.7rem;
        pointer-events: none; /* Prevent icon from intercepting clicks */
    }
    .mobile-nav-btn:first-child {
        margin-right: 0.5rem !important;
    }
    
    /* Disable hover effects on touch devices */
    .scroll-animate .mobile-nav-btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .scroll-animate .mobile-nav-btn::before {
        display: none !important;
    }
}

/* Semantic color hover effects */
.hover-primary:hover {
    color: #0d6efd !important;
    /* Removed animation */
}

.hover-warning:hover {
    color: #fd7e14 !important;
    /* Removed animation */
}

.hover-success:hover {
    color: #198754 !important;
    /* Removed animation */
}

/* Enhanced gradients with Nagarro colors */
.bg-gradient-nagarro {
    background: linear-gradient(135deg, #00B894 0%, #00A085 50%, #009975 100%) !important;
}

.bg-gradient-primary-nagarro {
    background: linear-gradient(135deg, #0d6efd 0%, #00B894 100%) !important;
}

/* Tree structure enhanced styling */
.tree-item strong {
    font-weight: 600;
    font-size: 0.95rem;
}

.tree-item a {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    /* Removed transition */
}

.tree-item i {
    width: 18px;
    text-align: center;
    opacity: 0.8;
}

/* Enhanced border styling */
.border-nagarro-green-25 {
    border-color: rgba(0, 184, 148, 0.25) !important;
}

.border-nagarro-green-50 {
    border-color: rgba(0, 184, 148, 0.5) !important;
}

/* Equal height containers for homepage sections - Enhanced */
.equal-height-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.equal-height-item {
    display: flex;
    flex-direction: column;
}

.equal-height-content {
    display: flex;
    flex-direction: column;
    min-height: 450px;
    height: 100%;
}

.equal-height-content h5 {
    flex-shrink: 0;
}

.tree-structure,
.video-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

@media (max-width: 991.98px) {
    .equal-height-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .equal-height-content {
        min-height: auto;
    }
    
    /* Mobile-only: Put Program Overview (video) first */
    .program-overview-section {
        order: 1;
    }
    
    .program-structure-section {
        order: 2;
    }
}