/* ========================================
   ADVANCED STYLES - EXTRA MAGIC ✨
   ======================================== */

/* Particle Canvas */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Enhanced Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.05s ease;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary);
    background: transparent;
}

.cursor-follower {
    display: none;
}

/* Nav Controls */
.nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sound-toggle,
.game-btn-nav {
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border: var(--border-medium);
    border-radius: 50%;
    background: var(--bg-primary);
    transition: all 0.3s var(--bounce);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle:hover,
.game-btn-nav:hover {
    background: var(--accent);
    transform: scale(1.1) rotate(10deg);
}

.game-btn-nav {
    background: var(--secondary);
}

/* Interaction Hint */
.interaction-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: 20px;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-comic);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: hint-bounce 2s ease-in-out infinite;
}

.interaction-hint span {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: var(--primary);
}

.hint-close {
    background: var(--secondary);
    border: var(--border-medium);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-family: 'Bangers', cursive;
    cursor: pointer;
    transition: all 0.3s var(--bounce);
}

.hint-close:hover {
    background: var(--accent);
    transform: scale(1.1);
}

@keyframes hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* MINECRAFT LOADING SCREEN */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            #8B6914 0px,
            #8B6914 32px,
            #6B5108 32px,
            #6B5108 64px
        ),
        linear-gradient(180deg, #5D8C3E 0%, #8B6914 30%, #6B5108 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.3s steps(4), visibility 0.3s steps(4);
    image-rendering: pixelated;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    background: linear-gradient(180deg, #6B5344 0%, #5A4636 100%);
    border: 4px solid #3D2E23;
    padding: 2rem 3rem;
    box-shadow: 
        8px 8px 0 #1A1A1A,
        inset -4px -4px 0 rgba(0,0,0,0.4),
        inset 4px 4px 0 rgba(255,255,255,0.1);
}

.loader-icon {
    font-size: 4rem;
    animation: minecraft-load-bounce 0.5s steps(4) infinite alternate;
}

@keyframes minecraft-load-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-16px); }
}

.loader-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    margin: 1.5rem 0;
    text-shadow: 2px 2px 0 #000;
}

/* MINECRAFT XP BAR LOADING */
.loader-bar {
    width: 200px;
    height: 16px;
    background: #1A1A1A;
    border-radius: 0;
    overflow: hidden;
    margin: 0 auto;
    border: 3px solid #0D0D0D;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.5);
}

.loader-progress {
    height: 100%;
    background: linear-gradient(180deg, #7FFF00 0%, #5D8C3E 50%, #3B5323 100%);
    border-radius: 0;
    animation: minecraft-load-progress 1.5s steps(20) forwards;
    box-shadow: 0 0 8px rgba(127,255,0,0.6);
}

@keyframes minecraft-load-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Glowing Text Effect */
.glow-text {
    animation: text-glow 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
    from { text-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary); }
    to { text-shadow: 0 0 20px var(--primary), 0 0 30px var(--accent); }
}

/* Floating Animation for Elements */
.float-element {
    animation: gentle-float 3s ease-in-out infinite;
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(-5px) rotate(-2deg); }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

/* Pop Animation */
.pop {
    animation: pop-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Spotlight Effect */
.spotlight {
    position: relative;
}

.spotlight::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: spotlight-pulse 3s ease-in-out infinite;
}

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

/* Neon Border Effect */
.neon-border {
    position: relative;
}

.neon-border::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: neon-glow 3s ease infinite;
}

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

/* Glitch Effect */
.glitch {
    position: relative;
}

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

.glitch:hover::before {
    left: 2px;
    text-shadow: -2px 0 var(--primary);
    animation: glitch-1 0.3s infinite linear alternate-reverse;
}

.glitch:hover::after {
    left: -2px;
    text-shadow: 2px 0 var(--secondary);
    animation: glitch-2 0.3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 60% 0); }
    100% { clip-path: inset(60% 0 20% 0); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(60% 0 20% 0); }
    100% { clip-path: inset(20% 0 60% 0); }
}

/* Morphing Background */
.morph-bg {
    background: linear-gradient(-45deg, var(--primary), var(--secondary), var(--accent), var(--purple));
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

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

/* 3D Card Hover */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.card-3d .card-content {
    transform: translateZ(50px);
    transition: transform 0.3s ease;
}

/* Typewriter Cursor */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--primary);
    margin-left: 5px;
    animation: cursor-blink 1s step-end infinite;
}

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

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 10001;
    transition: width 0.1s ease;
}

/* Magnetic Hover Effect Indicator */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Tooltip Styles - JS handles tooltips in advanced-effects.js */
[data-tip] {
    position: relative;
    cursor: pointer;
}

/* Sticker Draggable Indicator */
.sticker {
    cursor: grab;
    user-select: none;
}

.sticker:active {
    cursor: grabbing;
}

/* Power-up Hover Effects */
.powerup-item {
    position: relative;
    overflow: hidden;
}

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

.powerup-item:hover::before {
    left: 100%;
}

/* Project Card Enhanced Hover */
.project-card {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.project-card:hover {
    z-index: 10;
}

/* Interactive Section Dividers */
.section-divider {
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='%23FF6B6B' d='M0,50 C360,100 720,0 1080,50 C1260,75 1380,75 1440,50 L1440,100 L0,100 Z'/%3E%3C/svg%3E");
    background-size: cover;
    margin: -1px 0;
}

/* Fun Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: trail-fade 0.5s ease forwards;
}

@keyframes trail-fade {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .interaction-hint {
        flex-direction: column;
        text-align: center;
        bottom: 80px;
        padding: 1rem;
    }
    
    .nav-controls {
        gap: 0.3rem;
    }
    
    .sound-toggle,
    .game-btn-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .loader-text {
        font-size: 1.5rem;
    }
}

/* Print Styles - Hide interactive elements */
@media print {
    .particle-canvas,
    .cursor-follower,
    .cursor-dot,
    .loading-screen,
    .interaction-hint,
    .nav-controls,
    #confetti-container {
        display: none !important;
    }
}
