/**
 * Professional Animations for All Pages
 * Smooth, subtle animations for government website
 */

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Left Animation */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right Animation */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   INITIAL PAGE LOAD ANIMATIONS
   ============================================ */

/* Top Bar Animation */
.top-bar {
    animation: slideDown 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Navbar Animation */
.navbar {
    animation: slideDown 0.7s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Hero Section Animation */
.hero-slider,
.hero-default {
    animation: fadeIn 0.8s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.hero-badge {
    animation: slideUp 0.8s ease-out 0.2s both;
    opacity: 0;
}

.hero-title {
    animation: slideUp 0.8s ease-out 0.4s both;
    opacity: 0;
}

.hero-subtitle {
    animation: slideUp 0.8s ease-out 0.6s both;
    opacity: 0;
}

.btn-hero {
    animation: scaleIn 0.8s ease-out 0.8s both;
    opacity: 0;
}

/* Cards Animation */
.card {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Quick Link Cards Animation */
.quick-link-card {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2) !important;
}

/* Programme Cards Animation */
.programme-card {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.programme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Statistics Cards Animation */
.stat-card-professional {
    animation: scaleIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-professional:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

/* ============================================
   CONTENT AREA ANIMATIONS
   ============================================ */

/* Content Area Fade In */
.content-area {
    animation: fadeIn 0.8s ease-out;
}

/* Sidebar Animation */
.inner-page-sidebar {
    animation: slideRight 0.8s ease-out;
}

.sidebar-box {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-box:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Featured Image Animation */
.page-featured-image {
    animation: fadeIn 0.8s ease-out;
}

.page-featured-image img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.page-featured-image:hover img {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

/* Content Images Animation */
.content-area .content img {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-area .content img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 61, 130, 0.4) !important;
}

.btn-hero:hover {
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4) !important;
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

.navbar-nav .nav-link {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ff6600;
    transition: width 0.3s ease, left 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
    left: 10%;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

/* Dropdown Animation */
.dropdown-menu {
    animation: slideDown 0.3s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-item {
    transition: background-color 0.2s ease, transform 0.2s ease, padding-left 0.2s ease;
}

.dropdown-item:hover {
    transform: translateX(5px);
    padding-left: 1.5rem;
}

/* ============================================
   NEWS & EVENTS ANIMATIONS
   ============================================ */

.news-card,
.event-card {
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover,
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.news-item-compact {
    transition: color 0.3s ease, transform 0.2s ease;
}

.news-item-compact:hover {
    transform: translateX(5px);
}

/* ============================================
   TABLE ANIMATIONS
   ============================================ */

.table {
    animation: fadeIn 0.6s ease-out;
}

.table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.table tbody tr:hover {
    transform: scale(1.01);
    background-color: #f8f9fa !important;
}

/* ============================================
   FOOTER ANIMATIONS
   ============================================ */

footer {
    animation: fadeIn 0.8s ease-out;
}

footer a {
    transition: color 0.3s ease, transform 0.2s ease;
}

footer a:hover {
    transform: translateX(3px);
}

/* ============================================
   SCROLL ANIMATIONS (Using Intersection Observer)
   ============================================ */

/* Elements that will animate on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.animate-on-scroll.delay-1 {
    transition-delay: 0.1s;
}

.animate-on-scroll.delay-2 {
    transition-delay: 0.2s;
}

.animate-on-scroll.delay-3 {
    transition-delay: 0.3s;
}

.animate-on-scroll.delay-4 {
    transition-delay: 0.4s;
}

/* ============================================
   SIDEBAR MENU ANIMATIONS
   ============================================ */

.sidebar-menu-link {
    transition: all 0.3s ease;
}

.sidebar-menu-link::before {
    transition: transform 0.3s ease;
}

.sidebar-menu-link:hover {
    transform: translateX(5px);
}

.sidebar-menu-link:hover::before {
    transform: translateX(3px);
}

/* ============================================
   PAGINATION ANIMATIONS
   ============================================ */

.pagination .page-link {
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pagination .page-item.active .page-link {
    animation: scaleIn 0.3s ease-out;
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

.form-control,
.form-select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(0, 61, 130, 0.25) !important;
}

/* ============================================
   BREADCRUMB ANIMATIONS
   ============================================ */

.breadcrumb {
    animation: fadeIn 0.6s ease-out;
}

.breadcrumb-item a {
    transition: color 0.3s ease, transform 0.2s ease;
}

.breadcrumb-item a:hover {
    transform: translateX(2px);
}

/* ============================================
   SECTION TITLE ANIMATIONS
   ============================================ */

.section-title {
    animation: slideUp 0.6s ease-out;
    transition: color 0.3s ease;
}

.section-title::after {
    transition: width 0.5s ease;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .card:hover,
    .quick-link-card:hover,
    .programme-card:hover {
        transform: none;
    }
    
    /* Faster animations on mobile */
    .animate-on-scroll {
        transition-duration: 0.4s;
    }
}

/* ============================================
   ACCESSIBILITY - Respect Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

