/* Shadcn-Inspired UI Theme for IJV - Refined V2 */

:root {
    /* LIGHT MODE (Default) */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --destructive: 0 84.2% 60.2%;
    --border: 240 5.9% 90%;
    --radius: 0.5rem;
    
    /* TECH COLORS */
    --tech-glow: #00f2ff; /* The digital futuristic color */
}

/* DARK MODE OVERRIDES */
body.dark-mode {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --destructive: 0 85% 60%;
    --border: 240 3.7% 15.9%;
}

/* GLOBAL RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* UTILITIES */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-header { text-align: center; }
.bg-muted { background-color: hsl(var(--muted)); }

/* NAVBAR - Centered Links */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background-color: hsla(var(--background) / 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
    padding: 16px 0;
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center; position: relative;
}
.logo { z-index: 2; flex-shrink: 0;}
.logo img { height: 40px; width: auto; display: block; }

/* Links Absolute Center */
.nav-links {
    display: flex; gap: 30px;
    position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
    font-size: 0.9rem; font-weight: 500; color: hsl(var(--muted-foreground));
    transition: 0.2s; position: relative;
}
.nav-links a:hover { color: hsl(var(--foreground)); }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -4px; left: 0; background: var(--tech-glow); transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 15px; z-index: 2; }

/* Mobile Menu & Burger */
.burger { display: none; cursor: pointer; }
.mobile-menu {
    position: fixed; top: 72px; left: 0; width: 100%; height: 0;
    background: hsl(var(--background)); overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    transition: 0.4s ease; z-index: 99; border-bottom: 1px solid hsl(var(--border));
}
.mobile-menu.active { height: 300px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.mobile-menu a { font-size: 1.2rem; font-weight: 600; color: hsl(var(--foreground)); }

/* HERO SECTION */
#hero {
    position: relative; padding: 120px 0 80px 0;
    min-height: 85vh; display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
#neural-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}
.hero-content { text-align: center; max-width: 900px; position: relative; z-index: 2; }

.badge-pill {
    display: inline-block; padding: 6px 16px; border-radius: 9999px;
    background-color: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
    font-size: 0.8rem; font-weight: 600; margin-bottom: 24px;
    border: 1px solid hsl(var(--border));
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem; font-weight: 700;
    line-height: 1.1; margin-bottom: 24px;
    letter-spacing: -0.03em;
}
/* GLITCH TEXT STYLING */
.text-gradient {
    background: linear-gradient(to right, hsl(var(--foreground)), hsl(var(--muted-foreground)));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
/* Ensure Glitch text is visible properly */
.glitch-text {
    display: inline-block;
    min-width: 350px; /* Prevent layout shift during glitch */
    color: var(--tech-glow); /* Fallback color */
    -webkit-text-fill-color: initial; /* Override gradient for glitch color */
    color: hsl(var(--foreground));
}
body.dark-mode .glitch-text { color: #fff; }

.hero-sub {
    font-size: 1.15rem; color: hsl(var(--muted-foreground));
    max-width: 650px; margin: 0 auto 48px auto;
}

/* TERMINAL CARD - Fixed Overflow */
.terminal-card {
    max-width: 650px; margin: 0 auto;
    background-color: rgba(15, 23, 42, 0.95); /* Always dark terminal */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 242, 255, 0.15); /* Tech Glow Shadow */
    text-align: left; overflow: hidden;
    position: relative;
}
.terminal-header {
    background-color: rgba(255,255,255,0.05);
    padding: 10px 16px; display: flex; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 10; position: relative;
}
.header-dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background-color: #ef4444; } .yellow { background-color: #f59e0b; } .green { background-color: #10b981; }
.terminal-caption { font-size: 0.75rem; color: #94a3b8; margin-left: auto; font-family: monospace; }

.terminal-body {
    padding: 16px;
    font-family: 'Courier New', monospace; font-size: 0.85rem;
    height: 140px; /* Fixed Height */
    overflow-y: hidden; /* Hide scrollbar, handled by JS scroll */
    color: #00f2ff; /* Tech Blue Text */
    display: flex; flex-direction: column; justify-content: flex-end; /* Stick to bottom */
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%); /* Fade out top */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
}
.log-entry { margin-bottom: 6px; word-break: break-all; opacity: 0; animation: fadeIn 0.3s forwards; }
.system-msg { color: #94a3b8; }
@keyframes fadeIn { to { opacity: 1; } }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
    height: 40px; padding: 0 16px; cursor: pointer; transition: 0.2s; border: none;
}
.btn-primary {
    background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 15px var(--tech-glow); }

.btn-icon {
    background: transparent; border: 1px solid hsl(var(--border));
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: hsl(var(--foreground));
}
.btn-icon:hover { background-color: hsl(var(--secondary)); }

/* PROJECT IMAGES - Always White Background */
.project-img {
    height: 160px; width: 100%;
    background-color: #ffffff !important; /* Force White */
    display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid hsl(var(--border)); padding: 20px;
}
.project-img img { max-height: 80%; max-width: 80%; object-fit: contain; }

/* Cards & Grid */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 40px; }
.card {
    background-color: hsl(var(--card)); border: 1px solid hsl(var(--border));
    border-radius: var(--radius); padding: 24px; transition: 0.3s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1); border-color: var(--tech-glow); }

