/* Additional styles for enhanced visual appeal */

/* Add a subtle gradient background to the hero section */
.hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(155, 89, 182, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

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

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(52, 152, 219, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Glowing effect for featured projects */
.project-card.featured {
    position: relative;
}

.project-card.featured::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent), #9b59b6, var(--accent));
    border-radius: inherit;
    z-index: -1;
    opacity: 0.3;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        opacity: 0.3;
    }
    to {
        opacity: 0.6;
    }
}

/* Enhanced button animations */
.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%;
}

/* Add a subtle border to sections */
.section {
    border-bottom: 1px solid var(--border);
}

.section:last-of-type {
    border-bottom: none;
}

/* Enhanced navigation active state */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    z-index: 10;
    opacity: 1;
    transition: all 0.3s ease;
    animation: dotPulse 2s infinite;
}

.nav-link {
    position: relative;
    padding-bottom: 12px; /* Add padding to ensure dot has space */
    transition: color 0.3s ease;
}

/* Enhanced dark mode navigation support */
[data-theme="dark"] .nav {
    background: rgba(26, 26, 26, 0.95) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-brand {
    color: var(--text-primary);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover {
    color: var(--accent);
}

[data-theme="dark"] .nav-link.active {
    color: var(--accent) !important;
}

/* Enhanced scrolled navigation states */
.nav.scrolled {
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .nav.scrolled {
    background: rgba(26, 26, 26, 0.98) !important;
    border-bottom-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .nav.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Hover effect for navigation dots */
.nav-link:hover::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    opacity: 0.5;
    z-index: 9;
}

.nav-link.active:hover::before {
    display: none;
}

/* Dot pulse animation */
@keyframes dotPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.8;
    }
}

/* Ensure the dot is visible in both light and dark themes */
[data-theme="dark"] .nav-link.active::after {
    background: var(--accent);
    box-shadow: 0 0 4px rgba(255, 107, 107, 0.6);
}

[data-theme="light"] .nav-link.active::after {
    background: var(--accent);
    box-shadow: 0 0 2px rgba(255, 107, 107, 0.4);
}

/* Force visibility for testing */
.nav-link.active {
    color: var(--accent) !important;
}

/* Loading animation for the page */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(52, 152, 219, 0.1);
    z-index: 1001;
}

.scroll-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #9b59b6);
    width: 0%;
    transition: width 0.1s ease;
}

/* Timeline Animations */
.timeline-item {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
    transition-delay: var(--animation-delay, 0s);
}

.timeline-item.timeline-animate {
    opacity: 1;
    transform: translateX(0);
}

.timeline-marker {
    transform: scale(0);
    transition: transform 0.4s ease;
    transition-delay: calc(var(--animation-delay, 0s) + 0.2s);
}

.timeline-item.timeline-animate .timeline-marker {
    transform: scale(1);
}

.timeline-content {
    transform: translateY(20px);
    transition: transform 0.4s ease;
    transition-delay: calc(var(--animation-delay, 0s) + 0.3s);
}

.timeline-item.timeline-animate .timeline-content {
    transform: translateY(0);
}

/* Achievement Animations */
.achievement-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s ease;
    transition-delay: var(--animation-delay, 0s);
}

.achievement-card.achievement-animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.achievement-icon {
    transition: transform 0.3s ease;
}

.achievement-icon.pulse-animation {
    animation: achievementPulse 0.6s ease;
}

@keyframes achievementPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Enhanced About Section Animations */
.about-location {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease;
    transition-delay: 0.3s;
}

.about-content.animate-in .about-location {
    transform: translateY(0);
    opacity: 1;
}

