:root {
    --primary: #2563eb;
    --secondary: #4f46e5;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-yellow: #eab308;
    --dark: #1e293b;
    --light: #f8fafc;
}

body {
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(79, 70, 229, 0.2);
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Additional Modern Animation Styles */

/* Animated background gradient */
.gradient-bg-animate {
    background: linear-gradient(-45deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
    transform: translateY(-1px);
}

.nav-link.active::after {
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-purple));
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Mobile navigation active states */
#mobileMenu .nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0 -1rem;
    border-left: 3px solid var(--primary);
}

#mobileMenu .nav-link.active::after {
    display: none; /* Hide the underline in mobile menu */
}

.skill-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.contact-card {
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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: 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.6);
}

.btn-primary:hover::before {
    left: 100%;
}

.hover-3d {
    transition: transform 0.3s ease;
}

.hover-3d:hover {
    transform: perspective(500px) rotateX(10deg) rotateY(-10deg) translateZ(0);
}

.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary);
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-20px) rotate(0deg); }
    75% { transform: translateY(-15px) rotate(-2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.floating {
    animation: float 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* Blob animations */
@keyframes blob {
    0% { transform: scale(1) translate(0px, 0px); }
    33% { transform: scale(1.1) translate(30px, -50px); }
    66% { transform: scale(0.9) translate(-20px, 20px); }
    100% { transform: scale(1) translate(0px, 0px); }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-1000 {
    animation-delay: 1s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-3000 {
    animation-delay: 3s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Glow animation */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(138, 92, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.8), 0 0 30px rgba(79, 70, 229, 0.5); }
    100% { box-shadow: 0 0 5px rgba(138, 92, 246, 0.5); }
}

.glow-animation {
    animation: glow 3s infinite;
}

/* Pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Enhanced Modern Project Cards */
.project-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    /* Ensure proper stacking context */
    isolation: isolate;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.project-card .project-image-container {
    position: relative;
    overflow: hidden;
    height: 240px;
    border-radius: 16px 16px 0 0;
    z-index: 1; /* Establish stacking context */
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.9) contrast(1.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1; /* Keep image below overlay */
}

.project-card img.loaded {
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.08) rotate(1deg);
    filter: brightness(1) contrast(1.15);
}

/* Modern Project Overlay */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(139, 92, 246, 0.8) 50%,
        rgba(236, 72, 153, 0.9) 100%
    );
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
    z-index: 10;
    gap: 1rem;
}

.project-card:hover .project-overlay {
    opacity: 1;
    visibility: visible;
}

.project-overlay h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.project-card:hover .project-overlay h3 {
    transform: translateY(0);
}

.project-overlay p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.project-card:hover .project-overlay p {
    transform: translateY(0);
}

.project-overlay .btn {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    transform: translateY(20px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    white-space: nowrap;
    position: relative;
    z-index: 20;
    margin: 0 auto;
    flex-shrink: 0;
}

.project-card:hover .project-overlay .btn {
    transform: translateY(0);
    transition-delay: 0.3s;
}

.project-overlay .btn:hover {
    background: white;
    transform: translateY(-2px) !important; /* Ensure hover transform takes precedence */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Enhanced Project Card Content */
.project-card .project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.project-card .project-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.project-card .project-content p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

/* Enhanced Technology Tags */
.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tech-tag {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-tech-tag::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.project-card:hover .project-tech-tag::before {
    left: 100%;
}

.project-tech-tag:hover {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Shimmer animation for top border */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive adjustments for project cards */
@media (max-width: 768px) {
    .project-card .project-image-container {
        height: 200px;
    }
    
    .project-card .project-content {
        padding: 1.25rem;
    }
    
    .project-overlay {
        padding: 1.25rem;
    }
    
    .project-overlay h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .project-overlay p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }
    
    .project-overlay .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .project-card .project-image-container {
        height: 180px;
    }
    
    .project-tech-tags {
        gap: 0.375rem;
    }
    
    .project-tech-tag {
        padding: 0.25rem 0.625rem;
        font-size: 0.7rem;
    }
    
    .project-overlay {
        padding: 1rem;
    }
    
    .project-overlay h3 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .project-overlay p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .project-overlay .btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.8rem;
    }
}

/* Enhanced responsive grid for projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}

@media (min-width: 1280px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* Enhanced project card animations */
.project-card {
    animation: projectCardFloat 6s ease-in-out infinite;
}

.project-card:nth-child(2n) {
    animation-delay: -2s;
}

.project-card:nth-child(3n) {
    animation-delay: -4s;
}

@keyframes projectCardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.project-card:hover {
    animation-play-state: paused;
}

/* Loading state for images */
.project-card img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card img.loaded {
    opacity: 1;
}

/* Enhanced focus states for accessibility */
.project-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 4px;
}

.project-overlay .btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Parallax effect for project images */
.project-image-container {
    overflow: hidden;
    position: relative;
}

.project-card:hover .project-image-container img {
    transform: scale(1.08) translateZ(0);
    will-change: transform;
}

/* Enhanced staggered animations */
.project-card[data-aos="fade-up"] {
    transform: translateY(50px);
    opacity: 0;
}

.project-card[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

/* Glitch effect */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--light);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--accent-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--accent-purple);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(2px, 9999px, 28px, 0); }
    10% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(61px, 9999px, 78px, 0); }
    30% { clip: rect(15px, 9999px, 13px, 0); }
    40% { clip: rect(26px, 9999px, 48px, 0); }
    50% { clip: rect(24px, 9999px, 66px, 0); }
    60% { clip: rect(60px, 9999px, 23px, 0); }
    70% { clip: rect(75px, 9999px, 68px, 0); }
    80% { clip: rect(23px, 9999px, 91px, 0); }
    90% { clip: rect(69px, 9999px, 15px, 0); }
    100% { clip: rect(12px, 9999px, 40px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(59px, 9999px, 99px, 0); }
    10% { clip: rect(76px, 9999px, 35px, 0); }
    20% { clip: rect(23px, 9999px, 96px, 0); }
    30% { clip: rect(57px, 9999px, 72px, 0); }
    40% { clip: rect(35px, 9999px, 49px, 0); }
    50% { clip: rect(46px, 9999px, 15px, 0); }
    60% { clip: rect(2px, 9999px, 32px, 0); }
    70% { clip: rect(34px, 9999px, 9px, 0); }
    80% { clip: rect(82px, 9999px, 48px, 0); }
    90% { clip: rect(67px, 9999px, 43px, 0); }
    100% { clip: rect(5px, 9999px, 98px, 0); }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--accent-purple);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-purple) }
}

