/* Faizan's Cyber/Tech Portfolio CSS */

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00d9ff, #a855f7);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #00b8d4, #9333ea);
}

/* Selection */
::selection {
    background: #00d9ff;
    color: #0a0a1a;
}

/* Code/Matrix Background */
.code-bg {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00d9ff, transparent),
        radial-gradient(2px 2px at 40px 70px, #a855f7, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, #22d3ee, transparent),
        radial-gradient(1px 1px at 160px 120px, #00d9ff, transparent);
    background-size: 200px 200px;
    animation: codeMove 20s linear infinite;
}

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

/* Floating Code Elements Animation */
.floating-code::before,
.floating-code::after {
    content: '</>';
    position: absolute;
    font-size: 24px;
    font-family: 'Fira Code', monospace;
    animation: floatCode 15s linear infinite;
    opacity: 0.3;
    color: #00d9ff;
}

.floating-code::before {
    left: 10%;
    animation-delay: 0s;
}

.floating-code::after {
    content: '{ }';
    right: 15%;
    animation-delay: 7s;
    color: #a855f7;
}

@keyframes floatCode {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Gradient Text Shimmer */
.shimmer-text {
    background: linear-gradient(
        90deg,
        #00d9ff 0%,
        #22d3ee 25%,
        #a855f7 50%,
        #22d3ee 75%,
        #00d9ff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

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

/* Glow Effects */
.glow-cyan {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5),
                0 0 40px rgba(0, 217, 255, 0.3),
                0 0 60px rgba(0, 217, 255, 0.1);
}

.glow-text {
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.8),
                 0 0 20px rgba(0, 217, 255, 0.5),
                 0 0 30px rgba(0, 217, 255, 0.3);
}

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

.btn-sparkle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-sparkle:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.card-float {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-float:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.2);
}

/* Image Border Gradient */
.border-gradient {
    border: 4px solid transparent;
    background: linear-gradient(#0a0a1a, #0a0a1a) padding-box,
                linear-gradient(135deg, #00d9ff, #22d3ee, #a855f7) border-box;
}

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

/* Form Input Focus */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.2);
}

/* Terminal-style cursor blink */
.cursor-blink::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: #00d9ff;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-code::before,
    .floating-code::after {
        display: none;
    }

    /* Mobile Navigation */
    nav {
        padding: 0.75rem 1rem !important;
    }

    /* Mobile Hero Adjustments */
    #home {
        padding-top: 5rem;
        min-height: auto;
        padding-bottom: 3rem;
    }

    #home h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    #home .text-xl {
        font-size: 1rem !important;
    }

    /* Mobile Profile Image */
    #home .w-80 {
        width: 280px !important;
        height: 280px !important;
    }

    /* Mobile Stats Grid */
    #home .gap-8 {
        gap: 1rem;
    }

    /* Mobile Section Padding */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Mobile Section Headers */
    section h2 {
        font-size: 2rem !important;
    }

    /* Mobile Experience Timeline */
    #experience .md\\:flex-row {
        flex-direction: column !important;
    }

    #experience .md\\:w-1\\/2 {
        width: 100% !important;
        padding-left: 2rem !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    #experience .md\\:left-1\\/2 {
        left: 0 !important;
    }

    /* Mobile Timeline Dates - prevent overlap */
    #experience .flex.items-center span {
        padding-left: 2rem !important;
    }

    /* Mobile Skills Grid */
    #skills .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    #skills .p-6 {
        padding: 1rem !important;
    }

    #skills .w-16 {
        width: 3rem !important;
        height: 3rem !important;
    }

    /* Mobile Contact Form */
    #contact .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #contact .md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Mobile About Grid */
    #about .md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #about .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Projects Grid */
    #projects .md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Reduce floating elements on mobile for performance */
    .code-bg {
        opacity: 0.3 !important;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    #home h1 {
        font-size: 2rem !important;
    }

    #home .w-80 {
        width: 220px !important;
        height: 220px !important;
    }

    /* Smaller buttons on mobile */
    #home .px-8 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    #home .py-3\\.5 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* Hide secondary stats on very small screens */
    #home .gap-8 > div:nth-child(2),
    #home .gap-8 > div:nth-child(4) {
        display: none;
    }
}

/* Pulse Animation for status indicator */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
    }
    50% { 
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.8), 0 0 30px rgba(34, 197, 94, 0.4);
    }
}

/* Code typing animation */
.typing {
    display: inline-block;
    animation: typing 3s steps(30) infinite;
}

@keyframes typing {
    0%, 100% { width: 0; }
    50% { width: 100%; }
}

/* Loading animation */
.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 217, 255, 0.3);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== PARALLAX EFFECTS ========== */

/* Parallax Container */
.parallax-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Parallax Elements */
.parallax-slow {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.parallax-medium {
    will-change: transform;
    transition: transform 0.08s ease-out;
}

.parallax-fast {
    will-change: transform;
    transition: transform 0.05s ease-out;
}

/* Floating Glow Orbs */
.parallax-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    will-change: transform;
}

.parallax-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.3), transparent);
    top: 10%;
    left: 10%;
}

.parallax-orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25), transparent);
    bottom: 20%;
    right: 10%;
}

.parallax-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Mouse Move Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg)) scale(1.02);
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for grid items */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Theme-aware scrollbar for light mode */
:root:not(.dark) ::-webkit-scrollbar-track {
    background: #f0f9ff;
}

:root:not(.dark) ::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00d9ff, #a855f7);
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    .parallax-orb {
        display: none;
    }
    
    .tilt-card:hover {
        transform: none;
    }
    
    .parallax-slow,
    .parallax-medium,
    .parallax-fast {
        transform: none !important;
    }
}

/* Project Card Hover */
.project-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.15);
}
