/* Agent Kellie - 007 x Matrix Fusion Theme - Enhanced */
/* Task 1: Core CSS Foundation - COMPLETE */

/* ============================================
   CSS CUSTOM PROPERTIES - Color Palette
   ============================================ */
:root {
    /* Primary Colors (maintained) */
    --spy-gold: #D4AF37;
    --spy-silver: #C0C0C0;
    --spy-black: #0A0A0A;
    --spy-dark-grey: #1C1C1C;
    --spy-red: #8B0000;
    --spy-white: #F5F5F5;
    
    /* Matrix Accents (NEW) */
    --matrix-green: #00FF41;
    --matrix-green-dim: rgba(0, 255, 65, 0.3);
    --matrix-green-glow: rgba(0, 255, 65, 0.6);
    --digital-cyan: #00F0FF;
    --deep-purple: #6B21A8;
    
    /* Gradients */
    --matrix-gradient: linear-gradient(135deg, #000428 0%, #004e92 100%);
    --holo-gradient: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(212, 175, 55, 0.1));
    --neon-glow: radial-gradient(circle, rgba(0, 255, 65, 0.3), transparent 70%);
    --spy-gradient: linear-gradient(135deg, #1a1a2e 0%, #0A0A0A 50%, #1C1C1C 100%);
    
    /* Shadows & Effects */
    --holo-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(0, 255, 65, 0.1);
    --neon-shadow: 0 0 15px var(--matrix-green-dim), 0 0 30px var(--matrix-green-dim);
    --glow-gold: 0 0 30px rgba(212, 175, 55, 0.5);
    --glow-green: 0 0 30px rgba(0, 255, 65, 0.5);
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Poppins', sans-serif;
}

/* ============================================
   BASE STYLES & ANIMATIONS
   ============================================ */

/* Scanline Overlay Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.05) 0px,
        rgba(0, 0, 0, 0.05) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanline-sweep 8s linear infinite;
}

@keyframes scanline-sweep {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

/* Glitch Animation */
@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); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-10deg); }
    40% { transform: skew(10deg); }
    60% { transform: skew(-5deg); }
    80% { transform: skew(5deg); }
    100% { transform: skew(0deg); }
}

@keyframes glitch-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Binary Text Decode Animation */
@keyframes binary-decode {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Pulse Animation */
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(0, 255, 65, 0); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* 3D Rotation Animation */
@keyframes rotate-3d {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(180deg); }
}

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

/* Fade In Up Animation */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Entry Animation (used by JS) */
.stagger-1 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.5s; opacity: 0; }
.stagger-6 { animation: fade-in-up 0.6s ease-out forwards; animation-delay: 0.6s; opacity: 0; }

/* Border Draw Animation */
@keyframes border-draw {
    0% { border-color: transparent; }
    100% { border-color: var(--spy-gold); }
}

/* Data Stream Animation */
@keyframes data-stream {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

/* Matrix Rain Canvas (set in JS) */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

/* ============================================
   HOLOGRAPHIC CARD STYLES
   ============================================ */
.holo-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: var(--holo-shadow);
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.holo-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(212, 175, 55, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: transform 0.6s ease;
}

.holo-card:hover::before {
    transform: rotate(45deg) translate(50%, 50%);
}

.holo-card:hover {
    transform: rotateX(5deg) rotateY(5deg) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(212, 175, 55, 0.3),
        inset 0 0 30px rgba(0, 255, 65, 0.2);
    border-color: var(--spy-gold);
}

.holo-card.glitch-hover:hover {
    animation: glitch 0.3s infinite;
}

.holo-card.glitch-hover:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 65, 0.1);
    mix-blend-mode: overlay;
    animation: glitch-opacity 0.3s infinite;
}

/* ============================================
   TERMINAL FORM STYLES
   ============================================ */
.terminal-input {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
    color: var(--matrix-green) !important;
    font-family: 'Courier New', monospace !important;
    font-size: 1rem !important;
    padding: 14px 18px !important;
    transition: all 0.3s ease !important;
}

.terminal-input::placeholder {
    color: rgba(0, 255, 65, 0.4) !important;
}

.terminal-input:focus {
    outline: none !important;
    border-color: var(--matrix-green) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.2) !important;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.terminal-input.typing-cursor::after {
    content: '|';
    animation: blink-cursor 1s step-end infinite;
    color: var(--matrix-green);
    margin-left: 2px;
}

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

.terminal-btn {
    background: rgba(0, 255, 65, 0.1) !important;
    border: 1px solid var(--matrix-green) !important;
    color: var(--matrix-green) !important;
    font-family: 'Courier New', monospace !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    position: relative;
    overflow: hidden;
}

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

.terminal-btn:hover::before {
    left: 100%;
}

.terminal-btn:hover {
    background: var(--matrix-green) !important;
    color: var(--spy-black) !important;
    box-shadow: var(--glow-green);
}

.terminal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Terminal Validation Messages */
.terminal-validation {
    font-family: 'Courier New', monospace !important;
    font-size: 0.9rem !important;
    margin-top: 8px !important;
    padding: 8px !important;
    border-left: 3px solid !important;
}

