/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */

:root {
    /* Base Colors - Premium Enterprise Dark Theme */
    --bg-dark: #0a0f18;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Theme Primary (Electric Blue & Violet) */
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(59, 130, 246, 0.3);

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* --- Scroll Animations --- */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.fade-up.visible,
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

h1,
h2,
h3,
h4,
.logo,
.section-title {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

/* Dynamic Background Glows */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
}

.glow-2 {
    top: 30%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    opacity: 0.2;
}

.glow-3 {
    top: 80%;
    left: 30%;
    width: 40vw;
    height: 40vw;
    opacity: 0.1;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
}


/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 10, 12, 0.7);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a:not(.btn-primary) {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-links a:not(.btn-primary):hover {
    color: var(--text-main);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white !important;
    padding: 0.6rem 1.4rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.hero-content {
    z-index: 2;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 3rem;
    text-align: center;
    width: 100%;
}

@media (min-width: 800px) {
    .hero-content {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
    }
}

.hero-text {
    flex: 1;
    max-width: 700px;
}

.hero-image-container {
    flex-shrink: 0;
}

.greeting {
    font-size: 1.2rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.name {
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.role-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

@media (min-width: 800px) {
    .hero-actions {
        justify-content: flex-start;
    }
}

.btn-outline {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 2rem;
    border: 1px solid var(--accent-primary);
    color: var(--text-main);
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.btn-text:hover {
    gap: 0.8rem;
}

/* ==========================================================================
   Sections General
   ========================================================================== */
.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-alt {
    position: relative;
}

.bg-alt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-bg);
    z-index: -1;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 50%;
    height: 4px;
    background: var(--accent-primary);
    margin-top: 0.5rem;
    border-radius: 2px;
}

/* ==========================================================================
   Projects Grid (Featured Engineering)
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(20, 20, 25, 0.7);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 1.5rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-smooth);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 15px 35px var(--accent-glow);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    display: inline-block;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: 1rem;
    align-self: flex-start;
}

.project-content h3 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.project-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

/* ==========================================================================
   About Grid
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
}

.highlight-text {
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.about-text p:not(.highlight-text) {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.contact-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.contact-badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-badges i {
    color: var(--accent-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card {
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.flex-col {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.award-icon {
    font-size: 2.5rem;
    color: #fbbf24;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

/* ==========================================================================
   Skills Container
   ========================================================================== */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1rem;
    transition: var(--transition-smooth);
}

.skill-category:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ==========================================================================
   Experience Timeline
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.4rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-content-card {
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    transition: var(--transition-smooth);
}

.timeline-content-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.2rem;
}

.timeline-header h4 {
    font-size: 1.05rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.timeline-date {
    background: var(--glass-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.timeline-bullets {
    list-style: none;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.timeline-bullets li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.timeline-bullets li strong {
    color: var(--text-main);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(10, 10, 12, 0.8);
}

.footer-logo {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-logo span {
    color: var(--accent-primary);
}

.footer-content .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-links a {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 1.5rem;
    color: var(--text-muted);
}

.social-links a:hover {
    color: white;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Chatbot UI
   ========================================================================== */
.chat-wrapper {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.chatbot-trigger {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
    transition: transform 0.3s ease;
}

.chatbot-trigger:hover {
    transform: scale(1.05);
}

.chatbot-icon {
    font-size: 2rem;
    color: white;
}

.chatbot-window {
    position: absolute;
    bottom: 5rem;
    right: 0;
    width: 380px;
    height: 550px;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.chatbot-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.chat-header {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bot-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.header-info h4 {
    font-size: 1rem;
    margin: 0;
}

.header-info span {
    font-size: 0.8rem;
    color: var(--accent-primary);
}

.close-chat {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

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

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

.message {
    max-width: 85%;
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bot-message {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-bottom-left-radius: 0.2rem;
}

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

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 2rem;
    color: white;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--accent-primary);
}

.chat-input-area button {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Email Form specific UI inside Chat */
.chat-email-form {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(20, 20, 25, 0.9);
}

.chat-email-form input,
.chat-email-form textarea {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    color: white;
    font-family: inherit;
    outline: none;
}

.chat-email-form textarea {
    resize: none;
    height: 80px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel,
.btn-send {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-cancel {
    background: var(--glass-bg);
    color: var(--text-muted);
}

.btn-send {
    background: var(--accent-primary);
    color: white;
}


/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .name {
        font-size: 2.5rem;
    }

    .chatbot-window {
        width: calc(100vw - 2rem);
        right: -1rem;
        bottom: 5rem;
    }
}
