/* Custom CSS for Portfolio Website */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #a855f7;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --dark: #030712;
    --light: #ffffff;
    --neon-purple: #b829dd;
    --neon-pink: #ff2d92;
    --neon-blue: #00d4ff;
    --neon-green: #00ff88;
}

/* Animated Gradient Text */
.animate-gradient {
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    cursor: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--accent), var(--primary));
}

/* Loading Screen */
#loading-screen {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

/* Custom Cursor */
#cursor,
#cursor-follower {
    pointer-events: none;
    z-index: 9999;
    position: fixed;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

#cursor {
    width: 8px;
    height: 8px;
    background: white;
    mix-blend-mode: difference;
}

#cursor-follower {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    mix-blend-mode: difference;
    transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease;
}

body.hovering #cursor-follower {
    width: 48px;
    height: 48px;
    background: rgba(168, 85, 247, 0.2);
}

/* Particle Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Navigation */
#navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(3, 7, 18, 0.8);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--light);
}

/* Mobile Menu */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Typing Animation */
#typing-text {
    border-right: 2px solid var(--primary);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.1);
}

/* Project Cards */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.project-card.hidden {
    display: none;
}

/* Filter Buttons */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    color: var(--primary);
}

.filter-btn:hover:not(.active) {
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--primary);
}

/* Skill Items */
.skill-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.2);
}

/* Timeline */
.timeline-item {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item .glass-card {
    transition: all 0.3s ease;
}

.timeline-item .glass-card:hover {
    border-color: rgba(236, 72, 153, 0.3);
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.1);
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Modal */
#project-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#project-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#project-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#project-modal .glass-card {
    max-height: 90vh;
    overflow-y: auto;
}

/* Glow Effects */
.glow-purple {
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.3);
}

.glow-pink {
    box-shadow: 0 0 60px rgba(236, 72, 153, 0.3);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Hover Effects */
.btn-gradient {
    position: relative;
    overflow: hidden;
}

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

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

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    #cursor,
    #cursor-follower {
        display: none;
    }
    
    body {
        cursor: auto;
    }
    
    .timeline-item {
        transform: none;
    }
    
    .timeline-item .glass-card {
        margin: 0 1rem;
    }
}

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

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.5); }
}

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

/* Utility Classes */
.backdrop-blur-xl {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Selection */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: white;
}

/* Focus States */
a:focus,
button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    #cursor,
    #cursor-follower,
    #particles,
    #loading-screen {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Magnetic Buttons */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Terminal Section */
#terminal-input {
    caret-color: var(--primary);
}

.terminal-cmd {
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-cmd:hover {
    transform: translateY(-2px);
}

/* Skills Network Canvas */
#skills-network {
    border-radius: 1rem;
}

/* Floating Tags Animation */
.floating-tag {
    animation: float 3s ease-in-out infinite;
}

.floating-tag:nth-child(1) { animation-delay: 0s; }
.floating-tag:nth-child(2) { animation-delay: 0.5s; }
.floating-tag:nth-child(3) { animation-delay: 1s; }
.floating-tag:nth-child(4) { animation-delay: 1.5s; }
.floating-tag:nth-child(5) { animation-delay: 2s; }
.floating-tag:nth-child(6) { animation-delay: 2.5s; }

/* Project Modal */
#project-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#project-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#project-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* AI Playground */
#tokenizer-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

#tokens-display span {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* GitHub Activity Heatmap */
#contribution-heatmap .heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    transition: transform 0.2s ease;
}

#contribution-heatmap .heatmap-cell:hover {
    transform: scale(1.3);
}

/* Lab Cards */
.lab-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lab-card:hover {
    transform: translateY(-8px) rotateX(5deg);
}

/* Command Palette */
#command-palette {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#command-palette.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#command-palette:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#command-input:focus {
    outline: none;
}

.command-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.command-item:hover,
.command-item.selected {
    background: rgba(168, 85, 247, 0.1);
}

/* AI Assistant Widget */
#assistant-chat {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#assistant-chat.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-message {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Cards */
.contact-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-card:hover {
    transform: translateY(-8px);
}

/* Scroll Progress */
#scroll-progress {
    transition: width 0.1s linear;
}

/* Neon Glow Effects */
.neon-glow-purple {
    box-shadow: 0 0 20px var(--neon-purple),
                0 0 40px var(--neon-purple),
                0 0 60px var(--neon-purple);
}

