/* Base & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-color: #050505;
    --text-main: #f5f5f5;
    --text-muted: #a3a3a3;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-accent: #a855f7;
    --tag-bg: rgba(168, 85, 247, 0.14);
}

body.dark-mode {
    --bg-color: #050505;
    --text-main: #f5f5f5;
    --text-muted: #a3a3a3;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-accent: #a855f7;
    --tag-bg: rgba(168, 85, 247, 0.14);
}

/* =========================================
   Aurora Scroll Progress Bar
   ========================================= */

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    /* Starts at 0% when page loads */
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #10b981, #8b5cf6);
    background-size: 200% auto;
    z-index: 10000;
    /* Ensures it stays on top of the terminal and chatbot */
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    animation: gradient-shift 3s linear infinite;
    /* Makes the colors flow */
    transition: width 0.1s ease-out;
    /* Makes the scrolling smooth */
}

/* Animates the gradient colors to slide sideways */
@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling safely on all devices */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.6;
}

.top-nav {
    position: fixed;
    top: 24px;
    right: 90px;
    display: flex;
    gap: 20px;
    z-index: 120;
}

.top-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.top-nav a:hover {
    opacity: 1;
    color: var(--primary-accent);
}

.site-nav a{
    font-family: 'Space Grotesk', sans-serif;

}

.hero-actions a{
    font-family: 'Space Grotesk', sans-serif;
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    z-index: 120;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--primary-accent);
}

.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 140px 24px 120px;
}

.hero-copy {
    max-width: 760px;
    width: 100%;
    text-align: left;
}

.hero-intro {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
}

.profile-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.greeting {
    color: var(--primary-accent);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 14px;
}

