/* ===========================================
   Kuma Lab Portfolio - Custom Styles
   =========================================== */

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease;
    overflow-x: hidden;
}

/* ===========================================
   AI Visual Effects
   =========================================== */

/* Animated Gradient Background */
.dark body {
    background: linear-gradient(135deg, #0D0D0D 0%, #1A1A2E 50%, #0D0D0D 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

html:not(.dark) body {
    background: linear-gradient(135deg, #f6f6f8 0%, #e8e6f0 50%, #f6f6f8 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Grid Background Pattern */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: 
        linear-gradient(rgba(167, 143, 240, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 143, 240, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
}

html:not(.dark) .grid-bg {
    opacity: 0.05;
    background-image: 
        linear-gradient(rgba(100, 80, 180, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 80, 180, 0.2) 1px, transparent 1px);
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(167, 143, 240, 0.4);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(167, 143, 240, 0.3);
}

@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% { 
        opacity: 1;
        transform: translateY(80vh) translateX(10px) scale(1);
    }
    90% { 
        opacity: 1;
        transform: translateY(10vh) translateX(-10px) scale(1);
    }
    100% { 
        transform: translateY(-10vh) translateX(0) scale(0);
        opacity: 0;
    }
}

/* Enhanced Glow Effect */
.glow-effect {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(167, 143, 240, 0.15) 0%, rgba(167, 143, 240, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Glitch Effect on Title */
.glitch-title {
    position: relative;
}

.glitch-title:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-title:hover::before {
    animation: glitchTop 0.3s ease-in-out;
    color: rgba(0, 255, 255, 0.8);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-title:hover::after {
    animation: glitchBottom 0.3s ease-in-out;
    color: rgba(255, 0, 128, 0.8);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
    0%, 100% { opacity: 0; transform: translate(0); }
    20% { opacity: 0.8; transform: translate(-3px, 0); }
    60% { opacity: 0.8; transform: translate(3px, 0); }
}

@keyframes glitchBottom {
    0%, 100% { opacity: 0; transform: translate(0); }
    20% { opacity: 0.8; transform: translate(3px, 0); }
    60% { opacity: 0.8; transform: translate(-3px, 0); }
}

/* Neon Text Glow */
.neon-text {
    text-shadow: 
        0 0 10px rgba(167, 143, 240, 0.5),
        0 0 20px rgba(167, 143, 240, 0.3),
        0 0 40px rgba(167, 143, 240, 0.2);
}

/* Neon Button Glow */
.neon-btn {
    box-shadow: 
        0 0 20px rgba(167, 143, 240, 0.3),
        inset 0 0 20px rgba(167, 143, 240, 0.1);
    transition: all 0.3s ease;
}

.neon-btn:hover {
    box-shadow: 
        0 0 30px rgba(167, 143, 240, 0.5),
        0 0 60px rgba(167, 143, 240, 0.3),
        inset 0 0 30px rgba(167, 143, 240, 0.2);
}

/* Scanning Line Effect */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(167, 143, 240, 0.5), transparent);
    animation: scan 8s linear infinite;
    pointer-events: none;
    z-index: 100;
    opacity: 0.3;
}

@keyframes scan {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* Dark Mode Background */
.dark body {
    background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
}

/* Light Mode Background */
html:not(.dark) body {
    background: linear-gradient(180deg, #ffffff 0%, #f6f6f8 100%);
}

/* Typography */
h1, h2, h3, h4, .font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* Glass Card Effect */
.glass-card {
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.dark .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html:not(.dark) .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Glow Effect */
.glow-effect {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 143, 240, 0.12) 0%, rgba(167, 143, 240, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Lab Notebook Border */
.lab-notebook-border {
    border-left: 2px dashed rgba(167, 143, 240, 0.2);
}

/* Theme Toggle Button Animation */
.theme-toggle {
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Smooth transitions for theme switching */
nav,
.glass-card,
a,
button,
p,
h1, h2, h3, h4, h5, h6,
span {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* ===========================================
   Scroll Animations
   =========================================== */

/* Initial state - hidden and offset to the right */
.animate-on-scroll {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Visible state - animated in */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation delays for timeline items */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }

/* Timeline dot animation */
.timeline-dot {
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-on-scroll.visible .timeline-dot {
    transform: scale(1);
}

/* Timeline line grow animation */
.timeline-line {
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.5s ease-out 0.2s;
}

.animate-on-scroll.visible .timeline-line {
    transform: scaleY(1);
}
