/* WhatsApp Link Generator Styles */
.statmat-tool.whatsapp-link {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 650px;
  margin: 0 auto;
  color: #111b21; /* WhatsApp dark text */
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  border: 1px solid #e9edef;
}

.statmat-tool.whatsapp-link * {
  box-sizing: border-box;
}

.statmat-tool.whatsapp-link .wa-header {
  background-color: #00a884; /* WhatsApp Green */
  color: white;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.statmat-tool.whatsapp-link .wa-header h2 {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 600;
}

.statmat-tool.whatsapp-link .wa-header p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.statmat-tool.whatsapp-link .wa-container {
  padding: 32px 24px;
  background-color: #efeae2; /* WA chat background */
  background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h-2zM40 20.5V18H20v-2h20v-2H20v-2h20v-2H20V8h20V6H20V4h20V2H20V0h22v20h-2z" fill="%23d8cfc4" fill-opacity="0.4" fill-rule="evenodd"/></svg>');
}

.statmat-tool.whatsapp-link .form-section {
  background-color: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}

.statmat-tool.whatsapp-link .input-group {
  margin-bottom: 20px;
}

.statmat-tool.whatsapp-link label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #3b4a54;
  font-size: 15px;
}

.statmat-tool.whatsapp-link .phone-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}

.statmat-tool.whatsapp-link .plus-prefix {
  padding: 12px 0 12px 16px;
  color: #54656f;
  font-weight: bold;
  font-size: 16px;
}

.statmat-tool.whatsapp-link input[type="tel"],
.statmat-tool.whatsapp-link textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.statmat-tool.whatsapp-link .phone-input-wrapper input {
  border: none;
  border-radius: 0;
  padding-left: 8px;
}

.statmat-tool.whatsapp-link input[type="tel"]:focus,
.statmat-tool.whatsapp-link textarea:focus,
.statmat-tool.whatsapp-link .phone-input-wrapper:focus-within {
  outline: none;
  border-color: #00a884;
}

.statmat-tool.whatsapp-link textarea {
  resize: vertical;
}

.statmat-tool.whatsapp-link .help-text {
  display: block;
  margin-top: 6px;
  color: #54656f;
  font-size: 13px;
}

.statmat-tool.whatsapp-link .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  border-radius: 24px; /* Pill shape */
  padding: 12px 24px;
  font-size: 15px;
  width: 100%;
}

.statmat-tool.whatsapp-link .btn-primary {
  background-color: #00a884;
  color: #fff;
}

.statmat-tool.whatsapp-link .btn-primary:hover {
  background-color: #008f6f;
}

.statmat-tool.whatsapp-link .result-section {
  background-color: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.statmat-tool.whatsapp-link .result-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #111b21;
  font-size: 20px;
}

.statmat-tool.whatsapp-link .url-display {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.statmat-tool.whatsapp-link .url-display input {
  flex-grow: 1;
  background-color: #f0f2f5;
  color: #3b4a54;
  font-weight: 500;
}

.statmat-tool.whatsapp-link .btn-copy {
  width: auto;
  background-color: #e9edef;
  color: #54656f;
  border-radius: 8px;
}

.statmat-tool.whatsapp-link .btn-copy:hover {
  background-color: #d1d7db;
}

.statmat-tool.whatsapp-link .qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px dashed #d1d7db;
  border-radius: 8px;
  background-color: #fcfcfc;
}

.statmat-tool.whatsapp-link .qr-box {
  background-color: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 12px;
}

.statmat-tool.whatsapp-link .qr-hint {
  font-size: 13px;
  color: #54656f;
  margin: 0;
  text-align: center;
}

.statmat-tool.whatsapp-link .btn-secondary {
  background-color: #fff;
  color: #00a884;
  border: 1px solid #00a884;
  text-decoration: none;
}

.statmat-tool.whatsapp-link .btn-secondary:hover {
  background-color: #f0fdf9;
}

/* Toast */
.statmat-tool.whatsapp-link .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #111b21;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9999;
}

.statmat-tool.whatsapp-link .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Global override for mobile scrolling on long results */
.statmat-tool [class*="result"], 
.statmat-tool [class*="output"],
.statmat-tool [class*="preview"],
.statmat-tool [class*="display"] {
  overflow-x: auto;
  max-width: 100%;
}

/* Global safeguard: ensure main wrapper never exceeds mobile viewport */
.statmat-tool {
  width: 100% !important;
  box-sizing: border-box;
}
