/*!
 * My Chatbot (Quotes) - Frontend Styles
 * v3.3.0 - STL File Upload Integration
 */

/* ==================== Reset & Base ==================== */
.mc-chatbot,
.mc-chatbot *,
.mc-inquiry-modal,
.mc-inquiry-modal * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.mc-chatbot,
.mc-inquiry-modal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== Main Container ==================== */
.mc-chatbot {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 24px auto;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* ==================== Chat Header ==================== */
.mc-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #374151;
  color: #ffffff;
}

.mc-header-left {
  flex: 1;
}

.mc-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.mc-sub {
  font-size: 13px;
  opacity: 0.9;
}

.mc-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-admin-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mc-admin-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mc-auth-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mc-auth-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==================== Admin Panel ==================== */
.mc-admin-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 2px solid #e5e7eb;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mc-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.mc-admin-title {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.mc-admin-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.mc-admin-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.mc-admin-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.mc-admin-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  border-radius: 8px;
  transition: all 0.2s;
}

.mc-admin-tab:hover {
  background: #f3f4f6;
  color: #111827;
}

.mc-admin-tab.active {
  background: #eef2ff;
  color: #f59e0b;
}

.mc-admin-content {
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.mc-admin-error {
  text-align: center;
  color: #ef4444;
  padding: 40px 20px;
  font-size: 14px;
}

/* Statistics */
.mc-stats-period {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mc-stats-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s;
}

.mc-stats-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.mc-stats-btn.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

.mc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.mc-stat-card {
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.mc-stat-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mc-stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.mc-stat-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* Filters & Tables */
.mc-admin-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mc-filter-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s;
}

.mc-filter-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.mc-filter-btn.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

.mc-admin-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.mc-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

.mc-admin-table thead {
  background: #f9fafb;
}

.mc-admin-table th,
.mc-admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.mc-admin-table th {
  font-weight: 600;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-admin-table tbody tr:hover {
  background: #f9fafb;
}

.mc-admin-table tbody tr:last-child td {
  border-bottom: none;
}

.mc-admin-table a {
  color: #f59e0b;
  text-decoration: none;
  font-weight: 500;
}

.mc-admin-table a:hover {
  text-decoration: underline;
}

.mc-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.mc-status.status-success {
  background: #e5e7eb;
  color: #111827;
}

.mc-status.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.mc-status.status-info {
  background: #dbeafe;
  color: #1e40af;
}

.mc-status.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.mc-btn-sm {
  padding: 6px 12px;
  background: #f59e0b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.mc-btn-sm:hover {
  background: #4338ca;
}

.mc-btn-sm.mc-btn-danger {
  background: #ef4444;
}

.mc-btn-sm.mc-btn-danger:hover {
  background: #dc2626;
}

/* ==================== Chat Body ==================== */
.mc-chat-body {
  height: 500px;
  overflow-y: auto;
  padding: 20px;
  background: #f9fafb;
  scroll-behavior: smooth;
}

.mc-chat-body::-webkit-scrollbar {
  width: 8px;
}

.mc-chat-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.mc-chat-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.mc-chat-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== Messages ==================== */
.mc-msg {
  display: flex;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-in;
}

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

.mc-msg.mc-from-user {
  justify-content: flex-end;
}

.mc-msg.mc-from-bot {
  justify-content: flex-start;
}

.mc-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  word-wrap: break-word;
}

.mc-from-user .mc-bubble {
  background: #374151;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.mc-from-bot .mc-bubble {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing i {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing i:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

/* ==================== CTA Buttons ==================== */
.mc-cta-text {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 500;
}

.mc-cta-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mc-cta-btn {
  display: inline-block;
  padding: 10px 18px;
  background: #374151;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.mc-cta-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  color: #ffffff;
}

.mc-cta-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* ==================== Chat Footer ==================== */
.mc-chat-footer {
  padding: 16px 20px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

#mc-chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

#mc-user-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

#mc-user-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mc-send-btn {
  padding: 12px 20px;
  background: #374151;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mc-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mc-send-btn:active {
  transform: translateY(0);
}

.mc-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-inquiry-btn {
  padding: 12px 16px;
  background: #f59e0b;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mc-inquiry-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.mc-stl-btn {
  padding: 8px 12px;
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mc-stl-btn:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #9ca3af;
  transform: none;
}

.mc-stl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.mc-stl-preview {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-stl-preview-remove {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  margin-left: auto;
  transition: all 0.2s;
}

.mc-stl-preview-remove:hover {
  color: #991b1b;
}

/* ==================== Inquiry Modal ==================== */
.mc-inquiry-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-in;
}

.mc-inquiry-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

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

.mc-inquiry-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mc-inquiry-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.mc-inquiry-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.mc-inquiry-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.mc-inquiry-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.mc-inquiry-modal-body > p {
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.6;
}

.mc-inquiry-field {
  margin-bottom: 16px;
}

.mc-inquiry-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.mc-inquiry-field input,
.mc-inquiry-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.mc-inquiry-field input:focus,
.mc-inquiry-field textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mc-inquiry-field textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
}

.mc-inquiry-consent {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-top: 20px;
}

.mc-inquiry-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}

