/* 
 * Frontend Enhancements CSS
 * Modern animations, hover effects, and microinteractions
 * Phase 9: UI/UX Modernization
 */

/* ========================================
   1. Enhanced Button Styles
   ======================================== */

.btn {
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Removed all button hover effects for cleaner appearance */

/* ========================================
   2. Card Hover Effects
   ======================================== */

.service-item,
.program-item,
.events-item,
.blog-item,
.team-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.service-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.program-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.program-item:hover .program-img img {
    transform: scale(1.1);
}

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

.events-item:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.events-item:hover .events-img img {
    transform: scale(1.15) rotate(3deg);
}

.events-img img {
    transition: transform 0.6s ease;
}

.blog-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.blog-item:hover .blog-img img {
    transform: scale(1.1);
}

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

/* ========================================
   3. Icon Animations
   ======================================== */

.service-item i {
    transition: all 0.3s ease;
}

.service-item:hover i {
    transform: scale(1.2) rotate(10deg);
    animation: iconPulse 1s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1.2) rotate(10deg); }
    50% { transform: scale(1.3) rotate(10deg); }
}

.fa-check-circle {
    transition: all 0.3s ease;
}

.fa-check-circle:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px var(--bs-primary));
}

/* ========================================
   4. Image Hover Effects
   ======================================== */

.img-zoom-container {
    overflow: hidden;
    border-radius: 10px;
}

.img-zoom {
    transition: transform 0.5s ease, filter 0.3s ease;
}

.img-zoom:hover {
    transform: scale(1.15);
    filter: brightness(1.1);
}

/* Overlay Effect for Gallery */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(254, 93, 55, 0.7), rgba(77, 101, 249, 0.7));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ========================================
   5. Link Hover Effects
   ======================================== */

a {
    transition: all 0.3s ease;
}

a:not(.btn):hover {
    color: var(--bs-primary) !important;
    transform: translateX(3px);
}

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

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

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

/* ========================================
   6. Form Input Effects
   ======================================== */

.form-control,
.form-select {
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 15px rgba(254, 93, 55, 0.2);
    transform: translateY(-2px);
}

/* Floating Label Effect */
.form-floating label {
    transition: all 0.3s ease;
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label {
    color: var(--bs-primary);
    font-weight: 600;
}

/* ========================================
   7. Loading Animations
   ======================================== */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Loading */
.pulse-loader {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

/* ========================================
   8. Scroll Animations
   ======================================== */

.parallax-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Scroll Progress Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, #FE5D37, #4d65f9);
    z-index: 9999;
    transition: width 0.2s ease;
}

/* ========================================
   9. Mobile-Specific Enhancements
   ======================================== */

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Reduced animation intensity on mobile */
    .service-item:hover,
    .program-item:hover,
    .events-item:hover {
        transform: translateY(-5px);
    }

    /* Touch feedback */
    .btn:active,
    .card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ========================================
   10. Back to Top Button Enhancement
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
    border: none;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    background: var(--bs-secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .back-to-top i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }
    
    .back-to-top i {
        font-size: 16px;
    }
}

/* ========================================
   11. Testimonial Effects
   ======================================== */

.testimonial-item {
    transition: all 0.3s ease;
}

.testimonial-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.testimonial-item img {
    transition: transform 0.3s ease;
}

.testimonial-item:hover img {
    transform: scale(1.1);
}

/* ========================================
   12. Navigation Enhancements
   ======================================== */

.navbar-nav .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--bs-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 80%;
}

/* ========================================
   13. Modal Animations
   ======================================== */

.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* ========================================
   14. Badge and Tag Animations
   ======================================== */

.badge,
.program-rate,
.events-rate {
    transition: all 0.3s ease;
}

.badge:hover,
.program-item:hover .program-rate,
.events-item:hover .events-rate {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   15. Video Modal Enhancements
   ======================================== */

.btn-play {
    transition: all 0.4s ease;
}

.btn-play:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 20px rgba(254, 93, 55, 0.8));
}

.btn-play span {
    animation: playPulse 2s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* ========================================
   16. Accessibility Enhancements
   ======================================== */

/* Focus Styles for Keyboard Navigation */
*:focus {
    outline: 2px dashed var(--bs-primary);
    outline-offset: 4px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(254, 93, 55, 0.3);
}

/* Reduced 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;
    }
}

/* ========================================
   17. Custom Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FE5D37, #4d65f9);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4d65f9, #FE5D37);
}

/* ========================================
   18. Selection Highlight
   ======================================== */

::selection {
    background: #FE5D37;
    color: white;
}

::-moz-selection {
    background: #FE5D37;
    color: white;
}

/* ========================================
   19. Print Optimizations
   ======================================== */

@media print {
    .back-to-top,
    .scroll-progress,
    .btn-play,
    .navbar,
    .footer {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}
