/* Custom CSS for Portfolio Website */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3B82F6, #8B5CF6);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #2563EB, #7C3AED);
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 1s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 1s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 1s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* Intersection Observer animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation styles */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #3B82F6, #8B5CF6);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Button hover effects */
.btn-primary {
    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: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #3B82F6;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::before {
    width: 100%;
}

/* Skill card hover effects */
.skill-card {
    position: relative;
    overflow: hidden;
}

.skill-card::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;
}

.skill-card:hover::before {
    left: 100%;
}

/* Project card hover effects */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::after {
    opacity: 1;
}

/* Hero section background animation */
#home {
    position: relative;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(-45deg, #EEF2FF, #F8FAFC, #F3E8FF, #FEF3E2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

/* Typing animation for hero text */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Particle background effect */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 6px;
    height: 6px;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 8px;
    height: 8px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 4px;
    height: 4px;
    top: 80%;
    left: 40%;
    animation-delay: 4s;
}

/* Form styles */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success message */
.success-message {
    background: #10B981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 16px;
    transform: translateY(-10px);
    opacity: 0;
    animation: slideInUp 0.3s ease-out forwards;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {

    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.8s;
    }

    .project-card:hover {
        transform: scale(1.02);
    }

    .skill-card:hover {
        transform: scale(1.02);
    }
}

/* Custom scrollbar for mobile */
@media (max-width: 640px) {
    body::-webkit-scrollbar {
        width: 4px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1F2937;
        color: #F9FAFB;
    }

    .dark-mode .bg-white {
        background-color: #374151;
    }

    .dark-mode .text-gray-900 {
        color: #F9FAFB;
    }

    .dark-mode .text-gray-800 {
        color: #E5E7EB;
    }

    .dark-mode .text-gray-600 {
        color: #D1D5DB;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .bg-gradient-to-br,
    .bg-gradient-to-r {
        background: white !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }

    .skill-card,
    .project-card {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Hamburger bars*/
#mobile-menu-btn .bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
}

#mobile-menu-btn .bar:nth-child(1) {
    top: 4px;
}

#mobile-menu-btn .bar:nth-child(2) {
    top: 10px;
}

#mobile-menu-btn .bar:nth-child(3) {
    top: 16px;
}

/* Animate to X */
#mobile-menu-btn.open .bar:nth-child(1) {
    transform: rotate(45deg);
    top: 10px;
}

#mobile-menu-btn.open .bar:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.open .bar:nth-child(3) {
    transform: rotate(-45deg);
    top: 10px;
}

#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: all 0.4s ease-in-out;
}

#mobile-menu.show {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu-btn i {
    transition: transform 0.4s ease, opacity 0.3s ease;
}

#mobile-menu-btn i.fa-times {
    transform: rotate(180deg);
    color: #3B82F6;
}