.neon-glow-pink {
    box-shadow: 0 0 20px var(--neon-pink),
                0 0 40px var(--neon-pink),
                0 0 60px var(--neon-pink);
}

.neon-glow-blue {
    box-shadow: 0 0 20px var(--neon-blue),
                0 0 40px var(--neon-blue),
                0 0 60px var(--neon-blue);
}

/* Glassmorphism Enhancements */
.glass-enhanced {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.1) 0%,
        rgba(236, 72, 153, 0.1) 50%,
        rgba(0, 212, 255, 0.1) 100%);
    background-size: 200% 200%;
    animation: holographic-shift 5s ease infinite;
}

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

/* Cyberpunk Grid Background */
.cyberpunk-grid {
    background-image: 
        linear-gradient(rgba(168, 85, 247, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

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

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

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    color: var(--neon-purple);
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    color: var(--neon-pink);
}

@keyframes glitch-1 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-5px); }
}

@keyframes glitch-2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(5px); }
}

/* Scanline Effect */
.scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

/* Typing Cursor Enhancement */
.typing-cursor {
    animation: typing-blink 1s step-end infinite;
}

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

/* Smooth Page Transitions */
.page-transition {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Motion Blur Effect */
.motion-blur {
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.motion-blur:hover {
    filter: blur(2px);
}

/* Interactive Card Hover */
.interactive-card {
    perspective: 1000px;
}

.interactive-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

/* Dynamic Theme Glow */
.theme-glow {
    transition: box-shadow 0.5s ease;
}

.theme-glow:hover {
    box-shadow: 0 0 30px var(--primary),
                0 0 60px var(--secondary),
                0 0 90px var(--accent);
}

/* Section Snapping */
section {
    scroll-snap-align: start;
}

html {
    scroll-snap-type: y proximity;
}

/* Hover Sound Effect Indicator */
.sound-indicator {
    position: relative;
}

.sound-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.sound-indicator:hover::after {
    width: 200%;
    height: 200%;
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
    .interactive-card:hover .interactive-card-inner {
        transform: none;
    }
}

@media (max-width: 768px) {
    #cursor,
    #cursor-follower {
        display: none;
    }
    
    body {
        cursor: auto;
    }
    
    html {
        scroll-snap-type: none;
    }
    
    .lab-card:hover {
        transform: translateY(-4px);
    }
}

/* Comprehensive Responsive Fixes */
@media (max-width: 640px) {
    section {
        padding: 4rem 1rem !important;
    }
    
    #hero {
        min-height: auto;
        padding: 5rem 1rem 2rem 1rem !important;
    }
    
    .text-6xl {
        font-size: 2.5rem !important;
    }
    
    .text-8xl {
        font-size: 3rem !important;
    }
    
    .text-4xl {
        font-size: 1.5rem !important;
    }
    
    .text-5xl {
        font-size: 1.75rem !important;
    }
    
    .max-w-5xl {
        max-width: 100% !important;
    }
    
    .max-w-6xl {
        max-width: 100% !important;
    }
    
    .max-w-4xl {
        max-width: 100% !important;
    }
    
    /* Skills Network Responsive */
    #skills-network-container {
        height: 500px !important;
    }
    
    /* Playground Responsive */
    .playground-tab {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Footer Responsive */
    footer {
        padding: 2rem 1rem !important;
    }
    
    footer > div > .flex {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    footer .social-icons-row {
        flex-direction: row !important;
    }
    
    footer .text-center {
        text-align: center !important;
    }
    
    footer .md\\:text-left {
        text-align: center !important;
    }
    
    footer .md\\:text-right {
        text-align: center !important;
    }
}

/* Ensure Footer Visibility */
footer {
    position: relative;
    z-index: 10;
    margin-top: auto;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Section Spacing Fixes */
section {
    position: relative;
    z-index: 5;
    min-height: auto;
}

/* Body and HTML Fixes */
html {
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Container Responsive Fixes */
@media (max-width: 480px) {
    .p-12 {
        padding: 1.5rem !important;
    }
    
    .p-16 {
        padding: 2rem !important;
    }
    
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Timeline Responsive */
@media (max-width: 640px) {
    .timeline-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .timeline-item .glass-card {
        margin: 0 !important;
    }
}

/* Projects Grid Responsive */
@media (max-width: 640px) {
    .grid-cols-1 {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* Stats Cards Responsive */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
}

/* Contact Cards Responsive */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}
