/*MY CSS PROD BY JAYTEE XABA*/

/* HOME PAGE*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    background: black fixed;
}

body {
    width: 100%;
    min-height: 100vh; /* Use min-height to ensure footer is at least at the bottom */
    overflow-x: hidden;
    background-color: black;
    color: white;
    display: flex; /* Added for footer positioning */
    flex-direction: column; /* Added for footer positioning */
}

header {
    margin-top: 20px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 9%;
    background-color: black;
    filter: drop-shadow(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.name {
    font-size: 3rem;
    color: #b74b4b;
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

.name:hover {
    transform: scale(1.1);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    font-size: 1.8rem;
    color: white;
    margin-left: 4rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active {
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

section {
    min-height: 100vh;
    padding: 5rem 9% 5rem;
}

.home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: black;
    flex-grow: 1; /* Added for footer positioning */
}

.home .home-content h1 {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

span {
    color: #b74b4b;
}

.home-content h3 {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p {
    font-size: 1.6rem;
}

.home-img img {
    position: relative;
    width: 36vw;
    box-shadow: 0 0 25px solid #b74b4b;
    cursor: pointer;
    transition: 0.2s linear;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid #b74b4b;
    font-size: 2rem;
    border-radius: 50%;
    margin: 1.5rem 1.5rem 1.5rem 0;
    transition: 0.3s ease;
    color: #b74b4b;
}

.social-icons a:hover {
    color: black;
    transform: scale(1.3) translateY(-5px);
    background-color: #b74b4b;
    box-shadow: 0 0 25px #b74b4b;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 2.5rem; 
    font-weight: 300;
    color: #b74b4b;
}

.menu-toggle {
    display: none;
}

.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: black;
    border-radius: 4rem;
    font-size: 1.6rem;
    color: #b74b4b;
    letter-spacing: 0.3rem;
    font-weight: 600;
    border: 2px solid #b74b4b;
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.03);
    background-color: #b74b4b;
    color: black;
    box-shadow: 0 0 25px #b74b4b;
}

.typing-text {
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
}

.typing-text span {
    position: relative;
}

.typing-text span::before {
    content: "software Developer";
    color: #b74b4b;
    animation: words 20s infinite;
}

.typing-text span::after {
    content: "";
    background-color: black;
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid black;
    right: -8;
    animation: cursor 0.6s infinite;
}

@keyframes cursor {
    to {
        border-left: 3px solid #b74b4b;
    }
}

/* === UPDATED KEYFRAMES === */
@keyframes words {
    0%, 15% {
        content: "Software Developer";
    }
    16%, 30% {
        content: "Web Developer";
    }
    31%, 45% {
        content: "UI/UX Designer";
    }
    46%, 60% {
        content: "AI Explorer";
    }
    61%, 75% {
        content: "Graphic Designer";
    }
    76%, 100% {
        content: "Creative Technologist";
    }
}

footer {
        background-color: black;
        text-align: center;
        padding: 20px 0;
        margin-top: auto; /* Pushes footer to the bottom */
        width: 100%;
        }

footer p {
        color: white;
        margin: 0;
        font-size: 1.3rem;
        }

/* ======================================================= */
/* AI ASSISTANT STYLES */
/* ======================================================= */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #b74b4b;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(183, 75, 75, 0.4);
    z-index: 999;
    transition: transform 0.3s ease;
}
.chat-bubble:hover {
    transform: scale(1.1);
}
.chat-bubble i {
    font-size: 2.4rem;
    color: black;
}
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 90%;
    max-width: 400px;
    height: 500px;
    background: #111;
    border: 1px solid #b74b4b;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}
.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    padding: 10px 20px;
    color: #b74b4b;
    font-weight: 600;
    font-size: 1.8rem;
    border-bottom: 1px solid #b74b4b;
}
.chat-header-title {
    flex-grow: 1;
    text-align: center;
    padding-left: 20px;
}
.chat-close-button {
    background: none;
    border: none;
    color: #888;
    font-size: 2.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.chat-close-button:hover {
    color: #fff;
}
.chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 1.4rem;
    word-wrap: break-word;
}
.chat-message.user {
    background-color: #b74b4b;
    color: black;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-message.bot {
    background-color: #333;
    color: #eaeaea;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-message.bot.loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #888;
    animation: pulse 1.5s infinite ease-in-out;
}
.chat-message.bot.loading span:nth-child(1) { animation-delay: 0.1s; }
.chat-message.bot.loading span:nth-child(2) { animation-delay: 0.2s; }
.chat-message.bot.loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.chat-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #333;
}
.chat-footer input {
    flex-grow: 1;
    border: none;
    background: #222;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-size: 1.4rem;
}
.chat-footer input:focus {
    outline: 1px solid #b74b4b;
}
.chat-footer button {
    background: none;
    border: none;
    color: #b74b4b;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 15px;
}

/* ======================================================= */
/* RESPONSIVE STYLES */
/* ======================================================= */
@media (max-width: 1000px) {
    .home {
        gap: 4rem;
    }
}

@media (max-width: 995px) {
    nav {
        display: none;
        position: absolute;
        top: 100%; /* Position below header */
        left: 0;
        background-color: black;
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
    }

    .hamburger {
        display: block;
    }

    #menu-toggle:checked ~ nav {
        display: flex; 
    }

    nav a {
        margin: 10px 0;
    }
    
    .home {
        flex-direction: column;
        margin: 0; /* Remove margin */
        padding: 15rem 4rem 5rem 4rem; /* Adjust padding */
        text-align: center;
    }

    .home .home-content h3 {
        font-size: 2.5rem;
    }

    .home-content h1 {
        font-size: 5rem;
    }

    .home-img img {
        width: 70vw;
        margin-top: 4rem;
    }
    
    .social-icons {
        justify-content: center;
    }

    /* === RESPONSIVE FIX FOR TYPING TEXT === */
    .typing-text {
        min-width: 0; /* Allows the element to shrink */
        font-size: 28px; /* Optional: adjust font size for smaller screens */
    }
}