/* Enhanced Button Hover Effects */
.btn-outline {
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline:hover::before {
    left: 0;
}

/* Improved Stat Cards */
.stat {
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat:hover::before {
    opacity: 1;
}

/* Mobile Navigation Enhancements */
@media (max-width: 768px) {
    .nav-links {
        backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--border);
    }
    
    [data-theme="dark"] .nav-links {
        background: rgba(26, 26, 26, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link {
        padding: 1rem;
        border-radius: 0.5rem;
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    
    .nav-link:hover {
        background-color: var(--bg-secondary);
    }
    
    [data-theme="dark"] .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-item {
        margin-left: 2rem;
    }
    
    .timeline-marker {
        left: -1rem;
        width: 2rem;
        height: 2rem;
    }
    
    .achievement-card {
        margin-bottom: 1rem;
    }
}

/* Slide animations for notifications */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Staggered Animations for Grid Items */
.skills-grid .skill-card,
.projects-grid .project-card,
.achievements-grid .achievement-card,
.blog-grid .blog-card {
    animation-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Enhanced Focus States for Accessibility */
.achievement-card:focus-within,
.timeline-content:focus-within,
.stat:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth Theme Transition for New Elements */
.timeline-content,
.achievement-card,
.scroll-progress {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Enhanced floating elements */
.floating-element .icon {
    width: 2rem;
    height: 2rem;
    color: var(--accent);
}

/* Blog card enhancements */
.blog-card {
    position: relative;
    overflow: hidden;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Focus styles for accessibility */
.btn-primary:focus,
.btn-secondary:focus,
.btn-outline:focus,
.nav-link:focus,
.theme-toggle:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-group input:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Enhanced contact method hover effects */
.contact-method {
    position: relative;
    overflow: hidden;
}

.contact-method::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.contact-method:hover::before {
    transform: translateY(0);
}

.contact-method:hover {
    color: white;
}

/* Print styles */
@media print {
    .nav,
    .theme-toggle,
    .mobile-menu-toggle,
    .hero-actions,
    .contact-methods,
    .contact-form,
    .floating-elements {
        display: none;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .skill-progress-fill {
        width: 100% !important;
    }
}

/* Enhanced Hero Stats Animation */
.hero-stat {
    opacity: 1; /* Make visible by default */
    transform: translateY(0); /* Remove initial offset */
    transition: all 0.6s ease;
}

.hero-stat.animating {
    opacity: 1;
    transform: translateY(0);
}

.hero-stat.animated .stat-number {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
}

.hero-stat .stat-number {
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums;
}

.hero-stat:hover .stat-number {
    transform: scale(1.1);
    color: var(--primary);
}

/* Enhanced Image Loading and Animation */
.profile-image {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
}

.profile-image.loaded {
    opacity: 1;
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent)20, var(--primary)20);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-container:hover::before {
    opacity: 1;
}

.image-container .profile-image {
    position: relative;
    z-index: 2;
}

.image-overlay {
    z-index: 3;
}

/* Image Loading Skeleton */
.image-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.profile-image.loaded + .image-skeleton {
    display: none;
}

/* Fallback Avatar */
.fallback-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.fallback-avatar .icon {
    width: 60px;
    height: 60px;
    fill: white;
    opacity: 0.8;
}

/* Image Loading State */
.image-container.loading .profile-image {
    opacity: 0;
}

.image-container.loading .image-skeleton {
    opacity: 1;
}

.image-container.loaded .image-skeleton {
    opacity: 0;
    pointer-events: none;
}

.image-container.error .fallback-avatar {
    opacity: 1;
}

/* Enhanced Mobile Image */
@media (max-width: 768px) {
    .image-container {
        width: 200px;
        height: 200px;
    }
    
    .fallback-avatar .icon {
        width: 50px;
        height: 50px;
    }
}

/* Enhanced Interest Animations */
.interest-item {
    animation: slideInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--item-index, 0) * 0.1s);
    opacity: 0;
    transform: translateY(30px);
}

.interest-item.featured {
    animation-delay: 0.2s;
    animation-duration: 0.8s;
}

.interest-item:hover .interest-icon {
    animation: pulse 1.5s infinite;
}

.interest-stats .stat {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.interest-stats .stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.interest-item:hover .interest-stats .stat::before {
    left: 100%;
}

/* Enhanced Project Card Animations */
.project-card.mystery {
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.1),
        rgba(75, 0, 130, 0.1),
        rgba(25, 25, 112, 0.1)
    );
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.project-card.mystery:hover {
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.2),
        rgba(75, 0, 130, 0.2),
        rgba(25, 25, 112, 0.2)
    );
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.3);
}

/* Enhanced Skill Progress Bars */
.skill-progress-fill {
    position: relative;
    overflow: hidden;
}

.skill-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shine 2s infinite;
    animation-delay: var(--shine-delay, 0s);
}

@keyframes shine {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(var(--progress) + 50px)); }
}

/* Animated Greeting Styles */
#animatedGreeting {
    display: inline-block;
    position: relative;
    min-width: 80px;
    text-align: left;
    color: var(--accent);
    font-weight: 600;
    transition: all 0.3s ease;
}

.greeting-fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.greeting-fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Language-specific greeting colors */
.greeting-spanish { color: #ff6b35; }
.greeting-french { color: #4285f4; }
.greeting-italian { color: #34a853; }
.greeting-hindi { color: #ea4335; }
.greeting-english { color: var(--accent); }

@keyframes greetingPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.greeting-pulse {
    animation: greetingPulse 0.6s ease-in-out;
}
