/* ==========================================================================
   PRINCETON COLLEGE - GLOBAL ANIMATIONS & INTERACTIVE STYLESHEET
   Comprehensive animations and micro-interactions for all website pages.
   ========================================================================== */

:root {
  --anim-primary: #0071db;
  --anim-primary-glow: rgba(0, 113, 219, 0.35);
  --anim-primary-soft: rgba(0, 113, 219, 0.08);
  --anim-secondary: #125875;
  --anim-accent: #ff7350;
  --anim-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --anim-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   1. GLOBAL PAGE ENTRANCE & SMOOTH SCROLL
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  animation: pageFadeIn 0.5s var(--anim-ease-out) forwards;
  overflow-x: hidden;
}

@keyframes pageFadeIn {
  from {
    opacity: 0.92;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   2. SCROLL REVEAL ANIMATION CLASSES (Intersection Observer)
   -------------------------------------------------------------------------- */
[data-anim] {
  opacity: 0;
  will-change: transform, opacity;
  transition-property: opacity, transform;
  transition-duration: 0.75s;
  transition-timing-function: var(--anim-ease-out);
}

/* Fade Up */
[data-anim="fade-up"],
.anim-fade-up {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.75s var(--anim-ease-out), transform 0.75s var(--anim-ease-out);
}

/* Fade Down */
[data-anim="fade-down"],
.anim-fade-down {
  opacity: 0;
  transform: translateY(-35px);
  transition: opacity 0.75s var(--anim-ease-out), transform 0.75s var(--anim-ease-out);
}

/* Fade Left */
[data-anim="fade-left"],
.anim-fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.75s var(--anim-ease-out), transform 0.75s var(--anim-ease-out);
}

/* Fade Right */
[data-anim="fade-right"],
.anim-fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.75s var(--anim-ease-out), transform 0.75s var(--anim-ease-out);
}

/* Zoom In */
[data-anim="zoom-in"],
.anim-zoom-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.75s var(--anim-ease-out), transform 0.75s var(--anim-ease-out);
}

/* Flip Up */
[data-anim="flip-up"],
.anim-flip-up {
  opacity: 0;
  transform: perspective(600px) rotateX(16deg) translateY(30px);
  transition: opacity 0.8s var(--anim-ease-out), transform 0.8s var(--anim-ease-out);
}

/* Active State when in Viewport */
[data-anim].anim-visible,
.anim-fade-up.anim-visible,
.anim-fade-down.anim-visible,
.anim-fade-left.anim-visible,
.anim-fade-right.anim-visible,
.anim-zoom-in.anim-visible,
.anim-flip-up.anim-visible {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) rotate(0) !important;
}

/* Stagger Delay Utility Classes */
.delay-100 { transition-delay: 100ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }
.delay-600 { transition-delay: 600ms !important; }

/* --------------------------------------------------------------------------
   3. INTERACTIVE CARDS & BOXES HOVER EFFECTS
   -------------------------------------------------------------------------- */
/* Feature Boxes */
.feature-box,
.studys_about_area .feature-box,
.service_page_feature_area .feature-box {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--anim-ease-out), box-shadow 0.4s var(--anim-ease-out), border-color 0.4s ease !important;
}

.feature-box:hover {
  transform: translateY(-10px) scale(1.02) !important;
  box-shadow: 0 20px 40px var(--anim-primary-glow) !important;
  border-top-color: #0056b3 !important;
}

/* Card Light Shimmer Sweep */
.feature-box::after,
.course-single-sidebar::after,
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  transition: left 0.8s ease;
  z-index: 2;
}

.feature-box:hover::after,
.course-single-sidebar:hover::after,
.gallery-item:hover::after {
  left: 140%;
}

/* Icon floating animation */
.feature-icon,
.service-icon,
.about-feature img {
  transition: transform 0.4s var(--anim-bounce), background-color 0.3s ease;
}

.feature-box:hover .feature-icon,
.service-box:hover .service-icon {
  transform: scale(1.15) rotate(6deg) !important;
  background: #dbebff !important;
}

/* Notice & Event Sidebars */
.course-single-sidebar {
  transition: transform 0.35s var(--anim-ease-out), box-shadow 0.35s var(--anim-ease-out) !important;
  position: relative;
}

.course-single-sidebar:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 35px rgba(0, 113, 219, 0.16) !important;
}

/* Notice Row Interactive Hover */
.course-feature-list .row {
  transition: transform 0.25s var(--anim-ease-out), background-color 0.25s ease, padding-left 0.25s ease;
  border-radius: 8px;
  padding: 6px;
}

