/* ═══════════════════════════════════════════════════════════
   PREMIUM VISUAL FX — THE AHMED ASHRAF SIGNATURE
   Features: Grain, AI Bot, Cinematic Progress, Glitch Text
   ═══════════════════════════════════════════════════════════ */

:root {
    --ai-primary: #4ade80;
    /* Matrix Green */
    --ai-glow: rgba(74, 222, 128, 0.4);
}

/* 🎞️ FILM GRAIN OVERLAY */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    /* Above everything but interactions */
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

/* 🚀 SCROLL PROGRESS BAR */
.scroll-progress-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.1s linear;
}

/* 🤖 AI ASSISTANT WIDGET */
.ai-assistant-wrap {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.ai-bubble {
    width: 60px;
    height: 60px;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--ai-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px var(--ai-glow);
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--ai-glow);
}

.ai-eye {
    width: 12px;
    height: 12px;
    background: var(--ai-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--ai-primary);
    animation: aiBlink 4s infinite;
}

.ai-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--ai-primary);
    border-radius: 50%;
    animation: aiPulse 2s infinite;
}

@keyframes aiBlink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

@keyframes aiPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ⌨️ AI TERMINAL */
.ai-terminal {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    overflow: hidden;
    display: none;
    /* Initially hidden */
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: terminalIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes terminalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-terminal.active {
    display: flex;
}

.terminal-header {
    background: rgba(74, 222, 128, 0.1);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
}

.terminal-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: var(--ai-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.terminal-close {
    background: none;
    border: none;
    color: #ff5f56;
    font-size: 18px;
    cursor: pointer;
}

.terminal-body {
    padding: 15px;
    height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #4ade80;
}

.terminal-line {
    margin-bottom: 8px;
    opacity: 0.9;
    line-height: 1.4;
}

.terminal-input-wrap {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(74, 222, 128, 0.1);
}

.terminal-prompt {
    color: var(--ai-primary);
    margin-right: 10px;
}

#terminalInput {
    background: none;
    border: none;
    color: #fff;
    width: 100%;
    outline: none;
    font-family: inherit;
}

/* 💎 GLASSMOPRHIC INDICATOR */
.section-tag {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* 💫 MAGNETIC GLOW FOR PORTFOLIO */
.portfolio-item:hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--accent-gradient);
    z-index: -1;
    filter: blur(10px);
    opacity: 0.5;
    border-radius: inherit;
}

/* LTR Support for Terminal */
body.ltr .ai-assistant-wrap {
    right: auto;
    left: 30px;
}

body.ltr .ai-terminal {
    right: auto;
    left: 0;
}