.terminal-validation.error {
    color: #EF4444 !important;
    border-color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.terminal-validation.success {
    color: var(--matrix-green) !important;
    border-color: var(--matrix-green) !important;
    background: rgba(0, 255, 65, 0.1) !important;
}

/* Terminal Dropdown */
.terminal-dropdown {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--matrix-green);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
}

.terminal-option {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--matrix-green);
    transition: all 0.2s ease;
}

.terminal-option:hover {
    background: rgba(0, 255, 65, 0.2);
    padding-left: 20px;
}

/* ============================================
   RESPONSIVE & ACCESSIBILITY
   ============================================ */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    #matrix-canvas {
        display: none !important;
    }
    
    .scanlines {
        display: none !important;
    }
    
    .holo-card {
        transform: none !important;
        transition: none !important;
    }
    
    .holo-card:hover {
        transform: translateY(-3px) !important;
    }
}

/* Mobile Performance Optimization */
@media (max-width: 768px) {
    #matrix-canvas {
        opacity: 0.05 !important;
    }
    
    .scanlines {
        display: none !important;
    }
    
    .holo-card {
        transform: none !important;
    }
    
    .holo-card:hover {
        transform: translateY(-3px) !important;
    }
    
    .stagger-1,
    .stagger-2,
    .stagger-3,
    .stagger-4,
    .stagger-5,
    .stagger-6 {
        animation: fade-in-up 0.4s ease-out forwards !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --spy-gold: #FFD700;
        --matrix-green: #00FF00;
    }
    
    .holo-card {
        background: rgba(0, 0, 0, 0.8) !important;
        border: 2px solid var(--spy-gold) !important;
    }
    
    .terminal-input {
        border: 2px solid var(--matrix-green) !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Effects */
.text-glitch {
    position: relative;
    display: inline-block;
}

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

.text-glitch::before {
    left: 2px;
    text-shadow: -1px 0 #00FF41;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.text-glitch::after {
    left: -2px;
    text-shadow: -1px 0 #D4AF37;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 10px, 0); }
    20% { clip: rect(60px, 9999px, 80px, 0); }
    40% { clip: rect(30px, 9999px, 50px, 0); }
    60% { clip: rect(70px, 9999px, 20px, 0); }
    80% { clip: rect(10px, 9999px, 90px, 0); }
    100% { clip: rect(50px, 9999px, 30px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(80px, 9999px, 30px, 0); }
    20% { clip: rect(20px, 9999px, 80px, 0); }
    40% { clip: rect(90px, 9999px, 10px, 0); }
    60% { clip: rect(30px, 9999px, 50px, 0); }
    80% { clip: rect(50px, 9999px, 70px, 0); }
    100% { clip: rect(10px, 9999px, 40px, 0); }
}

/* ============================================
   GLITCH TEXT EFFECT
   ============================================ */
.glitch-text {
    position: relative;
    display: inline-block;
}

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

.glitch-text:hover::before {
    animation: glitch 0.3s infinite;
    color: #00FF41;
    text-shadow: 2px 0 #00FF41;
    z-index: -1;
}

.glitch-text:hover::after {
    animation: glitch 0.3s infinite reverse;
    color: #D4AF37;
    text-shadow: -2px 0 #D4AF37;
    z-index: -2;
}

/* ============================================
   MISSION BINARY EFFECT
   ============================================ */
.mission-binary {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: rgba(0, 255, 65, 0.1);
    white-space: nowrap;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mission-item:hover .mission-binary {
    opacity: 0.6;
}

.mission-item {
    position: relative;
    padding-right: 120px;
}

/* ============================================
   MISSION BINARY EFFECT - ENHANCED
   ============================================ */
.mission-list {
    list-style: none;
    margin: 30px 0;
    position: relative;
}

.mission-list li {
    padding: 18px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    color: var(--spy-silver);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    padding-right: 150px;
    transition: all 0.3s ease;
    cursor: default;
}

.mission-list li:last-child {
    border-bottom: none;
}

.mission-list li i {
    color: var(--spy-gold);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mission-list li span {
    flex-grow: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.mission-list li:hover span {
    color: var(--spy-white);
    transform: translateX(5px);
}

.mission-binary {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(0, 255, 65, 0.3);
    white-space: nowrap;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
    letter-spacing: 2px;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
    pointer-events: none;
    animation: binary-flicker 2s infinite;
}

.mission-list li:hover .mission-binary {
    opacity: 0.8;
    color: #00FF41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.6);
    transform: translateY(-50%) scale(1.1);
}

@keyframes binary-flicker {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
    75% { opacity: 0.2; }
}

.mission-binary::before {
    content: '[';
    margin-right: 4px;
    color: rgba(0, 255, 65, 0.3);
}

.mission-binary::after {
    content: ']';
    margin-left: 4px;
    color: rgba(0, 255, 65, 0.3);
}

.mission-list li:hover .mission-binary::before,
.mission-list li:hover .mission-binary::after {
    color: #00FF41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
}

/* Mobile - Hide binary on touch devices */
@media (max-width: 768px) {
    .mission-binary {
        display: none;
    }
    
    .mission-list li {
        padding-right: 15px;
    }
    
    .mission-list li span {
        transform: none !important;
    }
}

/* ============================================
   TASK 1 COMPLETE - Foundation Ready
   ============================================ */
/* All base animations, utilities, and effects defined */
/* Ready for Hero Section (Task 2) implementation */
