* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background: #f5f9ff;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

.conversation-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.conversation-item:hover {
    background: #f5f5f5;
}

.new-chat-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: #2e2537;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-chat-button:hover {
    opacity: 0.9;
}

.menu-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 10px;
}

.menu-line {
    width: 20px;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.chat-header {
    background-color: #2e2537;
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.chat-header img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-buttons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-left: auto;
}

.header-button {
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.header-button .material-icons {
    font-size: 18px;
}

.credits-display {
    background: rgba(255, 255, 255, 0.9);
    color: #2e2537;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.credits-text {
    display: inline;
}

.chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 160px);
}

.message {
    max-width: 80%;
    word-wrap: break-word;
    display: flex;
    /*align-items: center;*/
    gap: 0.5rem;
}

.message img {
    height: 30px;
    width: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.message .text-content {
    padding: 0.8rem 1rem;
    border-radius: 8px;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .text-content-main {
    width: 90%;
}

.bot-message .text-content {
    background: #f0f2f5;
}

.user-message {
    align-self: flex-end;
}

.user-message .profile {
    order: 2
}

.user-message .text-content {
    background: #e3f2fd;
    width: auto;
    max-width: 500px;
}

.chat-input {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input .chat-input-inner {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;

}

.chat-input textarea {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    height: 45px;
    max-height: 150px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
    height: 45px;
}

.send-button,
.upload-button,
.delete-button {
    height: 100%;
    padding: 0 1rem;
    background-color: #2e2537;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover,
.upload-button:hover,
.delete-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.material-icons {
    font-size: 20px;
}

input[type="file"],
#fileInput {
    display: none;
}

.conversation-starters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.starter-button {
    padding: 0.8rem 1.2rem;
    background: #f0f2f5;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.starter-button:hover {
    background: #e3e5e8;
    transform: translateY(-1px);
}

.footer-links {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-top: 1px solid #eee;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 0.7rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #2196F3;
}

@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
    }

    .message {
        max-width: 90%;
    }

    .chat-header-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .header-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .delete-button {
        display: none;
    }

    .header-button span.material-icons+span {
        display: none;
    }

    .credits-text {
        display: none;
    }
}

/* chatting dots */
.typing-animation {
    display: inline-flex;
}

.typing-animation .typing-dot {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    margin: 0 3px;
    opacity: 0.7;
    background: #222222;
    animation: animateDots 1.5s var(--delay) ease-in-out infinite;
}

.typing-animation .typing-dot:first-child {
    margin-left: 0;
}

@keyframes animateDots {

    0%,
    44% {
        transform: translateY(0px);
    }

    28% {
        opacity: 0.4;
        transform: translateY(-6px);
    }

    44% {
        opacity: 0.2;
    }
}


table,
th,
td {
    border: 1px solid black;
    border-collapse: collapse;
}

th,
td {
    padding: 8px;
    text-align: left;
}

.html-file-cover {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    /* display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 8px; */
}

.submited-file {
    width: 46%;
    padding: 10px !important;
    margin-right: 7px;
}

@media screen and (max-width: 767px) {
    .user-message .text-content {
        width: 100%;
    }

    .submited-file {
        width: 100%;
    }

    .html-file-cover {
        display: block;
    }
}

/* @media screen and (max-width: 600px) {
    .html-file-cover {
        display: block;
    }
    .submited-file {
        width: 100%;
    }
} */

@media screen and (max-width: 580px) {
  body {
    max-height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  .chat-container {
    height: 100%;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
  }

  .chat-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem !important;
  }

  .sidebar {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
  }

  .new-chat-button {
    position: fixed;
    bottom: 0;
    left: -300px;
    width: 300px;
    margin: 0;
    padding: 12px;
    background-color: #2e2537;
    z-index: 1001;
    transition: left 0.3s ease;
  }

  /* Show button only when sidebar is active */
  .sidebar.active .new-chat-button {
    left: 0;
  }

  .chat-input textarea {
    font-size: 16px;
    height: 40px;
    min-height: 40px;
  }

  .chat-actions {
    height: 40px;
  }

  .chat-actions button {
    padding: 0 8px;
    height: 40px;
  }

  .chat-actions button svg {
    height: 20px;
    width: 20px;
  }

  .footer-links {
    font-size: 12px;
    padding: 0.5rem;
  }

  .footer-links a {
    font-size: 12px;
    margin: 0 0.5rem;
  }
}