/**
 * Chat Widget & Tanya Ulama Floating Interactive Stylesheet
 * 
 * @package MUISubangCore
 * @version 1.0.0
 */

/* Floating Trigger Button */
.mui-chat-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  background: linear-gradient(135deg, #075e46 0%, #064535 100%);
  color: #ffffff;
  border: 2px solid #c9a24b;
  border-radius: 50px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(7, 94, 70, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mui-chat-trigger-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(7, 94, 70, 0.5);
  background: linear-gradient(135deg, #097255 0%, #075e46 100%);
}

.mui-chat-trigger-icon {
  font-size: 20px;
  line-height: 1;
}

.mui-chat-trigger-badge {
  background: #c9a24b;
  color: #101a18;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chat Widget Container / Modal */
.mui-chat-modal {
  position: fixed;
  bottom: 85px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid #e4eae6;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.mui-chat-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Modal Header */
.mui-chat-header {
  background: linear-gradient(135deg, #075e46 0%, #064535 100%);
  color: #ffffff;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c9a24b;
}

.mui-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mui-chat-avatar {
  width: 40px;
  height: 40px;
  background: #ffffff;
  color: #075e46;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mui-chat-title-group h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.mui-chat-status {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #e4eae6;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mui-status-dot {
  width: 8px;
  height: 8px;
  background: #2ed1a8;
  border-radius: 50%;
  display: inline-block;
}

.mui-chat-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.2s;
}

.mui-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Channel Navigation Tabs */
.mui-chat-tabs {
  display: flex;
  background: #f7f9f7;
  border-bottom: 1px solid #e4eae6;
}

.mui-chat-tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #5e6c64;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.mui-chat-tab-btn.is-active {
  color: #075e46;
  border-bottom-color: #075e46;
  background: #ffffff;
}

/* Tab Panels Container */
.mui-chat-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: #fdfdfd;
}

.mui-tab-panel {
  display: none;
  height: 100%;
}

.mui-tab-panel.is-active {
  display: flex;
  flex-direction: column;
}

/* Tab 1: Bot Messages View */
.mui-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mui-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

.mui-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  color: #202724;
  border: 1px solid #e4eae6;
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.mui-msg-user {
  align-self: flex-end;
  background: #075e46;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.mui-msg-time {
  font-size: 10px;
  color: #8b9992;
  margin-top: 4px;
  display: block;
}

.mui-msg-user .mui-msg-time {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

/* Quick Replies Chips */
.mui-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mui-chip-btn {
  background: #f0f4f2;
  border: 1px solid #d0ded6;
  color: #064535;
  border-radius: 16px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  text-align: left;
}

.mui-chip-btn:hover {
  background: #075e46;
  color: #ffffff;
  border-color: #075e46;
}

/* Bot Input Bar */
.mui-bot-input-bar {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e4eae6;
  background: #ffffff;
  gap: 8px;
}

.mui-bot-input-bar input {
  flex: 1;
  border: 1px solid #d0ded6;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
}

.mui-bot-input-bar input:focus {
  border-color: #075e46;
}

.mui-bot-input-bar button {
  background: #075e46;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.mui-bot-input-bar button:hover {
  background: #064535;
}

/* Tab 2: WhatsApp View */
.mui-wa-panel {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
}

.mui-wa-icon-large {
  width: 64px;
  height: 64px;
  background: #25d366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.mui-wa-panel h4 {
  margin: 0;
  font-size: 17px;
  color: #064535;
}

.mui-wa-panel p {
  margin: 0;
  font-size: 13px;
  color: #5e6c64;
  line-height: 1.5;
}

.mui-wa-btn {
  background: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.2s;
}

.mui-wa-btn:hover {
  background: #20ba5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
  color: #ffffff;
}

/* Tab 3: In-widget Form View */
.mui-form-panel {
  padding: 16px;
  overflow-y: auto;
}

.mui-form-panel form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.mui-form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #202724;
}

.mui-form-group input,
.mui-form-group select,
.mui-form-group textarea {
  border: 1px solid #d0ded6;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.mui-form-group input:focus,
.mui-form-group select:focus,
.mui-form-group textarea:focus {
  border-color: #075e46;
}

.mui-form-submit-btn {
  background: #075e46;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.mui-form-submit-btn:hover {
  background: #064535;
}

.mui-form-alert {
  padding: 10px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 8px;
}

.mui-form-alert.is-success {
  background: #e8f6f0;
  color: #075e46;
  border: 1px solid #075e46;
}

.mui-form-alert.is-error {
  background: #fde8e8;
  color: #c81e1e;
  border: 1px solid #f8b4b4;
}

/* Dark Mode Overrides for Widget */
[data-theme="dark"] .mui-chat-modal {
  background: #14221f;
  border-color: #233732;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .mui-chat-tabs {
  background: #0d1514;
  border-bottom-color: #233732;
}

[data-theme="dark"] .mui-chat-tab-btn {
  color: #99a8a1;
}

[data-theme="dark"] .mui-chat-tab-btn.is-active {
  background: #14221f;
  color: #2ed1a8;
  border-bottom-color: #2ed1a8;
}

[data-theme="dark"] .mui-chat-body {
  background: #101a18;
}

[data-theme="dark"] .mui-msg-bot {
  background: #182a26;
  color: #e2e8e5;
  border-color: #233732;
}

[data-theme="dark"] .mui-chip-btn {
  background: #182a26;
  border-color: #2a443d;
  color: #2ed1a8;
}

[data-theme="dark"] .mui-chip-btn:hover {
  background: #075e46;
  color: #ffffff;
}

[data-theme="dark"] .mui-bot-input-bar {
  background: #14221f;
  border-top-color: #233732;
}

[data-theme="dark"] .mui-bot-input-bar input {
  background: #101a18;
  border-color: #233732;
  color: #e2e8e5;
}

[data-theme="dark"] .mui-form-group label {
  color: #e2e8e5;
}

[data-theme="dark"] .mui-form-group input,
[data-theme="dark"] .mui-form-group select,
[data-theme="dark"] .mui-form-group textarea {
  background: #101a18;
  border-color: #233732;
  color: #e2e8e5;
}

@media (max-width: 480px) {
  .mui-chat-modal {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
