/* ThemeBot Professional Styles */

:root {
  --bot-primary: #25d366;
  --bot-primary-dark: #128c7e;
  --bot-gradient: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

/* Brand */
.bot-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bot-gradient);
  color: #fff;
  font-size: 1.25rem;
}

.bot-brand-icon.large {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  border-radius: 16px;
}

/* Stat cards */
.bot-stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  box-shadow: 0 2px 6px rgba(67, 89, 113, 0.08);
}

.bot-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 89, 113, 0.12);
}

.bot-stat-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.bot-stat-card h3,
.bot-stat-card h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Welcome banner */
.bot-welcome-card {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.08) 0%, rgba(18, 140, 126, 0.04) 100%);
  border: 1px solid rgba(37, 211, 102, 0.15);
}

/* Sidebar */
.bot-sidebar-footer {
  border-top: 1px solid rgba(67, 89, 113, 0.1);
  margin-top: auto;
}

.bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffab00;
  display: inline-block;
  animation: bot-pulse 2s infinite;
}

.bot-status-dot.online {
  background: #25d366;
}

.bot-status-dot.offline {
  background: #ff3e1d;
  animation: none;
}

@keyframes bot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Navbar */
.bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bot-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.breadcrumb {
  font-size: 0.8rem;
}

/* Alerts */
.bot-alert {
  border: none;
  border-left: 4px solid;
}

.alert-success.bot-alert { border-left-color: #71dd37; }
.alert-danger.bot-alert { border-left-color: #ff3e1d; }
.alert-warning.bot-alert { border-left-color: #ffab00; }
.alert-info.bot-alert { border-left-color: #03c3ec; }

/* QR */
.qr-box {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.03);
}

.bot-qr-image {
  max-width: 260px;
  border-radius: 8px;
}

/* Chat */
.bot-chat-layout .card {
  border: none;
  box-shadow: 0 2px 8px rgba(67, 89, 113, 0.08);
}

.bot-chat-header {
  background: #f8f9fa;
  border-bottom: 1px solid rgba(67, 89, 113, 0.1);
}

.bot-chat-messages {
  min-height: 400px;
  max-height: 520px;
  overflow-y: auto;
  background: #e5ddd5 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  padding: 1.25rem;
}

.bot-message-wrap {
  display: flex;
  margin-bottom: 0.75rem;
}

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

.bot-message-wrap.out,
.bot-message-wrap.auto {
  justify-content: flex-end;
}

.conversation-bubble {
  max-width: 75%;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
}

.conversation-bubble.in {
  background: #fff;
  border-top-left-radius: 0;
}

.conversation-bubble.out,
.conversation-bubble.auto {
  background: #dcf8c6;
  border-top-right-radius: 0;
}

.bot-message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.45);
  margin-top: 0.25rem;
}

.bot-message-body {
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.bot-chat-compose {
  background: #f0f2f5;
  border-top: 1px solid rgba(67, 89, 113, 0.1);
}

.bot-contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bot-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.bot-contact-avatar.small {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.bot-chat-item.active {
  background: rgba(37, 211, 102, 0.1) !important;
  border-left: 3px solid #25d366;
}

/* Tables */
.table td {
  vertical-align: middle;
}

.message-preview {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-hover tbody tr:hover {
  background-color: rgba(37, 211, 102, 0.04);
}

/* Reply editor */
.reply-editor-toolbar .btn {
  width: 36px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reply-variable-select {
  width: 132px;
}

.reply-preview {
  min-height: 48px;
  white-space: pre-wrap;
}

.list-group-item.active small,
.list-group-item.active .text-muted {
  color: inherit !important;
}

/* Connection steps */
.bot-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bot-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.bot-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bot-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.bot-info-box {
  padding: 0.75rem 1rem;
  background: rgba(67, 89, 113, 0.04);
  border-radius: 8px;
}

/* Settings */
.bot-system-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
}

.bot-system-list li:last-child {
  border-bottom: none;
}

.bot-tip-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Login */
.bot-login-body {
  margin: 0;
  min-height: 100vh;
}

.bot-login-wrapper {
  display: flex;
  min-height: 100vh;
}

.bot-login-hero {
  flex: 1;
  background: var(--bot-gradient);
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.bot-login-hero-content {
  max-width: 420px;
}

.bot-login-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bot-login-features li {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-login-features li i {
  font-size: 1.25rem;
  opacity: 0.8;
}

.bot-login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f5f5f9;
}

.bot-login-card {
  max-width: 420px;
  width: 100%;
  border: none;
  box-shadow: 0 4px 24px rgba(67, 89, 113, 0.12);
}

/* Cards general */
.card {
  border: none;
  box-shadow: 0 2px 6px rgba(67, 89, 113, 0.06);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
}

/* Progress bars */
.progress-bar {
  background: var(--bot-gradient);
}

.bot-brand-icon.small {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  border-radius: 8px;
}

/* Landing page */
.bot-landing-body {
  background: #fff;
  color: #566a7f;
}

.bot-landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
}

.bot-landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.bot-landing-hero {
  padding: 4rem 0 5rem;
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.06) 0%, #fff 100%);
}

.bot-landing-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  background: rgba(37, 211, 102, 0.12);
  color: #128c7e;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.bot-landing-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #233446;
  margin-bottom: 1.25rem;
}

.bot-landing-title span {
  background: var(--bot-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bot-landing-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #697a8d;
  max-width: 520px;
}

.bot-landing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: #697a8d;
}

.bot-landing-trust i {
  color: #25d366;
  margin-right: 0.25rem;
}

.bot-landing-mockup {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(67, 89, 113, 0.15);
  overflow: hidden;
  border: 1px solid rgba(67, 89, 113, 0.08);
}

.bot-mockup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
}

.bot-mockup-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(67, 89, 113, 0.06);
}

