/* Apply dark theme */
body {
    margin: 0;
    padding: 0;    
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: "system ui", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    font-size: .95em;                     /* ✅ adjust as needed */
    line-height: 1.8;                    /* ✅ comfortable reading */
	
}
#main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Code block wrapper */


.code-wrapper {
    position: relative;
    /*background: #000000; /*dark theme */
    background-color: #0d1117;
    border-radius: 20px;
    margin1: 1em 0;
    overflow: hidden;
    font-size: 14px;
    border: 1px solid #333;
}

/* Top bar inside the code box */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;    
    background-color: #0d1117 !important;	
    color: #fff;
    font-size: 0.85em;
    padding: 10px 15px 0 15px;
    font-family: monospace;    
}

/* Label */
.language-label {
    font-weight: bold;
    color: #ddd;
}

/* Copy button */
.copy-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 3px;
}

.copy-btn:hover {
    color: #fff;
    background-color: #444;
}



/* Code block styling */
pre, code {
    font-family: monospace;    
    background-color: #0d1117 !important;	
    color: #ffffff; /*0f0;*/
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}
/* Center chat container */
#chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 700px;
    width: 100%;	
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 6rem; /* ⬅️ add this line */
    gap: 1rem;
    overflow-y: auto;
    scroll-behavior: smooth;  /* <-- smooth scroll effect */
    /*overflow-y: scroll; */              /* enable scrolling */
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE and Edge */    

}

#chat-container::-webkit-scrollbar {
		display: none;                   /* Chrome, Safari, Edge (WebKit) */
	}
}
.message {
  display: flex;
  width: 100%;
  /*padding-bottom:16px;*/
}
.user-msg {
  justify-content: flex-end;
}
.ai-msg {
  justify-content: flex-start;
  /*padding-bottom:16px;*/
}

.user {
  background-color: #2e2e2e;
  /*background-color: transparent;*/
  color: #eee; /*#41A3CE;  */
  padding: 0.6rem 1rem;
  border-radius: 15px;
  display: inline-block;
  max-width: 70%;
  word-wrap: break-word;
  text-align: left;
  /*border-bottom:1px solid #888;*/
  /* Align to the right */
  /*align-self: flex-end!important;*/
  margin-left: auto!important;   
  margin-right: 0px!important;
}

.ai {
  background-color: transparent;
  color: white;
  padding_: 0.6rem 1rem;
  border-radius: 12px;
  display: inline-block;
  max-width: 85%;
  word-wrap: break-word;
  text-align: left;
}

#input-form {
    position: sticky;
    bottom: 0;
    width: 100%;
    background-color: #1e1e1e;
    padding: 1.2rem 1rem 1.8rem;
    border-radius: 10px 10px 0 0;
    display: block; /* ✅ change from flex */
    text-align: center; /* Optional: helps with disclaimer */
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 10px auto;
    box-sizing: border-box;
}
#user-input {
    width: 100%;	
    background-color: #2e2e2e;    
    color: #eee;                /* light text */
    border: 1px solid #444;     /* darker border */
    /*padding: 15px 50px 15px 12px; /* keep the padding fix for button */
    padding: 10px 50px 10px 12px; /* keep the padding fix for button */
    font-family: "Segoe UI", sans-serif;
    font-size: 16px;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
}
#user-input::placeholder {
    color: #777;  /* lighter placeholder text */
}
#send-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #0078d4;
    color: white;
    font-size: 18px;
    padding: 6px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #005fa3;
}

#send-btn:disabled {
    background: #ccc;
    cursor: default;
}


button {
    margin-left: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    background-color: #4e8cff;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #3c76e0;
}

/* Disclaimer text under the input box */
.disclaimer {
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
    /*margin-top: 8px;
    padding: 0 12px;*/
    line-height: 1.3;
}
#scroll-to-input {
  position: fixed;
  bottom: 4.5rem; /* above input box */
  right: 1.5rem;
  z-index: 9999;
  background-color: #0078d4;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#scroll-to-input:hover {
  background-color: #005fa3;
}



@media (max-width: 600px) {
    #user-input {
        width: 100%;
        font-size: 1rem;
    }

    button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #chat-container {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        /*overflow-y: auto;*/
        scroll-behavior: smooth;  /* <-- smooth scroll effect */
	  overflow-y: scroll;               /* enable scrolling */
	  scrollbar-width: none;           /* Firefox */
	  -ms-overflow-style: none;        /* IE and Edge */

    }
    #chat-container::-webkit-scrollbar {
		display: none;                   /* Chrome, Safari, Edge (WebKit) */
	}
    #input-form {
        width: 100%;
        padding: 1rem; /* Optional: adjust padding to prevent edge collision */
        box-sizing: border-box;
    }

    .input-wrapper {   
        width: 100%;
        /*margin: 10px 1rem;*/
        box-sizing: border-box;
    }

	#scroll-to-input {
	  transition: opacity 0.3s ease;
	  opacity: 0;
	  pointer-events: none; /* disable click when hidden */
	}

	#scroll-to-input.visible {
	  opacity: 1;
	  pointer-events: auto;
	}



}