/* style.css */
:root {
    --bg-dark: #121212;
    --bg-alt: #1e1e1e;
    --text: #e0e0e0;
    --accent: #61dafb;
    --agent-chat-box: #ffffff58;
    --user-chat-box: #00a0cc;
    --border: #2a2a2a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Fira Code', monospace;
    background: var(--bg-dark);
    color: var(--text);
    scroll-behavior: smooth;
}

.link{
    text-decoration: none;
    color: var(--accent);
}

.link:hover{
    text-decoration: none;
    color: #0099c4;
}

.description{
    padding-top: 1em;
    font-style: italic;
    text-align: center;
}

blockquote {
    font-style: italic;
    color: var(--text);
    border-left: 4px solid #ddd;
    padding-left: 1em;
}

code {
    background: #4c4c4c;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-family: Menlo, Consolas, monospace;
}

/* Navbar */
#mainNav {
    background: var(--bg-alt) !important;
}

#mainNav .navbar-brand {
    color: var(--accent) !important;
    font-weight: 800;
}

#mainNav .nav-link {
    color: var(--text) !important;
    font-weight: 600;
    text-transform: uppercase;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    color: var(--accent) !important;
}

#mainNav .navbar-toggler-icon {
    filter: invert(1);
}

/* Hero */
.masthead {
    height: 100vh;
    min-height: 500px;
    background: url('https://via.placeholder.com/1600x900') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.masthead::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.masthead .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.masthead h1 {
    color: var(--accent);
    font-size: 3rem;
}

.masthead p {
    margin-bottom: 2rem;
}

.masthead .btn-primary {
    background: var(--accent);
    border: none;
    text-transform: uppercase;
}

/* About */
#about .about-img {
    cursor: pointer;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1);
    transition: all 200ms ease-in-out;
}

#about .about-img:hover {
    transform: scale(1.2);
    transition: all 200ms ease-in-out;
}

#about .about-box{
    padding: 2em;
    display: flex;
    justify-content: center;
}

#about .about-card {
    display: flex;
    justify-content: center;
    background: white;
    border-radius: 50%;
    width: 15em;
    height: 15em;
    border: 2px solid  var(--accent);
    overflow: hidden;
} 


#about .section-heading {
    margin-bottom: 2rem;
}

#about p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

/* Sections */
.page-section {
    padding: 5rem 0;
    border-top: 1px solid var(--border);
}

.page-section:nth-of-type(even) {
    background: var(--bg-alt);
}

.section-heading {
    color: var(--accent);
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-heading::before {
    content: "<";
}

.section-heading::after {
    content: ">";
}

/* Education timeline */
.timeline {
    list-style: none;
    padding: 0;
    width: auto;
    display: flex;
    flex-direction: column;
}

.timeline li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.timeline li::before {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
}

.timeline .education-text{
    color: #888;
}

/* Skills bars */
.skill-label {
    margin-bottom: 0.3rem;
}

.skill-bar {
    background: var(--border);
    border-radius: .5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.skill-bar .progress {
    height: 1rem;
    background: var(--accent);
}

/* Cards (Experience & Projects) */
.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
}

.card .project-cover-img{
    overflow: hidden;
    height: 50%;
}

.card .img-link{
    display: block;
    overflow: hidden;
}

.card .card-img-top{
    transform: scale(1);
    opacity: 1;
    transition: all 200ms ease-in-out;
    
}

.card .card-img-top:hover{
    transform: scale(1.2);
    opacity: 0.5;
    transition: all 200ms ease-in-out;
    
}

.card-body {
    color: var(--text);
}

.card-title {
    color: var(--accent);
}

.card-subtitle {
    color: #888;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* Contact Form Dark-mode */
#contact-form .form-control {
  color: black;
  border: 1px solid var(--border);
}
#contact-form .form-control:focus {
  color: black;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(97,218,251,0.25);
}
#contact-form .form-label {
  color: var(--text);
}
#contact-form .btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
}
#contact-form .btn-primary:hover {
  background-color: #4fb0d9;
  border-color: #4fb0d9;
}


/* chat widget */
#chat-block{
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#chat-block-text{
  bottom: 4.5em;
  right: 4em;
  width: 17em;
  height: 4em;
  color: black;
  background-color: white;
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  border-radius: 8px;
  animation-name: showChatNotice;
  animation-timing-function: ease-out;
  animation-duration: 0.5s;
}

#chat-block-text > p {
    margin: 0;
}

@keyframes showChatNotice{
    0%{right: 2em;bottom:4em;opacity: 0%;scale: 0.5;}
    50%{scale: 1.2;}
    100%{right: 4em;bottom:4.5em;opacity: 100%;scale: 1;}
}

@keyframes hideChatNotice{
    0%{right: 4em;bottom:4.5em;opacity: 100%;scale: 1;}
    100%{right: 2em;bottom:4em;opacity: 0%;scale: 0.9;}
}


#open-chat {
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  color: var(--bg-dark);
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
}

#open-chat > img{
    height: 32px;
    width: 32px;
}

#chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 20em;
  max-height: 30em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  overflow: hidden;
  z-index: 1000;
  transition: transform 400ms ease-in-out, opacity 400ms ease-in-out;
}

#chat-widget.collapsed {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

#chat-header {
  background: var(--bg-dark);
  color: var(--accent);
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chat-header button {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

#chat-body {
  flex: 1;
  padding: 8px;
  min-height: 20em;
  overflow-y: auto;
  color: white;
}

#chat-body::-webkit-scrollbar{
    display: none;
}

.message{
    max-width: 80%;
    width: fit-content;
    height: auto;
    font-size: 14px;
    padding: 10px;
    margin-bottom: 1em;
    border-radius: 0.5em;
    /* allow long words/URLs to break */
    overflow-wrap: break-word;  /* modern */
    word-wrap: break-word;      /* legacy */
    word-break: break-word;     /* aggressive break */
    white-space: normal;        /* allow wrapping */
}

.message-content{
    padding: 0;
    margin: 0;
}

.agent{
    background-color: var(--agent-chat-box);
    margin-right: auto;
}

.user{
    background-color: var(--user-chat-box);
    margin-left: auto;
}

.message-content.loading::after {
  content: ' ⏳';
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.5; }
}

#chat-input-area {
  display: flex;
  border-top: 1px solid var(--border);
}

#chat-input {
font-family: inherit;
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem;
  border: none;
  box-sizing: border-box;
  max-height: 150px; /* Optional: limit height */
  line-height: 1.4;
}


#chat-input-area button {
  border: none;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 0 16px;
  cursor: pointer;
}


/* Footer */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

/* Loading */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #ddd;
  border-top: 5px solid #3bc9db; /* Light blue or accent color */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Expanding image */
#img-me{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.avatar{
    height: auto;
    width: auto;
    max-height: 80%;
    max-width: 90%;
}

/* Responsive tweaks */
@media (max-width: 992px) {
    .masthead h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .masthead h1 {
        font-size: 2rem;
    }

    .masthead p {
        font-size: 1rem;
    }

    .page-section {
        padding: 3rem 1rem;
    }
}

