/* ===== UI WIDGETS COMPONENT ===== */
/* Back to Top Button & Scroll Progress Indicator */
/* Extracted from index.php for reusability */

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1E4D8C, #153A6B);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(30, 77, 140, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

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

.back-to-top:hover {
    background: linear-gradient(135deg, #2563EB, #1E4D8C);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(30, 77, 140, 0.5);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #910029, #1E4D8C, #047857);
    background-size: 200% 100%;
    width: 0%;
    z-index: 999999;
    transition: width 0.1s ease;
    animation: progressGradient 3s ease infinite;
}

@keyframes progressGradient {

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

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

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger animations for cards */
.stat-card,
.program-card,
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stat-card.animate,
.program-card.animate,
.feature-card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Accessibility Focus States */
a:focus,
button:focus {
    outline: 3px solid #FF6B35;
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.4);
}

/* Skip to Content Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #910029;
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 100000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Mobile Back to Top */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {

    /* Adjust back-to-top for mobile call bar */
    .back-to-top {
        bottom: 80px;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal,
    .stat-card,
    .program-card,
    .feature-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .back-to-top {
        transition: opacity 0.1s;
    }

    .scroll-progress {
        animation: none;
    }
}

@media print {
    .scroll-progress {
        display: none !important;
    }

    .back-to-top {
        display: none !important;
    }

    .skip-link {
        display: none !important;
    }
}