.gradient-text {
    font-size: clamp(3rem, 6vw, 5.4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #fdfdfd;
    margin-bottom: 10px;
    line-height: 1.02;
}

.role-text {
    font-size: clamp(1.15rem, 1.85vw, 1.45rem);
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hero-lead {
    font-size: 1.02rem;
    color: #d8d8d8;
    max-width: 620px;
    margin-bottom: 22px;
    line-height: 1.7;
}

.hero-meta {
    max-width: 620px;
    margin-bottom: 28px;
}

.availability-status {
    display: inline-block;
    color: #d4d4d4;
    font-size: 0.9rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.bio {
    max-width: 640px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.typing-text {
    color: var(--primary-accent);
}

.cursor {
    animation: blink 1s infinite;
    color: var(--primary-accent);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.bio {
    max-width: 600px;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* =========================================
   Pulse Availability Indicator
   ========================================= */
.tags-container {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 12px;
    margin: 20px 0;
}

/* Updated Badge Style (Sleek pill) */
.badge {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px; /* Fully rounded pills */
    font-size: 0.85rem;
    font-weight: 500;
    color: #e4e4e7;
    text-transform: uppercase; /* Makes short text look intentional */
    letter-spacing: 0.025em;
}

/* Professional Internship Callout */
.internship-callout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #22c55e;
    border-radius: 4px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.internship-text {
    font-size: 0.9rem;
    color: #a1a1aa;
}

.date-highlight {
    color: #ffffff;
    font-weight: 600;
}

/* Subtle hover effect to add interactivity */
.badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-animation 2s infinite;
}


@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.pulse-dot::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: 50%;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Buttons */
.contact-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* =========================================
   Live GitHub Activity Card
   ========================================= */

.github-activity-card {
    margin-top: 50px;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 20px 25px;
    width: 100%;
    max-width: 600px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.commit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.commit-item {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
}

.commit-top-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.commit-repo {
    color: var(--text-main);
    font-weight: 600;
}

.commit-date {
    font-size: 0.8rem;
    background: var(--tag-bg);
    color: var(--primary-accent);
    padding: 2px 8px;
    border-radius: 10px;
    align-self: flex-start;
    margin-top: 4px;
}

.commit-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    opacity: 0.8;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
    align-items: center;
}

.social-link-btn,
.primary-btn,
.secondary-btn {
    min-width: 136px;
    justify-content: center;
}

.contact-links .btn:hover {
    color: var(--primary-accent);
    border-color: var(--primary-accent);
    transform: translateY(-2px);
}

.btn {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: none;
}

.primary-btn {
    color: var(--text-main);
}

.primary-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: translateY(-2px);
}

.secondary-btn,
.outline-btn {
    background: transparent;
    color: var(--text-main);
}

.secondary-btn:hover,
.outline-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: translateY(-2px);
}

.icon-btn {
    padding: 10px 14px;
    font-size: 1rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.icon-btn:hover {
    color: var(--primary-accent);
    transform: translateY(-2px);
}

/* Projects Section */
.portfolio {
    max-width: 1120px;
    margin: 0 auto;
    padding: 110px 24px 140px;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 48px;
    position: relative;
    text-align: left;
    display: block;
    width: 100%;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 56px;
    height: 2px;
    background: var(--primary-accent);
    border-radius: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.status-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.status-bar-container {
    width: 100%;
    height: 8px;
    background-color: #3b3939;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    background-color: #e510f0;
    /* Adjust color as needed */
    width: 40%;
    /* Change this percentage to reflect progress */
    transition: width 0.5s ease-in-out;
}

.status-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fb71f4;
    min-width: 35px;
    /* Ensures text doesn't jitter as numbers change */
}

.app-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    transition: transform 0.25s ease, border-color 0.25s ease;
    box-shadow: none;
}

.app-card:hover {
    transform: translateY(-3px);
    border-color: rgba(168, 85, 247, 0.28);
}

.app-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.app-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Project Meta & Progress */
.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.project-status.released {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.project-status.unreleased {
    background: rgba(248, 113, 113, 0.15);
    color: #ef4444;
}

.project-progress-label {
    color: var(--text-muted);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tag-bg);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
    transition: width 0.3s ease;
}

/* Tech Stack Tags */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tech-tag {
    background: var(--tag-bg);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.card-buttons .btn {
    padding: 8px 14px;
    font-size: 0.9rem;
}

/* Skills Section */
.skills {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 24px 110px;
    text-align: left;
}

.skills .section-title {
    margin-bottom: 40px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.skill-category {
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.35);
}

.skill-category h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Timeline Section */
.timeline-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 24px 140px;
}

.timeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.column-title {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    margin-bottom: 24px;
    border-left: 1px solid var(--card-border);
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--primary-accent);
    border-radius: 50%;
}

.timeline-item h4 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.timeline-item h5 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 6px;
}

.timeline-date {
    display: inline-block;
    font-size: 0.8rem;
    background: var(--tag-bg);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    font-weight: 600;
}

.timeline-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 40px;
    max-width: 1120px;
    margin: 0 auto;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a {
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.footer-socials a:hover {
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

/* =========================================
   Jimmy-Bot Chatbot Styles
   ========================================= */

#chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

/* Floating Toggle Button */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

#chatbot-toggle:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Chat Window */
#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: #101817;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(94, 234, 212, 0.22);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

#chatbot-window.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.chat-header {
    background: #13201f;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(94, 234, 212, 0.18);
    flex-shrink: 0;
}

.chat-header h3 {
    font-size: 1.1rem;
    color: #5eead4;
}

.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-title h3 { margin: 0; }
.chat-title p { margin: 3px 0 0; color: #a7b9b5; font-size: 0.78rem; }
.chat-brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: #164e4a; color: #99f6e4; }

#close-chat {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
}

.message-row { display: flex; flex-direction: column; gap: 6px; }
.user-row { align-items: flex-end; }
.ai-row { align-items: flex-start; }
.assistant-identity { color: #5eead4; font-size: 0.78rem; font-weight: 700; }

/* Chat History Area */
#chat-history {
    flex: 1 1 0;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.ai-message {
    background: #20302e;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message {
    background: #0f9488;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Input Area */

.chat-quick-replies {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    /* Allows scrolling if you add more buttons */
    background: #101817;
    border-bottom: 1px solid rgba(94, 234, 212, 0.16);
    flex-shrink: 0;
}

.chat-suggestions { flex-shrink: 0; padding: 10px 16px 6px; background: #101817; }
.chat-suggestions > p { margin: 0 0 8px; color: #9eb0ad; font-size: 0.8rem; }
.chat-suggestions .chat-quick-replies { padding: 0; border: 0; }

/* Keep the suggestion row swipeable without showing a browser scrollbar. */
.chat-quick-replies {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chat-quick-replies::-webkit-scrollbar {
    display: none;
}

.chip {
    background: #1a2927;
    border: 1px solid rgba(94, 234, 212, 0.2);
    color: #e6fffb;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.chip:hover {
    background: #164e4a;
    border-color: #2dd4bf;
}

.chat-input-area {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(94, 234, 212, 0.18);
    background: #13201f;
    flex-shrink: 0;
}

#chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(94, 234, 212, 0.22);
    background: #0b1211;
    color: #f0fdfa;
    outline: none;
}

.ai-message:contains("Jimmy-Bot is typing...") {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.85rem;
}

#send-btn {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    display: grid;
    place-items: center;
}

#send-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    #chatbot-wrapper {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    #chatbot-toggle {
        margin-left: auto;
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
    }

    #chatbot-window {
        width: min(100%, 420px);
        height: min(72vh, 480px);
        right: 0;
        left: auto;
        bottom: 72px;
        border-radius: 18px;
    }

    #chat-history {
        padding: 16px;
    }

    .message {
        max-width: 90%;
        font-size: 0.88rem;
    }

    .chat-input-area {
        padding: 12px;
    }

    #chat-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

/* =========================================
   Smartphone Chat Optimization (max-width: 480px)
========================================= */
@media (max-width: 480px) {
    #chatbot-wrapper {
        bottom: 12px;
        right: 12px;
        left: 12px;
        /* Ensures wrapper doesn't block clicks when chat is closed */
        pointer-events: none; 
    }

    /* Re-enable pointer events for the actual interactive elements */
    #chatbot-toggle, 
    #chatbot-window {
        pointer-events: auto;
    }

    #chatbot-window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
        background: #101817;
        overscroll-behavior: contain;
        z-index: 1200;
    }

    body.chat-open {
        overflow: hidden;
    }

    body.chat-open #chatbot-toggle {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.85);
    }

    .chat-header {
        padding: max(16px, env(safe-area-inset-top)) 20px 16px;
    }

    .chat-input-area {
        padding: 12px 16px max(16px, env(safe-area-inset-bottom));
        background: #13201f;
        border-top: 1px solid rgba(94, 234, 212, 0.18);
    }

    .chat-header {
        padding: max(16px, env(safe-area-inset-top)) 16px 14px;
    }

    .chat-header h3 {
        font-size: 1rem;
    }

    .chat-brand-mark { width: 40px; height: 40px; }
    #close-chat { width: 44px; height: 44px; border: 1px solid rgba(94, 234, 212, 0.2); border-radius: 12px; }

    #chat-history {
        padding: 12px;
        gap: 12px;
    }

    .message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* 1. CRITICAL: Enforce 16px to prevent iOS Safari auto-zoom */
    #chat-input {
        font-size: 16px !important; 
        padding: 12px 14px;
    }

    /* 2. Expand Quick Replies for ergonomic thumb-tapping */
    .chat-quick-replies {
        padding: 10px;
        gap: 8px;
        /* Allow horizontal swiping if chips overflow */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-suggestions { padding: 12px 16px 8px; }

    .chip {
        /* Minimum 38-44px touch height */
        padding: 10px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* =========================================
   Terminal Easter Egg Styles
   ========================================= */

#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#terminal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.terminal-window {
    width: 80%;
    max-width: 700px;
    height: 500px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    /* Classic Terminal Font */
}

.terminal-header {
    background: #333;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: 0.9rem;
}

#close-terminal {
    background: #ff5f56;
    color: transparent;
    border: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    cursor: pointer;
}