/* Fade in up animation */
.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced About Section Styles */

/* Animated background patterns */
.pattern-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#3b82f6 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.08;
    z-index: 0;
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Modern card styles */
.about-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.about-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.about-card::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    z-index: -2;
    transition: opacity 0.5s ease;
    right: -100px;
    bottom: -100px;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-card:hover::before {
    opacity: 1;
}

.about-card:hover::after {
    opacity: 0.3;
}

/* Personal & Contact Info Cards */
.info-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.info-card-header {
    position: relative;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
}

.info-card-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: width 0.4s ease;
}

.info-card:hover .info-card-header::after {
    width: 100%;
}

.info-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
    transition: all 0.4s ease;
}

.info-card:hover .info-card-icon {
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.info-item {
    position: relative;
    transition: all 0.3s ease;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.info-label {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.info-label i {
    margin-right: 0.5rem;
    color: #3b82f6;
    font-size: 0.875rem;
}

.info-value {
    color: #4b5563;
    padding-left: 1.5rem;
    word-break: break-word;
}

.info-value a {
    color: #3b82f6;
    transition: color 0.3s ease;
    text-decoration: none;
}

.info-value a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Enhanced Tech Stack */
.tech-stack-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin: 2rem 0;
}

.tech-stack-item {
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.tech-stack-item:hover {
    transform: translateY(-10px);
}

.tech-icon-advanced {
    width: 70px;
    height: 70px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.tech-icon-advanced::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tech-icon-advanced i {
    font-size: 35px;
    color: #3b82f6;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

.tech-stack-item:hover .tech-icon-advanced {
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.2);
}

.tech-stack-item:hover .tech-icon-advanced::before {
    opacity: 1;
}

.tech-stack-item:hover .tech-icon-advanced i {
    color: white;
    transform: scale(1.1);
}

.tech-name {
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: #4b5563;
    transition: color 0.3s ease;
}

.tech-stack-item:hover .tech-name {
    color: #1f2937;
    font-weight: 600;
}

/* Skill level indicator */
.skill-level {
    margin-top: 0.5rem;
    width: 70px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.skill-level-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 2px;
    width: 0;
    transition: width 0.8s ease;
}

.tech-stack-item:hover .skill-level-fill {
    width: var(--skill-level-percent);
}

/* Enhanced Connect With Me Section */
.connect-section {
    position: relative;
    padding: 2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.connect-section::before {
    content: "";
    position: absolute;
    top: -100px;
    left: -100px;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    opacity: 0.1;
}

.connect-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1f2937;
    padding-bottom: 0.5rem;
}

.connect-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

.social-links-advanced {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.social-link-advanced {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 1;
}

.social-link-advanced::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.social-link-advanced i {
    font-size: 24px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.social-link-advanced:hover {
    transform: translateY(-10px) scale(1.1);
}

.social-link-advanced:hover i {
    color: white;
    transform: scale(1.1);
}

.social-link-advanced:hover::before {
    opacity: 1;
}

.social-link-advanced.linkedin::before {
    background: #0077b5;
}

.social-link-advanced.github::before {
    background: #333333;
}

.social-link-advanced.twitter::before {
    background: #1da1f2;
}

.social-link-advanced.instagram::before {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Custom tooltip */
.social-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.social-tooltip::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent #1f2937 transparent;
}

.social-link-advanced:hover .social-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -40px;
}

/* Glass effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

/* 3D card effect */
.card-3d {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
    box-shadow: -20px 20px 30px rgba(0, 0, 0, 0.1);
}

/* Image Styles */
.profile-image {
    object-fit: cover;
    object-position: center 20%; /* Position to better show the face */
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: contrast(1.05) brightness(1.05);
    opacity: 0;
    animation: fadeIn 0.6s ease-in-out forwards;
}

.profile-image:hover {
    transform: scale(1.02);
    filter: contrast(1.1) brightness(1.1);
}

.image-loaded {
    opacity: 1;
    animation: imageFadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero section image container */
.hero-image-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    perspective: 1000px; /* For 3D effect */
    transform-style: preserve-3d;
    will-change: transform; /* Performance optimization */
    /* Add extra margin to give room for tech icons */
    margin-top: 30px;
    margin-bottom: 30px;
    /* Add a subtle initial transform for better 3D appearance */
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
    transition: transform 0.5s ease;
    z-index: 1;
}

@media (min-width: 768px) {
    .hero-image-container {
        width: 320px;
        height: 320px;
    }
}

@media (max-width: 767px) {
    /* More spacing on mobile to prevent overlapping */
    .hero-image-container {
        margin-top: 40px;
        margin-bottom: 40px;
    }
}

@media (min-width: 768px) {
    .hero-image-container {
        width: 320px;
        height: 320px;
    }
}

/* Tech icons positioning - using specific classes for better control */
.hero-image-container .pulse-animation {
    visibility: visible;
    position: absolute;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific positioning for each tech icon */
.php-icon {
    top: -20px;
    right: -20px;
}

.laravel-icon {
    bottom: -20px;
    left: -20px;
}

.js-icon {
    top: 50%;
    right: -35px;
    transform: translateY(-50%);
}

.database-icon {
    top: 20%;
    left: -35px;
}

.nodejs-icon {
    bottom: 20%;
    right: -35px;
}

/* Adjust icon size and appearance on hover */
.hero-image-container .tech-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    z-index: 20;
}

/* Preserve transform for specific icons on hover */
.js-icon:hover {
    transform: translateY(-50%) scale(1.2);
}

/* Enhanced tech icon visibility and spacing */
.tech-icon {
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-icon:hover {
    z-index: 20;
    animation-play-state: paused; /* Pause pulse animation on hover */
}

/* Tech icon Font Awesome icon styles */
.tech-icon i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Animation for tech icons */
@keyframes techIconPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Apply pulse animation to tech icons */
.tech-icon.pulse-animation {
    animation: techIconPulse 2s ease-in-out infinite;
}

/* Special handling for JS icon pulse animation */
.js-icon.pulse-animation {
    animation: techIconPulse 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes techIconPulseJs {
    0% { 
        transform: translateY(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
    }
    100% { 
        transform: translateY(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

.js-icon.pulse-animation {
    animation: techIconPulseJs 2s ease-in-out infinite;
}

/* Improved responsive positioning */
@media (max-width: 480px) {
    .hero-image-container {
        width: 220px;
        height: 220px;
        margin-top: 50px;
        margin-bottom: 50px;
    }
    
    .php-icon {
        top: -10px;
        right: -10px;
    }
    
    .laravel-icon {
        bottom: -10px;
        left: -10px;
    }
    
    .js-icon {
        top: 50%;
        right: -20px;
        transform: translateY(-50%);
    }
    
    .database-icon {
        top: 30%;
        left: -20px;
    }
    
    .nodejs-icon {
        bottom: 30%;
        right: -20px;
    }
}

/* Adjust positions for better spacing on mobile */
@media (max-width: 767px) {
    .php-icon {
        top: -15px;
        right: -15px;
    }
    
    .laravel-icon {
        bottom: -15px;
        left: -15px;
    }
    
    .js-icon {
        top: 50%;
        right: -25px;
        transform: translateY(-50%);
    }
    
    .database-icon {
        top: 25%;
        left: -25px;
    }
    
    .nodejs-icon {
        bottom: 25%;
        right: -25px;
    }
    
    .js-icon:hover {
        transform: translateY(-50%) scale(1.15);
    }
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    animation: rotateGradient 8s linear infinite;
    overflow: hidden;
    background-size: 300% 300%;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.hero-image-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f5f5f5; /* Fallback background */
}

/* Fix for profile image display */
.profile-image {
    object-position: center top; /* Show the face */
    transform-origin: center;
    will-change: transform;
    height: 100%;
    width: 100%;
    min-height: 100%;
    min-width: 100%;
    display: block;
    
    /* Add a slight shadow inside */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Image loading indicator */
.hero-image-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5, #e5e5e5);
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.image-loaded + .hero-image-inner::before,
.image-container-loaded .hero-image-inner::before {
    opacity: 0;
}

/* Fix for hero image on different devices */
@media (max-width: 767px) {
    .hero-image-container {
        margin: 0 auto;
        max-width: 240px;
    }
    
    .profile-image {
        object-position: center 30%; /* Adjust for mobile */
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hero-image-container {
        max-width: 280px;
    }
}

@media (min-width: 1025px) {
    .hero-image-container {
        max-width: 320px;
    }
}

/* Loading state animation */
.hero-image-wrapper.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Add a subtle shine effect to the hero image */
.hero-image-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shineEffect 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shineEffect {
    0% {
        transform: rotate(30deg) translate(-100%, -100%);
    }
    25%, 100% {
        transform: rotate(30deg) translate(100%, 100%);
    }
}

/* Gradient rotation animation for hero image */
@keyframes rotateGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Additional overlay positioning fixes */
.project-overlay > * {
    flex-shrink: 0; /* Prevent content from shrinking */
}

.project-overlay h3,
.project-overlay p,
.project-overlay .btn {
    max-width: 100%; /* Ensure content doesn't overflow */
    width: auto; /* Allow natural sizing */
}

/* Fix for any potential transform issues */
.project-card:hover .project-overlay {
    transform: none; /* Reset any inherited transforms */
}

/* Ensure proper box model */
.project-overlay * {
    box-sizing: border-box;
}

/* Project Card Button Positioning Fix */
.project-card {
    /* Ensure proper stacking context */
    isolation: isolate;
}

.project-image-container {
    /* Create a proper containing block for the overlay */
    position: relative;
}

/* Mobile-specific button fixes */
@media (max-width: 768px) {
    .project-overlay {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .project-overlay .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .project-overlay {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .project-overlay h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    .project-overlay p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .project-overlay .btn {
        font-size: 0.8rem;
        padding: 0.5rem 1.25rem;
    }
}