/* ==========================================================================
   Dheepam Consultant Services — Animations Stylesheet
   Version: 1.0.0
   Contents:
     1.  Keyframe Definitions
     2.  Scroll Reveal Classes (IntersectionObserver)
     3.  Stagger Delay Children
     4.  Hero Auto-Play Animations
     5.  Floating Cards
     6.  Scroll Indicator Bounce
     7.  Modal Animation
     8.  Loading Spinner
     9.  Pulse / Shimmer / Gradient Utilities
     10. Nav Link Underline
     11. Button Ripple
     12. Gradient & Shimmer Text
     13. Process Line Draw
     14. Hover Lift Cards
     15. Transition Utility
     16. Page Transition
     17. Counter Animation Hook
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Keyframe Definitions
   -------------------------------------------------------------------------- */

/* Fade up from below */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simple fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in from slightly smaller */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Vertical bounce (scroll indicator, etc.) */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* Continuous rotation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Gentle scale pulse */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}

/* Horizontal shimmer sweep */
@keyframes shimmer {
    from { background-position: -200% center; }
    to   { background-position:  200% center; }
}

/* Floating hover — gentle vertical oscillation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

/* Line drawing (width 0 → 100%) */
@keyframes drawLine {
    from { width: 0; }
    to   { width: 100%; }
}