#close-terminal:hover {
    color: white;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#terminal-output {
    flex-grow: 1;
    padding: 20px;
    color: #00ff00;
    /* Hacker Green */
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.terminal-input-line {
    display: flex;
    padding: 0 20px 20px 20px;
    color: #00ff00;
}

.prompt {
    margin-right: 10px;
    white-space: nowrap;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: inherit;
    font-size: 0.95rem;
    flex-grow: 1;
    outline: none;
}

.terminal-window .highlight {
    color: #0ea5e9;
    font-weight: bold;
}

/* =========================================
   Responsive Design (Mobile & Tablet)
========================================= */
@media screen and (max-width: 768px) {

    /* 1. Tighten up spacing to save screen real estate */
    .hero {
        min-height: auto;
        padding: 100px 15px 40px;
    }

    .portfolio,
    .skills,
    .timeline-section {
        padding: 40px 15px 60px;
    }

    /* 2. Scale down the profile photo slightly */
    .profile-img {
        width: 120px;
        height: 120px;
        margin-bottom: 15px;
    }

    /* 3. Adjust typography for smaller screens */
    .role-text {
        font-size: 1.2rem;
    }

    .bio {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* 4. Make contact buttons stack neatly for easy thumb-tapping */
    .contact-links {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
        justify-content: center;
        /* Centers the icon and text */
    }

    /* 5. Adjust the Timeline into a perfect single column */
    .timeline-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* 6. Reposition the Dark Mode toggle for easier reach */
    #theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    /* 7. Ensure project buttons span the full width of the card */
    .card-buttons {
        flex-direction: column;
        width: 100%;
    }

    .card-buttons .btn {
        width: 100%;
    }
}

/* Keep the mobile composer within the viewport when the input is focused. */
@media (max-width: 480px) {
    .chat-input-area {
        width: 100%;
        min-width: 0;
        gap: 12px;
    }

    #chat-input {
        width: 0;
        min-width: 0;
        flex: 1 1 auto;
    }

    #send-btn {
        flex: 0 0 52px;
        width: 52px;
        min-width: 52px;
        height: 52px;
        padding: 0;
    }
}

