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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1624;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-cyan: #22d3ee;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    background-attachment: fixed;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    overflow-y: auto;
    height: 100%;
    background-color: var(--bg-primary);
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Lightweight glass (no blur) for large lists */
.glass-lite {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 16px 0 rgba(15, 23, 42, 0.6);
}

/* Hero gradient background */
.hero-gradient {
    background: radial-gradient(ellipse at top, #1e293b 0%, #0f1624 50%, #0a0e1a 100%);
    position: relative;
    min-height: 100vh;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Accent text gradient */
.accent-text {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Project card hover effects */
.project-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 20px 40px rgba(96, 165, 250, 0.2);
}

/* Image styling */
.project-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

/* Tech tags */
.tech-tag {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-blue);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(96, 165, 250, 0.25);
    transform: scale(1.05);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(96, 165, 250, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateY(-2px);
}

/* Navigation */
nav {
    transition: all 0.3s ease;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

nav.scrolled {
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Section animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Publication cards */
.publication-card {
    transition: all 0.3s ease;
    position: relative;
}

.publication-card:hover {
    transform: translateX(8px);
    border-left-color: var(--accent-blue);
}

/* Decorative elements */
.decorative-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.1), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Link alignment with icons */
a[class*="btn"] i,
a:not([class*="btn"]) i {
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

/* Better text alignment */
p, span, div {
    text-align: inherit;
}

/* Ensure consistent line heights */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

p {
    line-height: 1.6;
}

/* Icon alignment in buttons and links */
.btn-primary i,
.btn-secondary i,
a:not([class*="btn"]) i {
    vertical-align: baseline;
    line-height: 1;
}

/* Ensure flex items align properly */
.inline-flex {
    display: inline-flex;
    align-items: center;
}

/* Text alignment improvements */
.text-center {
    text-align: center;
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* Loading animation for images */
.image-loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Grid patterns */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(96, 165, 250, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Glow effects */
.glow-blue {
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* Navbar dropdown helper */
.nav-group:hover .nav-dropdown {
    display: block;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .accent-text {
        animation: none;
    }
    .fade-in-up,
    .project-card,
    .publication-card {
        animation: none;
        transition: none;
    }
    .animate-bounce {
        animation: none;
    }
}
