:root {
    --bg: #0f172a;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --secondary: #9333ea;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --radius: 1rem;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; font-weight: 700; }

/* Utility Classes */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.gradient-text {
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    cursor: pointer;
    border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: white; color: black; }
.btn-secondary { border: 1px solid var(--border); color: white; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); }
.w-full { width: 100%; }

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out;
}
.orb-1 { width: 400px; height: 400px; background: var(--primary); top: 20%; left: 10%; }
.orb-2 { width: 500px; height: 500px; background: var(--secondary); bottom: 20%; right: 10%; animation-delay: -5s; }

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

/* Navbar */
#navbar {
    position: fixed; top: 0; width: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s;
}
.nav-wrapper {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-family: 'Outfit'; font-weight: 800; font-size: 1.5rem; color: white; text-decoration: none; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.2s;
    font-weight: 500;
}
.nav-links a:hover { color: white; }
.mobile-menu-btn { display: none; background: none; border: none; color: white; cursor: pointer; }
.mobile-menu { 
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg);
    padding: 2rem;
    border-bottom: 1px solid var(--border);
}
.mobile-menu a {
    display: block;
    margin-bottom: 1rem;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
}
.mobile-menu.active { display: block; }

/* Hero */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}
.profile-wrapper {
    position: relative;
    width: 160px; height: 160px;
    margin: 0 auto 2rem;
}
.img-container {
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg);
    position: relative;
    z-index: 2;
}
.img-container img { width: 100%; height: 100%; object-fit: cover; }
.glow-ring {
    position: absolute; inset: -5px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    filter: blur(15px);
    opacity: 0.6;
    animation: pulse 3s infinite;
}
h1 { font-size: 4rem; margin-bottom: 1.5rem; letter-spacing: -2px; line-height: 1.1; }
.subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }

@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.8; } }

/* Sections */
section { padding: 6rem 0; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); }

/* Cards & Grid */
.about-grid, .projects-grid, .skills-grid {
    display: grid;
    gap: 2rem;
}
.about-grid, .skills-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.projects-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-5px); border-color: var(--primary); }

/* Icons */
.icon-box {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
}
.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.purple { background: rgba(147, 51, 234, 0.1); color: #9333ea; }
.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }

/* Project Card Specifics */
.project-img {
    height: 200px;
    background: #222;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .project-img img { transform: scale(1.1); }

/* Preview Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}
.card:hover .project-overlay { opacity: 1; }

.btn-preview {
    background: white;
    color: black;
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.card:hover .btn-preview { transform: translateY(0); }

.view-project-link {
    display: block;
    text-align: center;
    width: 100%;
    padding: 0.5rem 0;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 1rem;
    transition: background 0.2s;
}
.view-project-link:hover { background: rgba(255, 255, 255, 0.05); }

.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.tag { font-size: 0.75rem; background: rgba(255,255,255,0.1); padding: 0.25rem 0.75rem; border-radius: 99px; }

/* Skills Specifics */
.skill-item { margin-bottom: 1.5rem; }
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0; transition: width 1s ease-out; }

/* Contact Form */
.contact-card {
    max-width: 600px; margin: 0 auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
input, textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: white;
    font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); }

.social-links {
    display: flex; justify-content: center; gap: 1.5rem; margin-top: 2rem;
}
.social-links a { color: var(--text-muted); transition: color 0.2s; }
.social-links a:hover { color: var(--primary); }

footer {
    text-align: center; padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Timeline / Roadmap Styles */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 4rem auto 0;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255,255,255,0.1);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.timeline-content {
    width: 45%;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    padding-right: 3rem;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    padding-left: 3rem;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    z-index: 2;
}

.timeline-date {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-img {
    width: 100%;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .hero-buttons { flex-direction: column; }
    
    .timeline::before { left: 20px; }
    .timeline-item { flex-direction: column; padding-left: 50px; }
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        width: 100%;
        padding: 0;
        text-align: left;
        margin: 0;
    }
    .timeline-dot { left: 20px; }
}

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.visible { opacity: 1; transform: translateY(0); }

/* Chatbot Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
    font-family: 'Inter', sans-serif;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.bot-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.bot-icon {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-chat:hover {
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.bot {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    color: #e2e8f0;
}

.message.user {
    background: var(--primary);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    color: white;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
    background: #0f172a;
}

.chat-input-area input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.chat-input-area button {
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-input-area button:hover {
    background: #2563eb;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
    width: fit-content;
    margin-bottom: 0.5rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 2rem);
        bottom: 90px;
        right: -1rem;
    }
}