.bot-mockup-stat {
  text-align: center;
  padding: 0.5rem;
  background: rgba(37, 211, 102, 0.05);
  border-radius: 8px;
}

.bot-mockup-stat span {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: #233446;
}

.bot-mockup-stat small {
  color: #697a8d;
  font-size: 0.7rem;
}

.bot-mockup-chat {
  padding: 1.25rem;
  background: #e5ddd5;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bot-mockup-bubble {
  max-width: 80%;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.bot-mockup-bubble.in {
  background: #fff;
  align-self: flex-start;
  border-top-left-radius: 0;
}

.bot-mockup-bubble.auto,
.bot-mockup-bubble.out {
  background: #dcf8c6;
  align-self: flex-end;
  border-top-right-radius: 0;
}

.bot-landing-section {
  padding: 5rem 0;
}

.bot-landing-section-alt {
  background: #f8f9fb;
}

.bot-section-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #233446;
}

.bot-feature-card {
  height: 100%;
  padding: 1.75rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(67, 89, 113, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bot-landing-section-alt .bot-feature-card {
  background: #fff;
}

.bot-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(67, 89, 113, 0.1);
}

.bot-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.bot-feature-card h5 {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.bot-landing-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bot-landing-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(67, 89, 113, 0.08);
}

.bot-landing-cta {
  padding: 4rem 0;
  background: var(--bot-gradient);
}

.bot-landing-footer {
  border-top: 1px solid rgba(67, 89, 113, 0.08);
  background: #fff;
}

@media (max-width: 767.98px) {
  .bot-landing-hero {
    padding: 2.5rem 0 3rem;
  }

  .bot-landing-section {
    padding: 3rem 0;
  }

  .bot-mockup-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive */
@media (max-width: 991.98px) {
  .bot-chat-messages {
    min-height: 300px;
    max-height: 400px;
  }

  .conversation-bubble {
    max-width: 90%;
  }
}