/* Count-up text flash */
@keyframes countUp {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal pop-in */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Slide down (header / dropdown) */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ripple click effect */
@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 0.6;
    }
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Animated gradient shift (background-position) */
@keyframes gradientShift {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

/* Fade in then out (notification / toast) */
@keyframes flashIn {
    0%   { opacity: 0; transform: translateY(-10px); }
    15%  { opacity: 1; transform: translateY(0); }
    85%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15%       { transform: scale(1.12); }
    30%       { transform: scale(1); }
    45%       { transform: scale(1.06); }
    60%       { transform: scale(1); }
}

/* Shake (form error feedback) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    30%       { transform: translateX(6px); }
    45%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

/* Fade up + scale (cards entering) */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --------------------------------------------------------------------------
   2. Scroll Reveal Classes
      Applied by JavaScript IntersectionObserver on scroll.
      Initial state: hidden. JS adds `.revealed` to trigger the transition.
   -------------------------------------------------------------------------- */

/* Fade up */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Fade only */
.reveal-fade {
    opacity: 0;
    transition: opacity 0.7s ease;
}

.reveal-fade.revealed {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   3. Stagger Delay for Children
      Wrap a parent with `.stagger-children` and each child gets a delay.
   -------------------------------------------------------------------------- */
.stagger-children > *:nth-child(1)  { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.40s; }
.stagger-children > *:nth-child(9)  { transition-delay: 0.45s; }
.stagger-children > *:nth-child(10) { transition-delay: 0.50s; }
.stagger-children > *:nth-child(11) { transition-delay: 0.55s; }
.stagger-children > *:nth-child(12) { transition-delay: 0.60s; }

/* --------------------------------------------------------------------------
   4. Hero Section — Auto-Play on Page Load
      Elements start at opacity 0 and are animated into view automatically.
   -------------------------------------------------------------------------- */
.hero-badge {
    animation: fadeIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.hero-title {
    animation: fadeUp 0.85s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both;
}

.hero-subtitle {
    animation: fadeUp 0.85s cubic-bezier(0.4, 0, 0.2, 1) 0.42s both;
}

.hero-actions {
    animation: fadeUp 0.85s cubic-bezier(0.4, 0, 0.2, 1) 0.58s both;
}

.hero-trust {
    animation: fadeIn 0.8s ease 0.75s both;
}

.hero-visual {
    animation: slideInRight 0.95s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}

/* --------------------------------------------------------------------------
   5. Floating Cards (Hero Visual)
   -------------------------------------------------------------------------- */
.float-card-1 {
    animation: float 4.2s ease-in-out 0s infinite;
}

.float-card-2 {
    animation: float 4.5s ease-in-out 1.0s infinite;
}

.float-card-3 {
    animation: float 4s ease-in-out 2.0s infinite;
}

/* --------------------------------------------------------------------------
   6. Scroll Indicator — Bounce
   -------------------------------------------------------------------------- */
.hero-scroll-indicator {
    animation: bounce 2.2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   7. Modal — Pop-In Animation
   -------------------------------------------------------------------------- */
.modal-overlay.active .modal-box {
    animation: modalIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --------------------------------------------------------------------------
   8. Loading Spinner
   -------------------------------------------------------------------------- */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}

.spinner-dark {
    border-color: rgba(11, 31, 58, 0.15);
    border-top-color: var(--primary);
}

.spinner-accent {
    border-color: rgba(245, 130, 32, 0.2);
    border-top-color: var(--accent);
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* --------------------------------------------------------------------------
   9. Pulse, Shimmer & Gradient Utilities
   -------------------------------------------------------------------------- */

/* Pulse — for CTAs or notification badges */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Heartbeat — for trust indicators */
.heartbeat {
    animation: heartbeat 1.8s ease-in-out infinite;
}

/* Skeleton shimmer loader */
.shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.shimmer-card {
    background: linear-gradient(
        90deg,
        #f5f5f5 25%,
        #ebebeb 50%,
        #f5f5f5 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

/* Animated gradient background (used on hero accent shapes, etc.) */
.gradient-animated {
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
}

/* --------------------------------------------------------------------------
   10. Nav Link Underline Slide
      The ::after pseudo-element on .nav-link is animated.
      Base state (width: 0) is in style.css under .nav-link::after.
   -------------------------------------------------------------------------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --------------------------------------------------------------------------
   11. Button Ripple Effect
      On hover, a radial ripple fills the button background.
   -------------------------------------------------------------------------- */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: translate(-50%, -50%);
    transition: width 0.55s ease, height 0.55s ease, opacity 0.55s ease;
    opacity: 0;
    pointer-events: none;
}

.btn:hover::after {
    width: 260px;
    height: 260px;
    opacity: 1;
}

/* Ripple for dark buttons */
.btn-secondary::after,
.btn-outline-white::after {
    background: rgba(11, 31, 58, 0.08);
}

/* Shake utility — applied by JS on form errors */
.shake {
    animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* --------------------------------------------------------------------------
   12. Gradient Text & Gold Shimmer
   -------------------------------------------------------------------------- */

/* Static amber-to-blue gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #FFA14A 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated shimmer gold/amber text */
.accent-shimmer {
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        #FFA14A 40%,
        var(--accent) 80%,
        #FFBE76 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

/* White fade-out gradient on long text truncation */
.text-fade {
    position: relative;
    overflow: hidden;
}

.text-fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--white));
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   13. Process Line Draw
   -------------------------------------------------------------------------- */
.process-line {
    height: 2px;
    background: var(--accent);
    width: 0;
    border-radius: 2px;
}

.process-line.animated {
    animation: drawLine 1.2s ease forwards;
}

/* Also animates the pseudo-element connector in process grid */
.process-section .process-grid.in-view::before {
    animation: drawLine 1.2s ease 0.4s both;
}

/* --------------------------------------------------------------------------
   14. Hover Lift — Cards & Interactive Elements
   -------------------------------------------------------------------------- */
.hover-lift {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.hover-lift-sm {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift-sm:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Hover scale for logo / icon items */
.hover-scale {
    transition: transform var(--transition);
}

.hover-scale:hover {
    transform: scale(1.08);
}

/* Hover accent left-border (value cards) */
.hover-accent-border {
    border-left: 4px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hover-accent-border:hover {
    border-left-color: var(--accent);
    box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   15. Transition Utility
   -------------------------------------------------------------------------- */
.transition {
    transition: all var(--transition);
}

.transition-colors {
    transition: color var(--transition),
                background-color var(--transition),
                border-color var(--transition);
}

.transition-transform {
    transition: transform var(--transition);
}

.transition-opacity {
    transition: opacity var(--transition);
}

.transition-shadow {
    transition: box-shadow var(--transition);
}

/* --------------------------------------------------------------------------
   16. Page Transition
      Add .page-enter on the <main> tag via JS for a fade-in on load.
   -------------------------------------------------------------------------- */
.page-enter {
    animation: fadeIn 0.45s ease both;
}

/* Overlay for page transitions (JS-controlled) */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   17. Counter Animation Hook
      JS watches for `.count-up` elements inside `.in-view` and triggers
      the JavaScript counter. The CSS provides the initial hidden state
      and the reveal.
   -------------------------------------------------------------------------- */
.count-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.count-up.counting {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   18. Flash Notification / Toast
   -------------------------------------------------------------------------- */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    background: var(--primary);
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    animation: flashIn 4s ease forwards;
}

.toast-success {
    background: #15803d;
    border-left: 4px solid #22c55e;
}

.toast-error {
    background: #b91c1c;
    border-left: 4px solid #ef4444;
}

.toast-info {
    background: var(--secondary);
    border-left: 4px solid var(--accent);
}

.toast svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   19. Skeleton Screen Components
   -------------------------------------------------------------------------- */
.skeleton-text {
    height: 1em;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-90 { width: 90%; }
.skeleton-text.w-50 { width: 50%; }

.skeleton-heading {
    height: 1.75em;
    width: 55%;
    border-radius: 6px;
    margin-bottom: 16px;
}

.skeleton-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-btn {
    height: 44px;
    width: 140px;
    border-radius: var(--radius-sm);
}

/* Apply shimmer to all skeleton elements */
.skeleton-text,
.skeleton-heading,
.skeleton-avatar,
.skeleton-btn {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   20. Notification Badge Pulse
   -------------------------------------------------------------------------- */
.badge-pulse {
    position: relative;
}

.badge-pulse::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--white);
    animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   21. Accordion / Collapsible Transition
   -------------------------------------------------------------------------- */
.collapsible-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
}

.collapsible-content.expanded {
    max-height: 800px;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   22. Image Hover Zoom (Blog / Gallery)
   -------------------------------------------------------------------------- */
.img-zoom-wrapper {
    overflow: hidden;
    border-radius: var(--radius);
}

.img-zoom-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-zoom-wrapper:hover img {
    transform: scale(1.07);
}

/* --------------------------------------------------------------------------
   23. Focus Visible — Keyboard Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Remove default focus ring for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Button focus */
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}


