/* ==================== RESET & BASE ====================*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* ==================== LOGIN PAGE ====================*/
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  text-align: center;
}

.login-subtitle {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  background-color: white;
  border-color: #333;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.btn-login {
  padding: 12px;
  background-color: #1a1a1a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-login:active {
  transform: scale(0.98);
}

.error-message {
  padding: 12px;
  background-color: #fff5f5;
  border: 1px solid #ffb3b3;
  border-radius: 6px;
  color: #c33;
  font-size: 13px;
  text-align: center;
}

.login-footer {
  margin-top: 32px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* ==================== APP PAGE ====================*/
.app-body {
  background-color: #f5f5f5;
}

.app-container {
  display: flex;
  height: 100vh;
  background-color: white;
  position: relative;
}

/* ===== EMAIL EDITOR PANEL =====*/
.email-editor-panel {
  width: 0;
  flex-shrink: 0;
  background-color: #fafafa;
  border-right: 1px solid #e0e0e0;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

.email-editor-panel.open {
  width: 35%;
  max-width: 500px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
  background-color: white;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.btn-close-panel {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.btn-close-panel:hover {
  color: #333;
}

.editor-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #1a1a1a;
  color: white;
}

.btn-primary:hover {
  background-color: #333;
}

.btn-secondary {
  background-color: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background-color: #d0d0d0;
}

/* ===== CHATBOT PANEL =====*/
.chatbot-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: white;
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #fafafa;
}

.chatbot-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.btn-logout {
  padding: 8px 14px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
  transition: all 0.2s;
}

.btn-logout:hover {
  background-color: #e0e0e0;
}

/* ===== CHAT AREA =====*/
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: white;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.user-message {
  justify-content: flex-end;
}

.user-message p {
  background-color: #1a1a1a;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 70%;
}

.bot-message {
  justify-content: flex-start;
}

.bot-message p {
  background-color: #f0f0f0;
  color: #333;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 70%;
}

.bot-message p:first-child {
  margin-bottom: 4px;
}

.bot-message p:last-child {
  margin-bottom: 0;
}

/* ===== CHAT INPUT =====*/
.chat-input-area {
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  background-color: white;
}

.chat-form {
  display: flex;
  gap: 12px;
}

#chatInput {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

#chatInput:focus {
  outline: none;
  background-color: white;
  border-color: #333;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.btn-send {
  padding: 12px 20px;
  background-color: #1a1a1a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-send:hover {
  background-color: #333;
}

.btn-send:active {
  transform: scale(0.98);
}

.send-icon {
  font-size: 16px;
}

/* ===== TYPING INDICATOR =====*/
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 30px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* ==================== RESPONSIVE ====================*/
@media (max-width: 768px) {
  .email-editor-panel.open {
    width: 100%;
    max-width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
  }

  .user-message p,
  .bot-message p {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
  }

  .user-message p,
  .bot-message p {
    max-width: 90%;
  }

  .btn-send span {
    display: none;
  }

  .btn-send {
    padding: 12px 16px;
  }
}

/* ==================== SCROLLBAR ====================*/
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}