/* Jimmy-Bot: warm glass palette inspired by the portfolio reference. */
#chatbot-window {
    background: #f3efef;
    border-color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(113, 82, 91, 0.2);
}

.chat-header,
.chat-input-area,
.chat-suggestions,
.chat-quick-replies {
    background: #f8f5f3;
    border-color: rgba(102, 81, 91, 0.12);
}

.chat-header h3,
.assistant-identity {
    color: #6d3e50;
}

.chat-title p,
.chat-suggestions > p {
    color: #7e7379;
}

.chat-brand-mark {
    background: #f2b1a7;
    color: #6d3e50;
}

#close-chat {
    color: #4a3d43;
    border-color: rgba(109, 62, 80, 0.16);
}

.ai-message {
    background: rgba(255, 255, 255, 0.9);
    color: #373036;
    box-shadow: 0 8px 18px rgba(108, 85, 95, 0.08);
}

.user-message {
    background: #e88779;
    color: #fffdfc;
}

.chip {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(121, 95, 110, 0.16);
    color: #493b42;
}

.chip:hover {
    background: #f6d6cf;
    border-color: #e5a095;
}

#chat-input {
    background: #ffffff;
    border-color: rgba(121, 95, 110, 0.2);
    color: #373036;
}

#send-btn {
    background: #e88779;
    color: #ffffff;
    box-shadow: 0 7px 15px rgba(204, 111, 100, 0.24);
}

/* Dark backdrop with the same warm coral conversation accents. */
#chatbot-window {
    background: linear-gradient(160deg, #17161d 0%, #24202b 52%, #332537 100%);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 48px rgba(8, 7, 12, 0.42);
}

.chat-header,
.chat-input-area,
.chat-suggestions,
.chat-quick-replies {
    background: rgba(24, 22, 30, 0.88);
    border-color: rgba(255, 255, 255, 0.1);
}

.chat-header h3,
.assistant-identity {
    color: #f3b4aa;
}

.chat-title p,
.chat-suggestions > p {
    color: #c2bac0;
}

#close-chat {
    color: #f8f1ef;
    border-color: rgba(255, 255, 255, 0.14);
}

.ai-message {
    background: rgba(255, 255, 255, 0.96);
    color: #322b31;
}

.chip {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f6eeec;
}

.chip:hover {
    background: rgba(232, 135, 121, 0.26);
    border-color: #e88779;
}

#chat-input {
    background: rgba(10, 9, 13, 0.64);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fffaf8;
}

#chatbot-toggle {
    background: linear-gradient(145deg, #e88779, #c95e73);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 25px rgba(109, 47, 69, 0.38);
    position: relative;
}

#chatbot-toggle::after {
    content: "AI";
    position: absolute;
    right: -6px;
    bottom: -4px;
    min-width: 20px;
    padding: 2px 4px;
    border: 2px solid #17161d;
    border-radius: 8px;
    background: #f7d6cf;
    color: #6d3e50;
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1;
}

/* =========================================
   Smartphone Optimization (max-width: 480px)
========================================= */
@media screen and (max-width: 480px) {

    /* 1. Prevent horizontal scrolling and handle iPhone notches/safe areas */
    body {
        overflow-x: hidden;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* 2. Ultra-compact hero section for small screens */
    .hero {
        padding: 80px 12px 30px;
    }

    .portfolio,
    .skills,
    .timeline-section {
        padding: 30px 12px 45px;
    }

    /* 3. Scale profile photo and typography for narrower viewports */
    .profile-img {
        width: 100px;
        height: 100px;
    }

    .role-text {
        font-size: 1.1rem;
    }

    .bio {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 25px;
    }

    /* 4. Enforce iOS/Android Accessibility Touch Targets (min 48x48px) */
    .btn, 
    .card-buttons .btn,
    button, 
    a.button {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 5. Thumb-Friendly Theme Toggle (Moved slightly lower for easier thumb reach) */
    #theme-toggle {
        top: 12px;
        right: 12px;
        width: 48px;
        height: 48px;
    }

    /* 6. Prevent iOS Auto-Zoom on Form Inputs */
    input, 
    select, 
    textarea {
        font-size: 16px !important; /* iOS zooms in if font is under 16px */
    }

    /* 7. Timeline compacting */
    .timeline-container {
        gap: 20px;
    }
}

/* =========================================
   Ambient Glow Background Effect
   ========================================= */

body::before {
    content: '';
    position: fixed;
    width: 38vw;
    height: 38vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(140px);
    opacity: 0.32;
    pointer-events: none;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.82) 0%, rgba(168, 85, 247, 0) 72%);
    top: -10%;
    right: -8%;
}

body::after {
    content: '';
    position: fixed;
    width: 24vw;
    height: 24vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(110px);
    opacity: 0.16;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -8%;
    left: -6%;
}