/* Project Badges */
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; margin-top:10px}
.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; border: 1px solid; }
.badge-destructive { border-color: hsl(var(--destructive)); color: hsl(var(--destructive)); }
.link-arrow { margin-top: auto; padding-top: 16px; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.link-arrow:hover { text-decoration: underline; color: var(--tech-glow); }
.link-arrow.disabled { opacity: 0.5; cursor: not-allowed; }

/* Profile Section */
.profile-card-large {
    background-color: hsl(var(--card)); border: 1px solid hsl(var(--border));
    border-radius: var(--radius); padding: 40px; margin-top: 40px;
}
.profile-header { margin-bottom: 40px; border-bottom: 1px solid hsl(var(--border)); padding-bottom: 20px; }
.profile-body { display: flex; gap: 40px; align-items: flex-start; }
.profile-image-wrapper { flex-shrink: 0; }
.profile-img-standard { width: 150px; height: auto; border-radius: var(--radius); border: 1px solid hsl(var(--border)); }
.btn-outline { border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); padding: 8px 16px; border-radius: 4px; font-size: 0.9rem; }
.btn-outline:hover { border-color: var(--tech-glow); color: var(--tech-glow); }
.social-row { display: flex; gap: 10px; margin-top: 20px; }

/* Footer */
.footer { border-top: 1px solid hsl(var(--border)); padding: 60px 0; margin-top: 80px; background-color: hsl(var(--background)); }
.footer-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-logo-img { width: 40px; margin-bottom: 15px; }
.copyright { font-size: 0.8rem; color: hsl(var(--muted-foreground)); }

/* RESPONSIVE */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .burger { display: block; }
    .burger .line { width: 25px; height: 3px; background-color: hsl(var(--foreground)); margin: 5px; transition: 0.3s; }
    .hero-title { font-size: 2.5rem; }
    .profile-body { flex-direction: column; }
    .nav-container { justify-content: space-between; }
}

/* AI TICKER (Hugging Face) - iOS Fixed Version */
.ai-ticker-wrap {
    background-color: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    border-bottom: 1px solid hsl(var(--border));
    padding: 20px 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    
    /* Fix for iOS clipping */
    z-index: 10;
    transform: translate3d(0,0,0); 
}

.ticker-heading {
    font-size: 0.7rem;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--tech-glow);
    text-transform: uppercase;
    margin-bottom: 5px;
    position: relative;
    z-index: 20;
}

.ticker-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    
    /* Improved Masking for iOS */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    
    /* Force GPU Rendering to prevent invisible elements on iPhone */
    transform: translate3d(0,0,0);
}

.ticker-track {
    display: inline-flex;
    gap: 40px;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.ticker-track.active {
    animation: ticker-scroll 40s linear infinite;
}

/* CRITICAL FIX: 
   Only allow pausing on devices that actually have a mouse (hover capability).
   This prevents the "tap freezes animation" bug on iPhone.
*/
@media (hover: hover) {
    .ticker-container:hover .ticker-track {
        animation-play-state: paused;
    }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', monospace;
    font-size: 1rem;
    color: hsl(var(--foreground));
    background: hsla(var(--background) / 0.5);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid hsl(var(--border));
    
    /* Ensure visibility */
    position: relative;
    z-index: 15;
    flex-shrink: 0; /* Prevent shrinking on mobile */
}

.ticker-item i { color: var(--tech-glow); }
.ticker-meta { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-left: 5px; }

@keyframes ticker-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); } 
}