*{
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
html {
    /* strictly to control page redirects using navbar, allows for smooth transitions and padding on top */
    scroll-padding-top: 60px; /* Adjust based on navbar height */
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body{
    /* background: #080808; */
    /* background: #030303; */
    background: #212121;
    color: #fff;
    margin-bottom: 10%;
    width: 100%;
    overflow-x: hidden; /* CRITICAL: Prevents any content from breaking the viewport width */
}
p{
    color: #a1a1a1;
    letter-spacing: 1px;
    font-family: sans-serif;
}

.sub-title{
    font-size: 2.5rem;
}
.container{
    padding: 10px 5%;
}
label.logo{
    color: white;
    /* padding: 10px 5%; */
    font-size: 35px;
    /* line-height: 80px; */
    font-weight: bold;
    /* margin-top: 0; */
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
}
nav{
    background-color: #080808d0;
    /* background-color: #080808be; */
    /* background-color: #08080882; */
    /* background-color: rgba(8,8,8,0.5); */
    padding: 10px 5%;
    min-width: 0;
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    display: flex;
    position:fixed;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    box-sizing: border-box;
    top: 0;
    z-index: 1000;
}
nav ul{
    flex-shrink: 1;
    min-width: 0;
}
nav ul li{
    display: inline-block;
    list-style: none;
    margin: 10px 20px;
}
nav ul li a{
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.5s, text-decoration 0.5s;
}
nav ul li a:hover{
    color: #0b273d;
    text-decoration: underline;
    font-size: 18px;
    cursor: pointer;
    
}
/* -----------header----------- */
.header{
    width: 90%;
    margin: 0 auto;
    height: 900px;
    background-size: cover;
    background-position: top right;
    border-radius: 10%;
    margin-bottom: 10%; 
    margin-top: 72px;
}
.header-text{
    /* margin-top: 25%; */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* position: absolute; */
    position: relative;
    width: 100%;
    height: 100%;
    font-size: 30px;
    margin: auto auto;
}
.name{
    /* margin-top: 22%; */
    text-transform: uppercase;
    letter-spacing: 2px;

}
.header-title{
    color: white;
    font-size: 30px;
    margin-top: 40px;
    letter-spacing: 1px;
}
.header-button {
    margin-top: 2%;
    font-size: 1.2rem;
    /* background-color: #0063cd; */
    background-color: #002f62;
    /* background-color: #ff004f; */
    color: #fff; /* Add text color */
    text-align: center;
    text-decoration: none;
    display: flow;
    padding: 20px 70px;
    width: 244px; /* Adjust width to fit content */
    height: 67px;
    border: none; /* Remove border */
    border-radius: 13px;
    cursor: pointer; /* Add pointer cursor */
    box-sizing: border-box;
    transition: background-color 0.5s; /* Add transition effect */
    margin-left: auto;
    margin-right: auto;
}
.header-button:hover{
    background-color: #001e3e;
    /* background-color: #90002e; */

}
.header-buttons{
    margin-top: 4rem;
}
/* ------------about----------- */
/* #about{ */
    /* padding: 80px 10%; */
    /* display: flex; */
/* } */
.row{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.about-col-1{
    /* picture will get 35 percent of width */
    flex-basis: 35%;
}
.about-col-1 img{
    width: 100%;
    border-radius: 15px;
}
.about-col-2{
    /* about me column will get 60 percent, thus leaving 5 percent for the
    space in between the two columns */
    flex-basis: 60%;
    border-radius: 15px;
}
.about-title{
    font-size: 60px;
    font-weight: 600;
    color: white;
}
.tab-titles{
    display: flex;
    margin: 20px 0 40px;
}
.tab-links{
    color: rgb(229, 229, 229);
    margin-right: 50px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}
.tab-links::after{
    content: '';
    width: 0;
    height: 3px;
    /* background: #ff004f; */
    background: #287dda;
    position: absolute;
    left: 0;
    bottom: -8px;
    transition: 0.5s;
}
.tab-links.active-link::after{
    width: 80%;
}
.tab-contents ul li{
    list-style: none;
    margin: 10px 0;
}
.tab-contents ul li span{
    /* color: #b54769; */
    color: #4385cc;
    font-size: 15px;
    font-weight: 600;
}
.tab-contents{
    display: none;
}
.tab-contents.active-tab{
    display: block;
}
.about-button {
    margin-top: 2%;
    font-size: 1rem;
    /* background-color: #ff004f; */
    background-color: #002f62;
    color: #fff; /* Add text color */
    text-align: center;
    text-decoration: none;
    display: flow;
    padding: 20px 70px;
    width: 225px; /* Adjust width to fit content */
    border: none; /* Remove border */
    border-radius: 13px;
    cursor: pointer; /* Add pointer cursor */
    box-sizing: border-box;
    transition: background-color 0.5s; /* Add transition effect */
    margin-left: auto;
    margin-right: auto;
}
.about-button:hover{
    /* background-color: #90002e; */
    background-color: #001f41;
}
/* ----------projects---------- */
#projects{
    /* padding: 50px 10%; */
    font-size: 1.5rem;
    /* display: flex; */
}
.see-more-button{
    font-size: 1rem;
    /* background-color: #ff004f; */
    color: #fff;
    text-align: center;
    text-decoration: none;
    padding: 20px 50px;
    width: fit-content;
    height: 60px;
    display: flex;
    border-width: 2px;
    border-style: solid;
    /* border-color: #90002e; */
    /* border-color: #002f62; */
    border-color: #4385cc;
    border-radius: 13px;
    cursor: pointer;
    margin: auto 0;
    margin-left:20px;
    box-sizing: border-box;
    transition: background-color 0.5s;
    align-items: center;
}
.see-more-button:hover{
    /* background-color: #90002e; */
    /* background-color: #002f62; */
    background-color: #4385cc;
}
.see-more-button i{
    margin-left: 5px;
}
.header-link{
    display: flex;
    flex-direction: column;
}
.sub-link {
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    line-height: normal;
}
.work-list{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 40px;
    margin-top: 50px;
}
.work{
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    height: 0;
    padding-bottom: 130%;
}
.work img{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 10px;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.work:hover img {
    transform: scale(1.1);
    cursor: pointer;
}
.work:hover .layer{
    height: 100%;
}
.layer{
    width: 100%;
    height: 0%;
    background: linear-gradient(rgba(0, 0, 0, 0.853), #373737);
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 5px 40px;
    text-align: center;
    transition: height 0.5s ease;
}
.layer h3{
    font-size: 1.6rem;
    font-weight: 500;
    margin-top: 5%;
    margin-bottom: 5%;
}
.layer p{
    /* font-weight:normal; */
    font-size: 1.2rem;
    /* margin-top: 2%; */
    margin-bottom: 5%;
}
.layer a{
    margin-top:20px;
    /* color: #ff004f; */
    color: #002f62;
    text-decoration: none;
    background: white;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 60px;
    height: 60px;
    width: 60px;
    text-align: center;
}
.project-btn {
    color: white;

}
.project-btn i{
    margin-top:20px;
    /* color: #ff004f; */
    color: #002f62;
    text-decoration: none;
    background: white;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 60px;
    height: 60px;
    width: 60px;
    text-align: center;
}

/* -----------contact--------- */
.contact-left{
    flex-basis: 40%;
}

.contact-left p {
    margin-bottom: 1rem;
}

.contact-right form{
    width: 100%;
}
form input, form textarea{
    width: 100%;
    border: 0;
    border-radius: 7px;;
    outline: none;
    background: #262626;
    padding: 15px;
    margin: 15px 0;
    color: #fff;
    resize: none;
    border-style: solid;
    border-width: 2px;
    border-color: #424242;
}
.contact-right{
    flex-basis: 55%;
}
.contact-button {
    margin-top: 2%;
    font-size: 1rem;
    /* background-color: #ff004f; */
    background-color: #002f62;
    color: #fff; /* Add text color */
    text-align: center;
    text-decoration: none;
    display: flow;
    padding: 15px;
    width: 170px; /* Adjust width to fit content */
    border: none; /* Remove border */
    border-radius: 13px;
    cursor: pointer; /* Add pointer cursor */
    box-sizing: border-box;
    transition: background-color 0.5s; /* Add transition effect */
    /* margin-left: auto; */
    margin-right: auto;
}
.contact-button:hover{
    /* background-color: #90002e; */
    background-color: #001e3f;
}
.icon-row {
    margin-top: 15%;
    margin-bottom: 10%;
}
.icon {
    margin-right: 2rem;
    color: #fff;
    width: 3rem;
    height: auto;
}

/* -----------------smaller screens --------------- */
nav .fas{
    display: none;
}
@media only screen and (max-width: 930px){
    .about-col-1{
        margin: 5px auto;
    }
    .about-col-1 img{
        display: block; /* Fixed display mode for styling structure */
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    #about .row{
        display: block;
    }
    #about .about-button{
        margin-top: -3%;
    }
    #contact .about-button{
        margin-bottom: 5%;
    }
    #connect .about-button{
        margin-top: 2%;
    }
}
@media only screen and (max-width: 600px){
    nav .fas{
        display: block;
        font-size: 25px;
    }
    nav ul{
        background: #373737;
        position: fixed;
        top: 0;
        right: -200px; /* Hidden using fixed pixels instead of a % that might break scale */
        width: 200px;  /* Fixed static width safely keeps it from expanding layout width */
        height: 100vh; /* Keeps drawer scaled safely to standard device screen height */
        padding-top: 60px;
        transition: .4s ease;
        z-index: 1001; /* Layer safely over fixed main header elements */
        box-sizing: border-box;
    }
    nav ul li{
        display: block;
        margin: 25px 20px; /* Safe pixel spacing stops percentage-overflow compounding bugs */
    }
    nav ul .fas{
        position: absolute;
        top: 25px;
        right: 25px;
        cursor: pointer;
    }
    /* Removed non-functional nav ul .fas:checked logic safely */
    
    nav ul.active {
        right: 0; /* Activates menu panel drawer layout */
    }
    .header {
        width: 100%;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    .name{
        font-size: 2.2rem; /* Scaled text down slightly to fit narrower smartphone displays */
    }
    .container {
        width: 100%;
        margin-top: 2%;
    }
    body {
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        padding-bottom: 10%;
    }
    #about .about-button{
        margin-top: -3%;
    }
    .about-col-1{
        width: 100%;
        margin: 5px auto;
    }
    .about-col-1 img{
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .tab-links{
        margin-right: 14px;
        font-size: 18px;
    }
    .row{
        display: block;
    }
    .work img{
        width: 100%;
        margin: 0px auto;
    }
    #projects .see-more-button{
        padding: 0;
        width: 141px;
        height: 50px;
        justify-content: center;
    }
    .icon-row{
        margin-bottom: -17%;
    }
    #contact .container{
        display: block;
    }
    #contact .about-button{
        margin-bottom: 5%;
        margin-right: 0;
    }
    #connect .about-button{
        margin-top: 3%;
    }
    #chat-window{
        width: calc(100vm - 40px);
        right: 0;
    }
}

.main-content-wrapper{
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --- AI Chat Widget Styling --- */
#ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: sans-serif;
}

#chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4385cc; 
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

#chat-trigger:hover {
    transform: scale(1.05);
}

#chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 360px;
    height: 460px;
    background: #1f1f1f; 
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.chat-header {
    background: #111;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

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

.chat-header i {
    cursor: pointer;
    color: #ababab;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #1a1a1a;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #fff;
    word-wrap: break-word;
}

.bot-message {
    background: #2d2d2d;
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.user-message {
    background: #4385cc;
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.chat-footer {
    padding: 10px;
    background: #111;
    display: flex;
    gap: 8px;
    border-top: 1px solid #333;
}

#chat-input {
    flex: 1;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 20px;
    padding: 8px 15px;
    color: #fff;
    outline: none;
}

.chat-footer button {
    background: transparent;
    border: none;
    color: #4385cc;
    cursor: pointer;
    padding: 0 5px;
}