/* Custom animations and styles */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(88, 166, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(88, 166, 255, 0.6); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(360deg);
        opacity: 0;
    }
}

/* Particle background */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #58a6ff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFloat 8s infinite;
}

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

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

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #21262d;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* Skill bars animation */
.skill-card:hover .skill-bar {
    animation: fillBar 1s ease-out forwards;
}

@keyframes fillBar {
    to { width: 90%; }
}

/* Navigation link underline effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #7ee787;
    transition: width 0.3s ease;
}

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

/* Terminal cursor */
.animate-cursor {
    animation: blink 1s infinite;
}

/* Hover effects */
.terminal-window {
    animation: pulse-glow 3s infinite;
}

.terminal-window:hover {
    animation: none;
    box-shadow: 0 0 60px rgba(88, 166, 255, 0.4);
}

/* Project cards hover effect */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
}

/* Contact links hover */
.contact-link {
    transition: all 0.3s ease;
}

.contact-link:hover {
    transform: translateX(8px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .terminal-window {
        margin: 0 0.5rem;
        font-size: 14px;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    nav {
        padding: 0.5rem;
    }

    nav .flex {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    nav a {
        font-size: 0.875rem;
    }

    /* Improve terminal on mobile */
    #terminal-output {
        padding: 1rem;
        font-size: 0.75rem;
        min-height: 300px;
        max-height: 300px;
    }

    #terminal-input {
        font-size: 0.875rem;
    }

    /* Better spacing on mobile */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Adjust grid for help command */
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Better button sizing */
    .px-6.py-3 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 0.875rem;
    }

    /* Improve contact links on mobile */
    .contact-link {
        flex-direction: column;
        text-align: center;
    }

    .contact-link .ml-auto {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .terminal-window {
        font-size: 12px;
    }

    #terminal-output {
        font-size: 0.65rem;
        padding: 0.75rem;
    }

    nav a {
        font-size: 0.75rem;
    }
}

/* Selection color */
::selection {
    background: #58a6ff;
    color: #0d1117;
}

/* Loading animation for elements */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}