body {
    background: var(--bg-main);
    color: var(--text-muted);
    height: 95vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}
.d-flex {
    align-items: center;
}
nav{
    justify-content: center;
}

.container {
    overflow-y: scroll;
    padding: 50px;
    width: 40%;
    max-width: 100%;
}

.container::-webkit-scrollbar {
    display: none;
}

.container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

li {
    padding: 5px;
}

ul {
    list-style: none;
    padding: 0;
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
}

#closeButton{
    background-color: rgb(255, 255, 255);
    border-radius:  6px 6px 6px 6px;;
    margin-right: 12px;
    position: absolute;
    right: 0;
}

h4, h5 {
    font-size: 18px;
    font-family: "Gill Sans Extrabold", sans-serif;
    color: var(--text-primary);
}

 h3 {
    font-size: calc(1.3rem + .6vw);
    padding-left: 30px;
    margin-top: 22px;
}

.name {
    flex-direction: column;
    align-items: center;
    font-family: "Gill Sans Extrabold", sans-serif;
    color: var(--text-primary);
}

.menubar{
    background-color: var(--bg-main);
    height: 8vh;
    display: flex;
}
.chat-container {
    padding: 10px;
    height: calc(100vh - 160px);
    overflow-y: auto;
    width: 100%;
    margin-top: 20px;
    background-color: var(--bg-main);
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.chatbox {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
}

.message {
    position: relative;
    background: var(--msg-bg-receive);
    color: var(--text-primary);
    padding: 8px 12px 18px 12px;
    margin: 4px;
    border-radius: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    max-width: 80%;
    word-wrap: break-word;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.timestamp {
    position: absolute;
    bottom: 4px;
    right: 10px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Typing Indicator Animation */
.typing-indicator-msg {
    padding-bottom: 8px !important;
}
.typing-loader {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding: 4px 0;
}
.typing-loader span {
    display: block;
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-loader span:nth-child(1) { animation-delay: -0.32s; }
.typing-loader span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.left {
    align-self: flex-start;
    border-top-left-radius: 0;
}

.right {
    align-self: flex-end;
    background: var(--msg-bg-send);
    border-top-right-radius: 0;
}

.send-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    padding: 10px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    transition: background 0.3s, border 0.3s;
}

.send {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.ai-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 5px;
    flex-wrap: wrap;
}

/* Sidebar styling */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100%;
    background-color: var(--bg-panel);
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease, background 0.3s;
    flex-direction: column;
    color: var(--text-primary);
    z-index: 1050;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.sidebar.active {
    transform: translateX(0);
    display: flex;
}

.sidebar h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.sidebar label {
    margin-bottom: 10px;
    display: block;
}

/* Animated Hamburger Toggle */
.toggle-sidebar {
    width: 32px;
    height: 22px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    padding: 0;
    z-index: 1060;
}

.toggle-sidebar span {
    display: block;
    height: 3px;
    width: 100%;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.toggle-sidebar.open span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.toggle-sidebar.open span:nth-child(2) {
    opacity: 0;
}

.toggle-sidebar.open span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

.footer {
    display: none; /* Hide footer to save space for chat */
}

.designed-by {
    display: none; /* Hide top right text on mobile to avoid overlap */
}

/* Media Queries */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 180px); /* Extra space for wrapped buttons */
        padding: 5px;
    }
    
    .message {
        max-width: 90%;
        font-size: 13px;
    }
    
    .sidebar {
        width: 220px;
    }
    
    .ai-actions button {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: calc(100vh - 190px);
    }
    
    .message {
        max-width: 95%;
    }
    
    .toggle-sidebar {
        padding: 6px 10px;
    }
    
    .navbar .name h4, .navbar .name h5 {
        font-size: 14px;
    }
}
