/* ENHANCEMENTS CSS */
/* 1. Scroll Progress Bar */
#scroll-progress-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(to right, #00FBFB, #9B30FF);
    z-index: 9999; pointer-events: none; width: 0%;
    transition: width 0.1s ease-out;
}

/* 3. Cyan Curtain Reveal */
.cyan-curtain {
    position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
    background-color: #00FBFB; z-index: 10;
    transform: translateX(-100%);
    pointer-events: none;
}
.curtain-animate {
    animation: curtainWipe 0.7s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
@keyframes curtainWipe {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* 5. 3D Tilt */
.project-card-tilt {
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden; /* For shine */
}
.project-card-tilt.leaving {
    transition: transform 0.5s ease;
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) !important;
}
.holo-shine {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(45deg, transparent 20%, rgba(255,255,255,0.08) 40%, rgba(0,251,251,0.05) 50%, rgba(155,48,255,0.05) 60%, transparent 80%);
    background-size: 250% 250%;
    opacity: 0; transition: opacity 0.3s;
    mix-blend-mode: screen; z-index: 5;
    background-position: 250% 0;
}
.project-card-tilt:hover .holo-shine { opacity: 1; animation: holoPan 0.7s forwards; }
@keyframes holoPan { to { background-position: -250% 0; } }

/* 6. Section Glitch */
.glitching {
    animation: textGlitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes textGlitch {
    0% { transform: translate(0); text-shadow: none; opacity: 1; }
    20% { transform: translate(-3px, 2px); text-shadow: 4px 0 rgba(0,251,251,0.7); opacity: 0.8; }
    40% { transform: translate(3px, -2px); text-shadow: -4px 0 rgba(155,48,255,0.7); opacity: 0.9; }
    60% { transform: translate(-2px, 3px); text-shadow: 4px 0 rgba(0,251,251,0.7); opacity: 0.4; }
    80% { transform: translate(2px, -3px); text-shadow: -4px 0 rgba(155,48,255,0.7); opacity: 1; }
    100% { transform: translate(0); text-shadow: none; opacity: 1; }
}

/* 7. Ripple Click */
.click-ripple {
    position: fixed; pointer-events: none; transform: translate(-50%, -50%);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.click-ripple::after {
    content: ''; display: block; border: 2px solid #00FBFB; border-radius: 50%;
    width: 0; height: 0; opacity: 0.8;
    animation: rippleAnim 0.6s ease-out forwards;
}
@keyframes rippleAnim { 100% { width: 60px; height: 60px; opacity: 0; } }

/* 8. Staggered Hero Word Reveal */
.hero-word-wrap { overflow: hidden; display: inline-block; vertical-align: bottom; line-height: 1; padding-bottom: 5px; }
.hero-word-inner { display: inline-block; transform: translateY(100%); opacity: 0; padding-top: 5px;}
.word-reveal-anim { animation: wordReveal 0.4s ease-out forwards; }
@keyframes wordReveal { to { transform: translateY(0); opacity: 1; } }
.glow-flash { animation: glowFlash 0.5s ease-out; }
@keyframes glowFlash { 0%, 100% { text-shadow: none; filter: brightness(1); } 50% { text-shadow: 0 0 20px #00FBFB; filter: brightness(1.5); } }

/* 9. Film Grain */
#film-grain {
    position: fixed; inset: 0; z-index: 10001; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
}

/* 10. Neon lines */
#skills-svg-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: visible; width: 100%; height: 100%; }
.skill-line { stroke: #00FBFB; stroke-width: 1.5; opacity: 0; fill: none; stroke-dasharray: 10, 5; transition: opacity 1s; }
.skill-line.visible { opacity: 0.4; animation: dashFlow 3s linear infinite; }
@keyframes dashFlow { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }

/* 13. Matrix Canvas */
#matrix-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.08; width: 100%; height: 100%; }
.relative-prof { position: relative; overflow: hidden; }

/* 15. Glitch Flash */
.glitch-flash-overlay {
    position: fixed; inset: 0; z-index: 99999; pointer-events: none;
}

/* 16. Light Mode */
body.light-mode {
    --bg: #F0F4F8; background-color: var(--bg); color: #1a1a2e; transition: background-color 0.3s, color 0.3s;
}
body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.85) !important; border: 1px solid rgba(0,0,0,0.1) !important; color: #1a1a2e; box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
body.light-mode .text-white { color: #1a1a2e !important; }
body.light-mode .text-gray-400 { color: #555 !important; }
body.light-mode .border-gray-800 { border-color: #ddd !important; }
body.light-mode nav { background: rgba(255,255,255,0.95) !important; border-bottom-color: #eee !important; }
body.light-mode .glow-text, body.light-mode [style*="text-shadow"] { opacity: 0.8; }
body.light-mode #matrix-canvas { opacity: 0.01 !important; }
body.light-mode .hero-ring-1 { border-color: rgba(0,251,251,0.2) !important; }

/* 17. Konami Easter Egg */
.konami-active .matrix-canvas { filter: hue-rotate(180deg) brightness(2); opacity: 0.8 !important; }

/* 18. Filter Buttons */
.filter-btn {
    border: 1px solid rgba(0,251,251,0.3); color: #888; padding: 4px 16px; border-radius: 99px; font-size: 11px; cursor: pointer; transition: all 0.3s; font-family: 'Share Tech Mono', monospace; background: transparent;
}
.filter-btn:hover { background: rgba(0,251,251,0.05); }
.filter-btn.active {
    background: rgba(0,251,251,0.15); border-color: #00FBFB; color: #00FBFB; box-shadow: 0 0 10px rgba(0,251,251,0.2);
}
.project-hidden { opacity: 0 !important; transform: scale(0.95) !important; pointer-events: none !important; position: absolute !important; visibility: hidden !important; }

/* Fixes for curtain absolute positioning */
section { position: relative; overflow: hidden; }

/* PHASE 4: UI/VISUAL UPGRADES */

/* 1. Glassmorphism Navbar Scroll */
nav { transition: all 0.4s ease; transform: translateZ(0); }
nav.nav-scrolled {
    background: rgba(10,10,15,0.97) !important;
    backdrop-filter: blur(24px) !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    box-shadow: 0 1px 20px rgba(0,251,251,0.3) !important;
}

/* 2. Alternating Backgrounds */
body { background: #0A0A0F; }
#hero { background: #0A0A0F; }
#about { background: #0D0D1A; }
#skills { background: #0D0D1A; position: relative; }
#skills::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle 300px at center, rgba(0,251,251,0.04), transparent);
}
#arsenal { background: #080810; }
#services { background: #0A0A0F; }
#process { background: #0D0D1A; }
#projects { background: #0D0D1A; }
#experience { background: #0A0A0F; }
#credentials { background: #0D0D1A; }
#github { background: #0A0A0F; }
#contact { background: #0A0A0F; }

/* 3. Watermark Section Numbers */
.watermark-number {
    position: absolute; top: -10px; right: 20px; font-family: 'Orbitron', sans-serif;
    font-size: clamp(80px, 15vw, 180px); font-weight: 900;
    color: rgba(0,251,251,0.03); pointer-events: none; z-index: 0;
    transform-origin: top right;
    opacity: 0; transform: scale(1.15); transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.watermark-number.visible { opacity: 1; transform: scale(1); }

/* 4. Project Card Screenshot Placeholder + Scan */
.project-placeholder {
    height: 180px; width: 100%; border-bottom: 1px solid rgba(0,251,251,0.1);
    background: rgba(0,251,251,0.03); position: relative; overflow: hidden;
    margin-bottom: 24px; border-radius: 4px;
}
.circuit-overlay {
    position: absolute; inset: 0; opacity: 0.06;
    background-image: 
        linear-gradient(rgba(0,251,251,1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,251,251,1) 1px, transparent 1px);
    background-size: 20px 20px;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: #00FBFB; box-shadow: 0 0 10px #00FBFB;
    animation: placeholderScan 3s linear infinite;
}
.glass-card:hover .scan-line { animation-duration: 1s; }
.glass-card:hover .project-placeholder { border-bottom-color: rgba(0,251,251,0.4); }
@keyframes placeholderScan { 0% { top: -2px; } 100% { top: 100%; } }

/* 6. Active Sidebar Highlight & Mobile */
.nav-link.active-section { color: #00FBFB !important; }
.mobile-link.active-section { color: #00FBFB; background: rgba(0,251,251,0.1); border-left: 3px solid #00FBFB; padding-left: 20px; transition: all 0.2s; }

/* 7. Button Depth */
button:active:not(.nav-link):not(.mobile-link):not(#close-drawer-btn), .interactive.glass-card a:active {
    transform: scale(0.96) !important;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.5) !important;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.1s !important;
}

/* 8. Input Scan Animation */
form > div { position: relative; }
.input-scan-focus {
    position: absolute; bottom: 0; left: 0; height: 2px;
    background: #00FBFB; box-shadow: 0 0 10px #00FBFB;
    width: 0; transition: width 0.4s ease-out; pointer-events: none; z-index: 10;
}
input:focus ~ .input-scan-focus, textarea:focus ~ .input-scan-focus { width: 100%; }

/* 9. Skill Badge Tooltip */
.skill-badge-wrapper { position: relative; display: inline-block; cursor: pointer; }
.skill-tooltip {
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(10px);
    background: rgba(10,10,15,0.95); border: 1px solid rgba(0,251,251,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); border-radius: 4px;
    padding: 6px 10px; font-family: 'Share Tech Mono', monospace; font-size: 11px;
    color: #00FBFB; white-space: nowrap; max-width: 250px; pointer-events: none;
    opacity: 0; visibility: hidden; z-index: 50;
    transition: all 0.2s ease; transition-delay: 0s;
}
.skill-badge-wrapper:hover .skill-tooltip {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); transition-delay: 0.2s;
}

/* 10. Cert 3D Flip */
.cert-card-container { perspective: 800px; height: 120px; width: 100%; display: block; }
.cert-card-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cert-card-container:hover .cert-card-inner, .cert-card-container.flip-active .cert-card-inner {
    transform: rotateY(180deg);
}
.cert-front, .cert-back {
    position: absolute; inset: 0; backface-visibility: hidden;
    display: flex; flex-direction: column; justify-content: center;
    border-radius: 8px; padding: 1rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
}
.cert-back {
    background: rgba(10,10,15,0.95); transform: rotateY(180deg);
    border-color: rgba(0,251,251,0.3); align-items: center; text-align: center;
}
.cert-back.anthropic { border-color: #9B30FF; box-shadow: inset 0 0 15px rgba(155,48,255,0.1); }

/* 11. Timeline Pulse */
.timeline-dot { position: relative; }
.sonar-ring {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 14px; height: 14px; border-radius: 50%; pointer-events: none;
    opacity: 0; z-index: -1;
}
.sonar-active .sonar-ring { animation: sonarPulse 1.2s ease-out; }
.sonar-active .sonar-ring:nth-child(2) { animation-delay: 0.2s; }
.sonar-active .sonar-ring:nth-child(3) { animation-delay: 0.4s; }
@keyframes sonarPulse {
    0% { width: 14px; height: 14px; opacity: 0.8; }
    100% { width: 50px; height: 50px; opacity: 0; border: 1px solid currentColor; }
}

/* 12. Magnetic Underline */
#nav-underline {
    position: absolute; bottom: 0px; height: 2px;
    background: linear-gradient(90deg, transparent, #00FBFB, transparent);
    box-shadow: 0 0 8px #00FBFB; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0;
    pointer-events: none; left: 0; width: 0;
}

/* 13. Services Tilt */
.proj-tilt { display: flex; flex-direction: column; transform-style: preserve-3d; transition: transform 0.1s ease-out, box-shadow 0.3s ease; }
.proj-tilt:hover { border-top-color: var(--hover-color) !important; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* 14. Banner Ticker */
.otw-ticker { padding-left: 100%; animation: ticker 25s linear infinite; }
@keyframes ticker { 100% { transform: translateX(-100%); } }

/* 15. Shimmer Loading Bar */
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* 16. Flowing SVGs */
.process-path { stroke-dashoffset: 100; animation: dashFlow 2s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: 0; } }
.process-step:hover { box-shadow: 0 0 20px rgba(0,251,251,0.15); border-color: rgba(0,251,251,0.4); }

/* Glow Text for Boot overlay */
.glow-text { animation: bootGlow 2s infinite alternate; }
@keyframes bootGlow {
    from { text-shadow: 0 0 10px rgba(0,251,251,0.5); }
    to { text-shadow: 0 0 25px rgba(0,251,251,1), 0 0 10px #fff; }
}
