/* Base Variables */
:root {
    --primary: #3b82f6;
    --accent: #8b5cf6;
    --dark: #0f172a;
    --light: #f8fafc;
    --card-dark: #1e293b;
    --card-light: #ffffff;
}

/* Premium Background Mesh */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
    background: #f8fafc;
    transition: background 0.5s ease;
}

.dark .mesh-bg {
    background: #0f172a;
}

.mesh-blob {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
}

.blob-1 {
    background: #3b82f6;
    top: -200px;
    right: -200px;
    animation: blob-float 20s infinite alternate;
}

.blob-2 {
    background: #8b5cf6;
    bottom: -300px;
    left: -200px;
    animation: blob-float 25s infinite alternate-reverse;
}

.blob-3 {
    background: #10b981;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blob-float 15s infinite alternate;
}

@keyframes blob-float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Typography & Colors */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes blob {
    0% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.1) translate(30px, -50px);
    }

    66% {
        transform: scale(0.9) translate(-20px, 20px);
    }

    100% {
        transform: scale(1) translate(0, 0);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s infinite;
}

/* Skills & Cards */
.skill-icon-card {
    position: relative;
    padding: 1.5rem;
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 2.5rem;
}

.dark .skill-icon-card {
    background: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.skill-icon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #1e293b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.skill-icon-card:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-15px);
}

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 0.5rem;
    background: #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
}

.dark .progress-bar-container {
    background: #334155;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0;
    transition: width 1.5s cubic-bezier(0.1, 0, 0.2, 1);
}

/* Nav Links */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 70%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

.dark ::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Badge Glow for Certificates */
.badge-glow {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.dark .badge-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Modal Styling */
#cert-modal {
    backdrop-filter: blur(10px);
}

.modal-content {
    animation: modal-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-in {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Stagger Reveal */
.reveal-stagger {
    transition-delay: calc(var(--stagger-delay, 0) * 100ms);
}

/* Loader Progress */
#loader-progress {
    box-shadow: 0 0 15px var(--primary);
}

/* Custom Scroll Logic for smoothing */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* Remove default focus outline and mobile tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

*:focus,
*:active {
    outline: none !important;
    box-shadow: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-offset-width: 0px !important;
}

button:focus,
a:focus,
input:focus,
.project-card:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
    /* Optional: if you want to remove border change too */
}

/* Theme Transition Effect */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.5s ease,
        color 0.5s ease,
        border-color 0.5s ease,
        box-shadow 0.5s ease !important;
}

/* Slide Up Animation for Bottom Nav */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Spin Slow Pause Animation for Language Icon */
@keyframes spin-slow-pause {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}

.animate-spin-slow-pause {
    animation: spin-slow-pause 8s ease-in-out infinite;
}