/* Custom Fonts */
body {
    font-family: 'Inter', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

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

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

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #10b981, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #059669, #2563eb);
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Typing Animation */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
    color: #10b981;
}

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

/* Terminal Window Animation */
.terminal-window {
    position: relative;
    overflow: hidden;
}

.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(16, 185, 129, 0.1),
        transparent
    );
    animation: scan 3s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Skill Progress Animation */
.skill-progress {
    width: 0;
    animation: fillProgress 2s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes fillProgress {
    from { width: 0; }
}

/* Card Hover Effects */
.skill-card,
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-card::before,
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.5s;
}

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

.skill-card:hover,
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Glowing Button Effect */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::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-glow:hover::before {
    left: 100%;
}

/* Particle Background Animation */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

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

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

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

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

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

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

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

/* Code Syntax Highlighting */
.code-highlight {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    overflow: hidden;
}

.code-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
}

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

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.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);
}

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #10b981;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-particles {
        display: none;
    }
    
    .terminal-window {
        font-size: 0.75rem;
    }
    
    .skill-progress {
        animation-delay: 0.2s;
    }
}

/* Text Selection */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(16, 185, 129, 0.3);
    color: white;
}

/* Focus States for Accessibility */
.nav-link:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease,
                opacity 0.3s ease;
}

/* Animation Delays for Staggered Effects */
.skill-card:nth-child(1) .skill-progress { animation-delay: 0.1s; }
.skill-card:nth-child(2) .skill-progress { animation-delay: 0.2s; }
.skill-card:nth-child(3) .skill-progress { animation-delay: 0.3s; }
.skill-card:nth-child(4) .skill-progress { animation-delay: 0.4s; }

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* Matrix Rain Effect for Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    opacity: 0.03;
}

.matrix-column {
    position: absolute;
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    animation: matrixRain linear infinite;
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Print Styles */
@media print {
    .hero-particles,
    .matrix-bg,
    nav,
    .particle {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .terminal-window {
        border: 1px solid #ccc;
        background: #f5f5f5 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .skill-card,
    .service-card {
        border: 2px solid white;
    }
    
    .terminal-window {
        border: 2px solid #10b981;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .terminal-window::before,
    .particle,
    .typing-animation::after {
        animation: none !important;
    }
}