/* ═══════════════════════════════════════════════════════════════════
   PREMIUM ENHANCEMENTS - 2025 Edition
   Advanced animations, micro-interactions, and visual polish
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   1. SCROLL PROGRESS INDICATOR
   ═══════════════════════════════════════════════════════════════════ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0071e3, #2997ff, #5ac8fa);
    z-index: 10001;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(0, 113, 227, 0.5);
}

html.dark .scroll-progress {
    background: linear-gradient(90deg, #2997ff, #0a84ff, #5ac8fa);
    box-shadow: 0 0 15px rgba(41, 151, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   2. ENHANCED SECTION HEADERS - Better Dark Mode Contrast
   ═══════════════════════════════════════════════════════════════════ */

section h2 {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Exclude home/hero section from underline effect */
section:not(#home):not(.home-hero) h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #0071e3, #2997ff);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

section:not(#home):not(.home-hero) h2:hover::after {
    width: 100%;
}

/* Dark Mode - Enhanced Visibility */
html.dark section h2 {
    background: linear-gradient(135deg, #ffffff 0%, #d2d2d7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

html.dark section:not(#home):not(.home-hero) h2::after {
    background: linear-gradient(90deg, #2997ff, #5ac8fa);
    box-shadow: 0 0 12px rgba(41, 151, 255, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   3. PULSING CTA BUTTON - Attention Grabbing
   ═══════════════════════════════════════════════════════════════════ */

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 113, 227, 0.4),
            0 0 0 0 rgba(0, 113, 227, 0.4);
    }

    50% {
        box-shadow: 0 6px 20px rgba(0, 113, 227, 0.5),
            0 0 0 10px rgba(0, 113, 227, 0);
    }
}

.hero-cta {
    animation: pulseGlow 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.hero-cta:hover::before {
    left: 100%;
}

.hero-cta:hover {
    animation: none;
    transform: translateY(-3px) scale(1.02);
}

html.dark .hero-cta {
    animation: pulseGlowDark 2.5s ease-in-out infinite;
}

@keyframes pulseGlowDark {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(41, 151, 255, 0.4),
            0 0 0 0 rgba(41, 151, 255, 0.4);
    }

    50% {
        box-shadow: 0 6px 25px rgba(41, 151, 255, 0.5),
            0 0 0 12px rgba(41, 151, 255, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   4. ANIMATED SKILL COUNTERS
   ═══════════════════════════════════════════════════════════════════ */

.skill-progress-value {
    font-variant-numeric: tabular-nums;
    transition: all 0.1s ease;
}

.skill-progress-value.counting {
    color: #0071e3;
}

html.dark .skill-progress-value.counting {
    color: #2997ff;
}

/* ═══════════════════════════════════════════════════════════════════
   5. GLASSMORPHIC CARD ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════ */

.project-card,
.experience-content,
.education-card,
.blog-card,
.publication-card,
.cert-card {
    position: relative;
    overflow: hidden;
}

/* Subtle gradient overlay on hover */
.project-card::before,
.experience-content::before,
.education-card::before,
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 113, 227, 0) 0%,
            rgba(0, 113, 227, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

.project-card:hover::before,
.experience-content:hover::before,
.education-card:hover::before,
.blog-card:hover::before {
    opacity: 1;
}

html.dark .project-card::before,
html.dark .experience-content::before,
html.dark .education-card::before,
html.dark .blog-card::before {
    background: linear-gradient(135deg,
            rgba(41, 151, 255, 0) 0%,
            rgba(41, 151, 255, 0.05) 100%);
}

/* ═══════════════════════════════════════════════════════════════════
   6. TYPING ANIMATION FOR HERO
   ═══════════════════════════════════════════════════════════════════ */

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCursor {

    0%,
    100% {
        border-color: #0071e3;
    }

    50% {
        border-color: transparent;
    }
}

.hero-title.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #0071e3;
    animation: typewriter 2s steps(30) 1s forwards,
        blinkCursor 0.8s step-end 3s infinite;
}

html.dark .hero-title.typing-animation {
    border-right-color: #2997ff;
}

/* ═══════════════════════════════════════════════════════════════════
   7. FLOATING ELEMENTS - Parallax-like Effect
   ═══════════════════════════════════════════════════════════════════ */

@keyframes floatSubtle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(0.5deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-5px) rotate(-0.5deg);
    }
}

.profile-image-wrapper {
    animation: floatSubtle 4s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   8. ENHANCED SKILL CATEGORY TABS
   ═══════════════════════════════════════════════════════════════════ */

.skill-category-btn {
    position: relative;
    overflow: hidden;
}

.skill-category-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #0071e3, #2997ff);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-50%);
    border-radius: 3px;
}

.skill-category-btn:hover::after,
.skill-category-btn.active::after {
    width: 80%;
}

html.dark .skill-category-btn::after {
    background: linear-gradient(90deg, #2997ff, #5ac8fa);
}

/* ═══════════════════════════════════════════════════════════════════
   9. MAGNETIC BUTTON EFFECT (via JS class)
   ═══════════════════════════════════════════════════════════════════ */

.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.magnetic-btn span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ═══════════════════════════════════════════════════════════════════
   10.IMPROVED STAT COUNTER ANIMATION  
   ═══════════════════════════════════════════════════════════════════ */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-stat-value,
.project-stat-value,
.stat-number {
    animation: countUp 0.6s ease-out backwards;
}

.hero-stat:nth-child(1) .hero-stat-value {
    animation-delay: 0.2s;
}

.hero-stat:nth-child(2) .hero-stat-value {
    animation-delay: 0.4s;
}

.hero-stat:nth-child(3) .hero-stat-value {
    animation-delay: 0.6s;
}

/* ═══════════════════════════════════════════════════════════════════
   11. SMOOTH CARD BORDER GLOW ON HOVER
   ═══════════════════════════════════════════════════════════════════ */

.project-card,
.blog-card {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card:hover,
.blog-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 113, 227, 0.1);
}

html.dark .project-card:hover,
html.dark .blog-card:hover {
    border-color: rgba(41, 151, 255, 0.3);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(41, 151, 255, 0.2),
        0 0 30px rgba(41, 151, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════
   12. EXPERIENCE TAG HOVER EFFECTS
   ═══════════════════════════════════════════════════════════════════ */

.experience-tag {
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
}

.experience-tag:hover {
    transform: translateY(-2px) scale(1.05);
    background: #0071e3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

html.dark .experience-tag:hover {
    background: #2997ff;
    color: #fff;
    box-shadow: 0 4px 15px rgba(41, 151, 255, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   13. SUBTLE SECTION DIVIDERS
   ═══════════════════════════════════════════════════════════════════ */

section:not(:first-of-type)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(80%, 800px);
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 0, 0, 0.08) 20%,
            rgba(0, 0, 0, 0.08) 80%,
            transparent);
}

html.dark section:not(:first-of-type)::before {
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05) 20%,
            rgba(255, 255, 255, 0.05) 80%,
            transparent);
}

/* ═══════════════════════════════════════════════════════════════════
   14. IMPROVED FORM INPUT FOCUS STATES
   ═══════════════════════════════════════════════════════════════════ */

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0071e3 !important;
    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.1),
        0 4px 12px rgba(0, 113, 227, 0.1) !important;
    transition: all 0.25s ease;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
    border-color: #2997ff !important;
    box-shadow:
        0 0 0 3px rgba(41, 151, 255, 0.15),
        0 4px 15px rgba(41, 151, 255, 0.15) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   15. FOOTER SOCIAL ICONS ENHANCEMENT
   ═══════════════════════════════════════════════════════════════════ */

.footer-social a,
.social-link {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.footer-social a:hover,
.social-link:hover {
    transform: translateY(-5px) scale(1.1);
}

/* Social icon specific colors on hover */
.footer-social a[href*="linkedin"]:hover,
.social-link[href*="linkedin"]:hover {
    color: #0A66C2 !important;
}

.footer-social a[href*="github"]:hover,
.social-link[href*="github"]:hover {
    color: #333 !important;
}

html.dark .footer-social a[href*="github"]:hover,
html.dark .social-link[href*="github"]:hover {
    color: #fff !important;
}

.footer-social a[href*="twitter"]:hover,
.social-link[href*="twitter"]:hover {
    color: #1DA1F2 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   16. BACK TO TOP BUTTON ENHANCEMENT
   ═══════════════════════════════════════════════════════════════════ */

#go-to-top {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#go-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 113, 227, 0.4);
}

html.dark #go-to-top:hover {
    box-shadow: 0 10px 30px rgba(41, 151, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════
   17. CERTIFICATION CARD FLIP EFFECT HINT
   ═══════════════════════════════════════════════════════════════════ */

.cert-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s ease;
}

.cert-card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

html.dark .cert-card:hover {
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 10px 20px rgba(41, 151, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════
   18. IMPROVED MOBILE FLOATING BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* Match sizes for both floating buttons on mobile */
    #go-to-top,
    #chatbot-toggle {
        width: 56px !important;
        height: 56px !important;
        font-size: 1.25rem !important;
    }

    /* Go-to-top at BOTTOM (lower position) */
    #go-to-top {
        bottom: 24px !important;
        right: 20px !important;
    }

    /* Chatbot toggle at TOP (higher position, above go-to-top) */
    #chatbot-toggle {
        bottom: 96px !important;
        right: 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   19. LOADING SKELETON ANIMATION
   ═══════════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.06) 25%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

html.dark .skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   20. STAGGERED REVEAL FOR GRID ITEMS
   ═══════════════════════════════════════════════════════════════════ */

.stagger-reveal>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stagger-reveal.revealed>*:nth-child(1) {
    transition-delay: 0.05s;
}

.stagger-reveal.revealed>*:nth-child(2) {
    transition-delay: 0.10s;
}

.stagger-reveal.revealed>*:nth-child(3) {
    transition-delay: 0.15s;
}

.stagger-reveal.revealed>*:nth-child(4) {
    transition-delay: 0.20s;
}

.stagger-reveal.revealed>*:nth-child(5) {
    transition-delay: 0.25s;
}

.stagger-reveal.revealed>*:nth-child(6) {
    transition-delay: 0.30s;
}

.stagger-reveal.revealed>*:nth-child(7) {
    transition-delay: 0.35s;
}

.stagger-reveal.revealed>*:nth-child(8) {
    transition-delay: 0.40s;
}

.stagger-reveal.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY - REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    .scroll-progress,
    .hero-cta,
    .profile-image-wrapper,
    .hero-stat-value,
    .stagger-reveal>* {
        animation: none !important;
        transition: none !important;
    }

    section h2::after {
        transition: none;
    }
}