/* Custom CSS for Portfolio Website */

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Fix for hero section and navigation overlap */
#home {
    min-height: 100vh;
    padding-top: 5rem; /* Account for fixed navigation */
    position: relative;
    z-index: 1;
}

/* Ensure sections don't overlap */
section {
    position: relative;
    z-index: 2;
    transform: translateZ(0); /* Force hardware acceleration and prevent transform issues */
}

/* Navigation positioning */
nav {
    position: fixed;
    top: 0;
    z-index: 50;
    width: 100%;
}

/* About section spacing - ensure it's always visible */
#about {
    margin-top: 0;
    padding-top: 5rem;
    padding-bottom: 5rem;
    position: relative;
    z-index: 3;
    background-color: white;
}

/* Dark mode support for about section */
.dark #about {
    background-color: rgb(31 41 55); /* gray-800 */
}

/* Ensure all sections have proper spacing */
section:not(#home) {
    scroll-margin-top: 5rem; /* Offset for fixed navigation when scrolling */
    transform: none !important; /* Prevent any unwanted transforms */
}

/* Additional fix for section visibility */
#about, #skills, #projects, #contact {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    clear: both;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 1s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Navigation backdrop blur */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* Project card hover effects */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* Filter button animations */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    transform: scale(1.05);
}

/* Chat modal animations */
.chat-message {
    animation: slideInLeft 0.5s ease-out;
}

.chat-message.user {
    animation: slideInRight 0.5s ease-out;
}

/* Loading animation */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
    transform: translateY(-50%);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% {
        transform: translateY(-50%) scale(0);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

@keyframes loading3 {
    0% {
        transform: translateY(-50%) scale(1);
    }
    100% {
        transform: translateY(-50%) scale(0);
    }
}

@keyframes loading2 {
    0% {
        transform: translateY(-50%) translate(0, 0);
    }
    100% {
        transform: translateY(-50%) translate(24px, 0);
    }
}

/* Skills section animations */
.skill-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contact form focus styles */
.contact-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Hero section gradient animation */
.hero-gradient {
    background: linear-gradient(-45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    /* Hero section mobile adjustments */
    #home {
        min-height: 100vh;
        padding-top: 6rem; /* More space on mobile for navigation */
        padding-bottom: 2rem;
    }
    
    .animate-fade-in-up {
        animation-delay: 0.2s;
    }
    
    .project-card:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
}

/* Additional mobile adjustments */
@media (max-width: 480px) {
    #home {
        padding-top: 7rem; /* Even more space on very small screens */
    }
}

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: white;
    }
    
    .text-gray-600 {
        color: black;
    }
    
    .border-gray-200 {
        border-color: black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Intersection Observer animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