.course-feature-list .row:hover {
  background: #f4f8fd;
  transform: translateX(6px);
}

.card-notice .box {
  transition: transform 0.3s var(--anim-bounce), box-shadow 0.3s ease;
}

.course-feature-list .row:hover .card-notice .box {
  transform: scale(1.06);
  box-shadow: 0 4px 12px var(--anim-primary-glow);
}

/* Pulsing Badge Indicator */
.badge-pulse,
img[src*="blinking_new.gif"] {
  display: inline-block;
  vertical-align: middle;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 115, 80, 0.4)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 6px rgba(255, 115, 80, 0.8)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 115, 80, 0.4)); }
}

/* --------------------------------------------------------------------------
   4. INTERACTIVE BUTTONS & CTA MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
.witr_btn,
.witr_btn_s,
.btn-primary,
.btn,
.slider-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.35s var(--anim-ease-out) !important;
  z-index: 1;
}

.witr_btn:hover,
.witr_btn_s:hover,
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 22px var(--anim-primary-glow) !important;
}

.witr_btn:active,
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Arrow Slide on Button Hover */
.witr_btn i,
.witr_btn svg {
  display: inline-block;
  transition: transform 0.3s var(--anim-bounce);
  margin-left: 6px;
}

.witr_btn:hover i,
.witr_btn:hover svg {
  transform: translateX(5px);
}

/* Button Ripple Effect */
.anim-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnimation 0.6s linear;
  background-color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

@keyframes rippleAnimation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Glowing Pulsing Button Utility */
.pulse-glow-btn {
  animation: buttonGlow 2.5s infinite;
}

@keyframes buttonGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 113, 219, 0.5);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(0, 113, 219, 0);
  }
}

/* --------------------------------------------------------------------------
   5. BREADCRUMB & PAGE HEADER BANNER ANIMATIONS
   -------------------------------------------------------------------------- */
.breadcumb-area,
.site-breadcrumb {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Ambient animated gradient overlay for breadcrumb headers */
.breadcumb-area::before,
.site-breadcrumb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16, 55, 65, 0.88), rgba(0, 113, 219, 0.75));
  z-index: 1;
}

.breadcumb-area .container,
.site-breadcrumb .container {
  position: relative;
  z-index: 2;
}

.breadcumb-area .brpt h2,
.site-breadcrumb .breadcrumb-title {
  animation: bannerTitleIn 0.8s var(--anim-ease-out) forwards;
  letter-spacing: 0.5px;
}

@keyframes bannerTitleIn {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.breadcumb-inner,
.site-breadcrumb .breadcrumb-menu {
  animation: bannerBreadcrumbIn 1s var(--anim-ease-out) 0.15s forwards;
  opacity: 0;
}

@keyframes bannerBreadcrumbIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   6. NAVIGATION & HEADER ENHANCEMENTS
   -------------------------------------------------------------------------- */
.studys_nav_area {
  transition: all 0.35s ease;
}

/* Sticky Header Styling */
.studys_nav_area.prefix,
.trp_nav_area.hbg2 {
  background: rgba(16, 55, 65, 0.96) !important;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.18) !important;
}

.studys_nav_area.prefix .studys_menu > ul > li > a {
  color: #ffffff !important;
}

.studys_nav_area.postfix .studys_menu > ul > li > a,
.studys_nav_area:not(.prefix) .studys_menu > ul > li > a {
  color: #272727 !important;
}

.studys_nav_area .studys_menu > ul > li > a:hover,
.studys_nav_area .studys_menu > ul > li.current > a {
  color: var(--anim-primary) !important;
}

/* Navigation Links Smooth Underline Effect */
.studys_menu > ul > li > a {
  position: relative;
  transition: color 0.3s ease;
}

.studys_menu > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  width: 0;
  height: 2.5px;
  background: var(--anim-primary);
  border-radius: 2px;
  transition: width 0.3s var(--anim-ease-out), left 0.3s var(--anim-ease-out);
}

.studys_menu > ul > li:hover > a::after,
.studys_menu > ul > li.current > a::after {
  width: 80%;
  left: 10%;
}

