/* Custom CSS for animations and effects */

/* Particle Background */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    background: rgba(139, 92, 246, 0.1);
    animation-duration: 8s;
}

.particle:nth-child(3n) {
    background: rgba(59, 130, 246, 0.1);
    animation-duration: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #3b82f6);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Animated Skills Bars */
.skill-bar {
    width: 100%;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    padding: 0 6px;
}

.dark .skill-bar {
    background: #374151;
    border: 1px solid #4b5563;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
    border-radius: 9px;
    width: 0%;
    transition: width 2s ease-in-out;
    position: relative;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    margin-right: 8px;
    padding: 0 6px;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skill-bar.animated .skill-progress {
    width: var(--skill-width);
}

/* GitHub Stats */
.github-language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.github-language-item:last-child {
    border-bottom: none;
}

.github-language-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.dark .github-language-name {
    color: #d1d5db;
}

.github-language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.github-language-percentage {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.dark .github-language-percentage {
    color: #9ca3af;
}

.github-stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.github-stats-item:last-child {
    border-bottom: none;
}

.github-stats-label {
    font-weight: 500;
    color: #374151;
}

.dark .github-stats-label {
    color: #d1d5db;
}

.github-stats-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #6366f1;
}

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

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

/* Page loading animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Emergency hide loader after 10 seconds */
.page-loader {
    animation: emergency-hide 10s ease-in-out forwards;
}

@keyframes emergency-hide {
    0%, 90% { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-size: 18px;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Parallax effects */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.parallax-element {
    transform: translateZ(0);
    will-change: transform;
}

.parallax-slow {
    transform: translateY(var(--parallax-offset, 0));
}

.parallax-fast {
    transform: translateY(calc(var(--parallax-offset, 0) * 0.5));
}

/* Scroll-triggered animations - DISABLED */
.animate-on-scroll {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

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

/* Smooth section transitions */
section {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Enhanced section backgrounds */
section:nth-child(even) {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.dark section:nth-child(even) {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

section:nth-child(odd) {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
}

.dark section:nth-child(odd) {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

/* Programming language icons animations */
.animate-float-python {
    animation: float-python 4s ease-in-out infinite;
    animation-delay: 0s;
}

.animate-float-js {
    animation: float-js 3.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

.animate-float-java {
    animation: float-java 4.2s ease-in-out infinite;
    animation-delay: 1s;
}

.animate-float-html {
    animation: float-html 3.8s ease-in-out infinite;
    animation-delay: 1.5s;
}

.animate-float-css {
    animation: float-css 4.1s ease-in-out infinite;
    animation-delay: 2s;
}

.animate-float-csharp {
    animation: float-csharp 3.7s ease-in-out infinite;
    animation-delay: 2.5s;
}

.animate-float-git {
    animation: float-git 4.3s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes float-python {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    50% {
        transform: translateY(-12px) rotate(0deg);
    }
    75% {
        transform: translateY(-6px) rotate(-2deg);
    }
}

@keyframes float-js {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes float-java {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    33% {
        transform: translateY(-6px) translateX(3px);
    }
    66% {
        transform: translateY(-10px) translateX(-2px);
    }
}

@keyframes float-html {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(3deg);
    }
}

@keyframes float-css {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-4px) scale(1.02);
    }
    75% {
        transform: translateY(-8px) scale(0.98);
    }
}

@keyframes float-csharp {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-9px) rotate(-2deg);
    }
}

@keyframes float-git {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-5px) translateX(2px);
    }
    50% {
        transform: translateY(-11px) translateX(0px);
    }
    75% {
        transform: translateY(-7px) translateX(-1px);
    }
}


/* Enhanced hover animations */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Gradient buttons */
.gradient-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.gradient-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Tech icon animations */
.tech-icon {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-icon:hover {
    transform: scale(1.1);
}

/* Copy button animation */
.copy-btn {
    position: relative;
    overflow: hidden;
}

.copy-btn::after {
    content: 'Скопировано!';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.copy-btn.copied::after {
    transform: translateY(0);
}

/* Form validation styles */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Language switcher */
.lang-btn {
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn.active {
    background: #6366f1;
    color: white;
}

.lang-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* Dark theme language buttons */
.dark .lang-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* Social buttons */
.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.social-btn:hover::before {
    transform: translateX(100%);
}

.social-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.social-btn:active {
    transform: scale(0.95);
}
