/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    /* slate-800 for dark */
}

html.light ::-webkit-scrollbar-track {
    background: #f1f5f9;
    /* slate-100 for light */
}

::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 4px;
}

/* sky-500 */
::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

/* sky-600 */

body {
    font-family: 'Inter', sans-serif;
}

.skill-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.skill-item {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
    border-color: rgba(59, 130, 246, 0.4);
}

.section-header {
    background: linear-gradient(90deg, #3B82F6, #10B981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-icon {
    background: linear-gradient(135deg, #3B82F6, #10B981);
    padding: 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reveal {
    opacity: 1;
    transform: translateY(0);
}

@keyframes float {

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

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

.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -2s;
}

.floating-card:nth-child(3) {
    animation-delay: -4s;
}

.hero-bg {
    background:
        radial-gradient(600px circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 50%),
        radial-gradient(400px circle at 80% 20%, rgba(245, 158, 11, 0.1), transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

    50% {
        transform: translateY(-20px);
    }
}

.glow {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.gradient-text {
    background: linear-gradient(45deg, #6366f1, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-glow {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5b5fc7, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, transparent, transparent);
    border: 2px solid #f59e0b;
    color: #f59e0b;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}

.social-icon {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.typing-animation {
    border-right: 2px solid #6366f1;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        border-color: #6366f1;
    }

    51%,
    100% {
        border-color: transparent;
    }
}

.reveal {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #6366f1;
    border-radius: 50%;
    opacity: 0.7;
    animation: particle-float 8s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(-50px);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.gradient-border {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px;
    border-radius: 16px;
}

.gradient-border-inner {
    background: #0f172a;
    border-radius: 14px;
    height: 100%;
}

.skill-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.skill-badge:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.parallax-bg {
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.profile-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px;
}

.profile-image img {
    border-radius: 16px;
    transition: transform 0.5s ease;
}

.profile-image:hover img {
    transform: scale(1.05);
}

.stats-counter {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: revealUp 0.8s ease forwards;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: revealLeft 0.8s ease forwards;
    animation-delay: 0.2s;
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    animation: revealRight 0.8s ease forwards;
    animation-delay: 0.4s;
}

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

@keyframes revealLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.glow-btn {
    position: relative;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.glow-btn:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    margin: 2rem 0;
}

/* Animation classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 1;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-scale-visible {
    opacity: 1;
    transform: scale(1);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f172a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

html.light #preloader {
    background-color: #f8fafc;
}

.loader {
    border: 6px solid #38bdf8;
    border-top: 6px solid transparent;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

*:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

#mobile-menu {
    transition: transform 0.3s ease-in-out;
}

#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: none;
    pointer-events: none;
}

.nav-link.active {
    color: #38bdf8;
    font-weight: 600;
}

/* sky-500 */
html.light .nav-link.active {
    color: #0ea5e9;
}

/* sky-600 */

/* Styling for AI enhance button and status */
.ai-enhance-button {
    transition: all 0.3s ease;
}

.ai-enhance-button.loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.ai-status {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    height: 1.2rem;
    /* Reserve space to prevent layout shift */
}

/* Services Cards - Floating Animation */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -2s;
}

.floating-card:nth-child(3) {
    animation-delay: -4s;
}

.floating-card:nth-child(4) {
    animation-delay: -1s;
}

/* Enhanced Service Card Hover Effects */
.floating-card .bg-darkCard,
.floating-card .bg-lightCard {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.floating-card .bg-darkCard::before,
.floating-card .bg-lightCard::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.6s ease;
    z-index: 1;
}

.floating-card:hover .bg-darkCard::before,
.floating-card:hover .bg-lightCard::before {
    left: 100%;
}

.floating-card:hover .bg-darkCard,
.floating-card:hover .bg-lightCard {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 25px 50px -12px rgba(59, 130, 246, 0.25),
        0 0 30px rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Service Card Icon Hover Effects */
.floating-card .text-primary {
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.floating-card:hover .text-primary {
    transform: scale(1.1) rotate(5deg);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
}

/* Service Card Title Hover Effects */
.floating-card h3 {
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.floating-card:hover h3 {
    color: #60a5fa;
    transform: translateX(5px);
}

/* Service Card Text Hover Effects */
.floating-card p {
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.floating-card:hover p {
    color: #e2e8f0;
}

/* Pause floating animation on hover for better interaction */
.floating-card:hover {
    animation-play-state: paused;
}

/* Project Showcase Styles */
.project-showcase {
    position: relative;
    padding: 2rem;
    border-radius: 1.5rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.3), rgba(15, 23, 42, 0.5));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); /* Safari support */
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, border-color; /* Optimize for animations */
}

.project-showcase:hover {
    transform: translateY(-8px) translateZ(0); /* Add translateZ for hardware acceleration */
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.1);
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .project-showcase {
        background: rgba(30, 41, 59, 0.8);
    }
}

.project-content {
    z-index: 10;
    position: relative;
}

.project-category span {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-title {
    line-height: 1.2;
    font-weight: 800;
}

.project-description {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: border-color, background-color;
}

.project-showcase:hover .project-description {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(30, 41, 59, 0.7);
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .project-description {
        background: rgba(30, 41, 59, 0.6);
    }
    
    .project-showcase:hover .project-description {
        background: rgba(30, 41, 59, 0.8);
    }
}

.feature-item {
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateX(4px);
}

.tech-tag {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

.project-link-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.project-link-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.project-link-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid #64748b;
    color: #64748b;
    font-weight: 600;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-link-secondary:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.project-image {
    position: relative;
    z-index: 10;
}

.project-image img {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Enhanced hover effects with better performance */
.project-showcase .project-image .relative {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.project-showcase:hover .project-image .relative {
    transform: scale(1.05) translateZ(0); /* Hardware acceleration */
}

/* Additional Project Cards */
.additional-project-card {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); /* Safari support */
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, border-color;
}

.additional-project-card:hover {
    transform: translateY(-5px) translateZ(0); /* Hardware acceleration */
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .additional-project-card {
        background: rgba(30, 41, 59, 0.9);
    }
}

/* Performance optimizations for project showcase */
.project-showcase,
.additional-project-card {
    /* Force hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Touch device support - add active states for mobile */
@media (hover: none) and (pointer: coarse) {
    .project-showcase:active,
    .additional-project-card:active {
        transform: translateY(-4px) translateZ(0);
        border-color: rgba(59, 130, 246, 0.3);
        box-shadow: 0 15px 30px rgba(59, 130, 246, 0.1);
    }
    
    .project-showcase:active .project-description {
        border-color: rgba(59, 130, 246, 0.3);
        background: rgba(30, 41, 59, 0.7);
    }
    
    .project-showcase:active .project-image .relative {
        transform: scale(1.02) translateZ(0);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .project-showcase,
    .additional-project-card,
    .project-description,
    .project-image img,
    .project-image .relative {
        transition: none;
        animation: none;
    }
    
    .project-showcase:hover,
    .additional-project-card:hover {
        transform: none;
    }
    
    .project-showcase:hover .project-image .relative {
        transform: none;
    }
}

/* Fix for Safari backdrop-filter rendering issues */
@supports (-webkit-backdrop-filter: blur(20px)) {
    .project-showcase,
    .additional-project-card {
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
    
    .project-description {
        backdrop-filter: blur(10px) saturate(180%);
        -webkit-backdrop-filter: blur(10px) saturate(180%);
    }
}