/* Ensure the top-level menu is always visible */
.studys_menu,
.studys_menu > ul,
.studys_menu > ul.sub-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Subtle enhancement on dropdown sub-menus without breaking display */
.studys_menu ul .sub-menu {
  border-radius: 8px;
  overflow: hidden;
  border-top: 3px solid var(--anim-primary);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.studys_menu ul .sub-menu li a {
  transition: all 0.25s ease;
}

.studys_menu ul .sub-menu li a:hover {
  background: #f0f7ff;
  color: var(--anim-primary) !important;
  padding-left: 28px;
}

/* --------------------------------------------------------------------------
   7. GALLERY, TEAM & COUNTER HOVER EFFECTS
   -------------------------------------------------------------------------- */
.gallery-area .gallery-item,
.single_gallery,
.gallery_item,
.single_protfolio,
.witr_single_team {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: transform 0.4s var(--anim-ease-out), box-shadow 0.4s var(--anim-ease-out);
}

.gallery-area img,
.single_gallery img,
.single_protfolio img,
.witr_single_team img {
  transition: transform 0.6s var(--anim-ease-out);
  width: 100%;
}

.gallery-area .gallery-item:hover,
.single_gallery:hover,
.single_protfolio:hover,
.witr_single_team:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.15);
}

.gallery-area .gallery-item:hover img,
.single_gallery:hover img,
.single_protfolio:hover img,
.witr_single_team:hover img {
  transform: scale(1.08);
}

/* Counter Card Elevation */
.witr_counter_single {
  transition: transform 0.35s var(--anim-bounce), box-shadow 0.35s ease !important;
  border-radius: 12px;
}

.witr_counter_single:hover {
  transform: translateY(-8px) scale(1.03) !important;
  box-shadow: 0 16px 30px rgba(0, 113, 219, 0.18) !important;
}

.witr_counter_img img {
  transition: transform 0.4s var(--anim-bounce);
}

.witr_counter_single:hover .witr_counter_img img {
  transform: scale(1.15) rotate(5deg);
}

/* --------------------------------------------------------------------------
   8. CONTACT PAGE & FORM ANIMATIONS
   -------------------------------------------------------------------------- */
.contact-content .col-lg-3 > div {
  transition: transform 0.35s var(--anim-bounce), box-shadow 0.35s ease, border-color 0.35s ease !important;
}

.contact-content .col-lg-3 > div:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 18px 35px rgba(13, 110, 253, 0.18) !important;
  border-color: #0d6efd !important;
}

.contact-content .col-lg-3 > div:hover i {
  animation: phoneRing 0.8s ease-in-out infinite alternate;
}

@keyframes phoneRing {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

/* Form Inputs Glowing Focus */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease !important;
  border-radius: 8px !important;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--anim-primary) !important;
  box-shadow: 0 0 0 4px var(--anim-primary-soft) !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   9. TABLES & DATA LISTS ANIMATIONS
   -------------------------------------------------------------------------- */
table.table tbody tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

table.table tbody tr:hover {
  background-color: #f7faff !important;
  transform: scale(1.003);
}

/* --------------------------------------------------------------------------
   10. INTERACTIVE SCROLL-TO-TOP BUTTON WITH PROGRESS RING
   -------------------------------------------------------------------------- */
.anim-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--anim-primary);
  box-shadow: 0 8px 25px rgba(0, 113, 219, 0.25);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.35s var(--anim-bounce);
  border: none;
  outline: none;
}

.anim-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.anim-scroll-top:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 14px 30px rgba(0, 113, 219, 0.38);
  background: var(--anim-primary);
  color: #ffffff;
}

.anim-scroll-top svg.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  border-radius: 50%;
}

.anim-scroll-top svg.progress-ring circle {
  fill: none;
  stroke: var(--anim-primary);
  stroke-width: 3.5;
  stroke-dasharray: 157; /* 2 * PI * 25 */
  stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.15s ease;
}

.anim-scroll-top:hover svg.progress-ring circle {
  stroke: #ffffff;
}

.anim-scroll-top .arrow-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
  z-index: 2;
}

.anim-scroll-top:hover .arrow-icon {
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   11. FOOTER ANIMATIONS
   -------------------------------------------------------------------------- */
.footer-middle .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  margin-right: 8px;
  transition: all 0.3s var(--anim-bounce) !important;
}

.footer-middle .social-icons a:hover {
  transform: translateY(-5px) scale(1.15) !important;
  background: var(--anim-primary) !important;
  box-shadow: 0 8px 18px var(--anim-primary-glow) !important;
}

.footer-middle ul.menu li a {
  position: relative;
  display: inline-block;
  transition: transform 0.25s ease, color 0.25s ease;
}

.footer-middle ul.menu li a:hover {
  transform: translateX(6px);
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY - PREFERS REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
