body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #343541;
    color: white;
}

/* MAIN LAYOUT */
.container {
    display: flex;
    height: 100vh;
    background: #FF66B2;
}

.sidebar {
    width: 240px;
    background: #0047AB;
    color: white;
    padding: 20px;
}

/* CHAT AREA */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* CHAT BOX (SCROLLABLE) */
#chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    line-height: 1.5;
}

.user {
    text-align: right;
    color: #0fdb8c;
}

.ai {
    text-align: left;
    color: #e5e5e5;
}

/* INPUT AREA FIXED AT BOTTOM */
.input-area {
    border-top: 1px solid #555;
    padding: 12px;
    background: #40414f;
}

input {
    flex: 1;
    padding: 10px;
    background: #40414f;
    border: none;
    color: white;
    outline: none;
}

button {
    background: #19c37d;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
}

/* TEXTAREA */
#user-input {
    width: 100%;
    resize: none;
    padding: 12px;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 15px;
    background: #2f313d;
    color: white;
}

#stopBtn {
    margin-left: 10px;
    background: #ff4a4a;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
}

pre {
    background: #1e1e1e;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #19c37d;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
}

/* ---------- SPEECH BUBBLES ---------- */

.message {
    max-width: 50%;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
}

/* USER BUBBLE (RIGHT) */
.user {
    margin-left: auto;
    background: #0047AB;
    color: #e5e5e5;
    border-bottom-right-radius: 8px;
}

.user::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 10px;
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #2d07ec;
}

/* AI BUBBLE (LEFT) */
.ai {
    margin-right: auto;
    background: #0047AB;
    color: #e5e5e5;
    border-bottom-left-radius: 4px;
}

.ai::after {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 10px;
    border-width: 8px 8px 8px 0;
    border-style: solid;
    border-color: transparent #0f08ea transparent transparent;
}

.ai p {
    margin: 6px 0;
}

.ai a {
    color: #4ea1ff;
    text-decoration: underline;
}

.ai code {
    background: #2d2d2d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.ai pre {
    background: #1e1e1e;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}

.ai ol {
    padding-left: 20px;
    margin: 8px 0;
}

.ai li {
    margin-bottom: 6px;
}

.ai strong {
    color: #ffffff;
}

.ai a {
    color: #4ea1ff;
    text-decoration: underline;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: bold;
    color: white;
}

.brand img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

@media (max-width: 768px) {
  .message {
    max-width: 85%;
    font-size: 15px;
  }

  .container {
    flex-direction: column;
  }

  .sidebar {
    display: 48px;
  }

  #chat-box {
    padding: 24px;
  }

  #user-input {
    font-size: 16px; /* prevents mobile zoom */
  }
}
/* ---------- ENGLISH TUTOR PANEL ---------- */

.tutor-panel {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutor-panel h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #ffffff;
    text-align: left;
}

.tutor-btn {
    background: #2f5fd7;
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.tutor-btn:hover {
    background: #3b74ff;
    transform: translateY(-1px);
}

.tutor-btn.active {
    background: #19c37d;
    color: #000;
    font-weight: bold;
}