.mc-inquiry-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mc-inquiry-checkbox-label span {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  line-height: 1.5;
}

.mc-inquiry-consent-text {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  padding-left: 28px;
}

.mc-inquiry-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.mc-inquiry-cancel,
.mc-inquiry-submit {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.mc-inquiry-cancel {
  background: #f3f4f6;
  color: #374151;
}

.mc-inquiry-cancel:hover {
  background: #e5e7eb;
}

.mc-inquiry-submit {
  background: #f59e0b;
  color: #ffffff;
}

.mc-inquiry-submit:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.mc-inquiry-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==================== My Inquiries Page ==================== */
.mc-my-inquiries h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #111827;
}

.mc-inquiry-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.mc-inquiry-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.mc-inquiry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mc-inquiry-header strong {
  font-size: 16px;
  color: #111827;
}

.mc-inquiry-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.mc-inquiry-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.mc-inquiry-status.replied {
  background: #e5e7eb;
  color: #111827;
}

.mc-inquiry-date {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.mc-inquiry-message {
  color: #374151;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mc-inquiry-replies {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.mc-inquiry-reply {
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.6;
}

.mc-inquiry-reply strong {
  color: #f59e0b;
}

.mc-inquiry-reply.admin strong {
  color: #1f2937;
}

/* ==================== Utilities ==================== */
.error {
  color: #ef4444;
  font-weight: 600;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .mc-chatbot {
    margin: 16px;
    border-radius: 12px;
  }

  .mc-chat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mc-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .mc-chat-body {
    height: 400px;
  }

  .mc-bubble {
    max-width: 85%;
  }

  #mc-chat-form {
    flex-wrap: wrap;
  }

  #mc-user-input {
    width: 100%;
    order: 1;
  }

  .mc-stl-btn {
    order: 2;
    flex: 1;
  }

  .mc-send-btn {
    order: 3;
    flex: 1;
  }

  .mc-inquiry-btn {
    order: 4;
    width: 100%;
  }

  .mc-stats-grid {
    grid-template-columns: 1fr;
  }

  .mc-admin-content {
    padding: 16px;
  }

  .mc-admin-table {
    font-size: 12px;
  }

  .mc-admin-table th,
  .mc-admin-table td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .mc-title {
    font-size: 16px;
  }

  .mc-sub {
    font-size: 12px;
  }

  .mc-chat-body {
    height: 350px;
    padding: 16px;
  }

  .mc-bubble {
    font-size: 13px;
    padding: 10px 14px;
  }

  .mc-inquiry-modal-content {
    margin: 10px;
  }

  .mc-inquiry-modal-header,
  .mc-inquiry-modal-body {
    padding: 20px;
  }
}
