/* Theme-Specific Ambient Effects */

/* Effects Container */
.theme-effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* ========================= */
/* DARK MODE CYBER EFFECTS   */
/* ========================= */

/* Cyber Grid Background */
.dark-effects-active .cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: cyber-grid-move 20s linear infinite;
}

@keyframes cyber-grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* Cyber Particles */
.cyber-particle {
    position: absolute;
    background: rgba(0, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 0.3;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.5),
        0 0 20px rgba(0, 255, 255, 0.3);
    animation: cyber-particle-pulse 3s ease-in-out infinite;
}

@keyframes cyber-particle-pulse {
    0%, 100% { 
        opacity: 0.2;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Occasional particle flash */
.cyber-particle:nth-child(3n) {
    animation: cyber-particle-flash 5s ease-in-out infinite;
}

@keyframes cyber-particle-flash {
    0%, 90%, 100% { 
        opacity: 0.2;
        background: rgba(0, 255, 255, 0.6);
    }
    95% { 
        opacity: 0.8;
        background: rgba(255, 0, 255, 0.6);
        box-shadow: 
            0 0 20px rgba(255, 0, 255, 0.5),
            0 0 40px rgba(255, 0, 255, 0.3);
    }
}

/* Dark mode glitch effect on section titles */
.dark-effects-active .section-title {
    position: relative;
}

.dark-effects-active .section-title:hover {
    animation: text-glitch 0.3s ease-in-out;
}

@keyframes text-glitch {
    0%, 100% { 
        transform: translate(0);
        text-shadow: 0 0 10px var(--accent-color);
    }
    20% { 
        transform: translate(-2px, 2px);
        text-shadow: 
            2px 0 #ff00ff,
            -2px 0 #00ffff;
    }
    40% { 
        transform: translate(2px, -2px);
        text-shadow: 
            -2px 0 #ff00ff,
            2px 0 #00ffff;
    }
    60% { 
        transform: translate(-1px, 1px);
        text-shadow: 
            1px 0 #00ffff,
            -1px 0 #ff00ff;
    }
    80% { 
        transform: translate(1px, -1px);
        text-shadow: 0 0 10px var(--accent-color);
    }
}

/* Scanline effect for hero section in dark mode */
.dark-effects-active .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* Neon border glow on cards in dark mode */
.dark-effects-active .project-card:hover,
.dark-effects-active .skill-category:hover,
.dark-effects-active .education-item:hover {
    box-shadow: 
        0 0 5px var(--accent-color),
        0 0 10px var(--accent-color),
        0 0 20px rgba(var(--accent-rgb), 0.3),
        inset 0 0 5px rgba(var(--accent-rgb), 0.1);
}

/* ========================= */
/* LIGHT MODE AMBIENT EFFECTS */
/* ========================= */

/* Warm floating orbs */
.warm-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(210, 105, 30, 0.1) 0%,
        rgba(205, 133, 63, 0.05) 50%,
        transparent 70%
    );
    filter: blur(40px);
    animation: warm-orb-float 20s ease-in-out infinite;
}

@keyframes warm-orb-float {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    25% { 
        transform: translate(20px, -30px) scale(1.1);
        opacity: 0.6;
    }
    50% { 
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.4;
    }
    75% { 
        transform: translate(30px, 10px) scale(1.05);
        opacity: 0.5;
    }
}

/* Different timing for variety */
.warm-orb:nth-child(odd) {
    animation-direction: reverse;
}

.warm-orb:nth-child(3n) {
    background: radial-gradient(
        circle,
        rgba(205, 133, 63, 0.08) 0%,
        rgba(160, 82, 45, 0.04) 50%,
        transparent 70%
    );
}

/* Paper texture overlay */
.paper-texture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    mix-blend-mode: multiply;
}

/* Ink ripple effect */
.ink-ripple {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(210, 105, 30, 0.15) 0%,
        rgba(210, 105, 30, 0.05) 50%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    animation: ink-spread 1s ease-out forwards;
    pointer-events: none;
}

@keyframes ink-spread {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* Light mode: soft shadow on cards instead of neon */
.light-effects-active .project-card:hover,
.light-effects-active .skill-category:hover,
.light-effects-active .education-item:hover {
    box-shadow: 
        0 8px 30px rgba(210, 105, 30, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Warm underline on links in light mode */
.light-effects-active .nav-link:hover {
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(210, 105, 30, 0.2) 60%
    );
}

/* Light mode floating particles (subtle dust motes) */
.light-effects-active::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(210, 105, 30, 0.03) 1px, transparent 1px),
        radial-gradient(circle, rgba(139, 126, 115, 0.02) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 25px 25px;
    pointer-events: none;
    z-index: -1;
    animation: dust-float 30s linear infinite;
}

@keyframes dust-float {
    0% { background-position: 0 0, 25px 25px; }
    100% { background-position: 50px 50px, 75px 75px; }
}

/* ========================= */
/* INTERACTIVE HOVER EFFECTS */
/* ========================= */

/* Magnetic button effect (subtle) */
.hero-action-btn,
.cta-button,
.filter-toggle {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Button press effect */
.hero-action-btn:active,
.cta-button:active {
    transform: scale(0.98);
}

/* Card tilt effect on hover */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.project-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
}

/* Text reveal animation on scroll */
.section-title {
    opacity: 0;
    transform: translateY(20px);
    animation: reveal-up 0.6s ease forwards;
}

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================= */
/* RESPONSIVE               */
/* ========================= */

@media (max-width: 768px) {
    .theme-effects-container,
    .cyber-grid,
    .cyber-particle,
    .warm-orb,
    .paper-texture-overlay {
        display: none;
    }
    
    .dark-effects-active .hero-section::before,
    .light-effects-active::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-effects-container * {
        animation: none !important;
    }
    
    .project-card:hover {
        transform: translateY(-5px);
    }
}
