/* Japanese Font Generator Styles */
.statmat-tool.japanese-font {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  color: #334155;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.statmat-tool.japanese-font * {
  box-sizing: border-box;
}

.statmat-tool.japanese-font .jf-header {
  background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
  color: #fff;
  padding: 30px 24px;
  text-align: center;
}

.statmat-tool.japanese-font .jf-icon {
  font-size: 40px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.statmat-tool.japanese-font .jf-header h2 {
  margin: 0 0 8px 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.statmat-tool.japanese-font .jf-header p {
  margin: 0;
  font-size: 16px;
  color: #fecdd3;
}

.statmat-tool.japanese-font .jf-container {
  padding: 0;
  background-color: #f8fafc;
}

/* Tabs */
.statmat-tool.japanese-font .jf-tabs {
  display: flex;
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.statmat-tool.japanese-font .tab-btn {
  flex: 1;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.statmat-tool.japanese-font .tab-btn:hover {
  color: #e11d48;
  background-color: #fff;
}

.statmat-tool.japanese-font .tab-btn.active {
  color: #be123c;
  border-bottom-color: #be123c;
  background-color: #fff;
}

.statmat-tool.japanese-font .tab-content {
  display: none;
  padding: 30px;
}

.statmat-tool.japanese-font .tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Inputs */
.statmat-tool.japanese-font .input-section {
  background-color: #fff;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.statmat-tool.japanese-font label {
  display: block;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
  font-size: 14px;
}

.statmat-tool.japanese-font textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-size: 18px;
  color: #1e293b;
  transition: all 0.2s;
  resize: vertical;
  font-family: inherit;
}

.statmat-tool.japanese-font textarea:focus {
  outline: none;
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

.statmat-tool.japanese-font .mt-3 {
  margin-top: 16px;
}

.statmat-tool.japanese-font .input-actions {
  display: flex;
  justify-content: flex-end;
}

.statmat-tool.japanese-font .btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.statmat-tool.japanese-font .btn-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.statmat-tool.japanese-font .btn-secondary:hover {
  background-color: #e2e8f0;
}

.statmat-tool.japanese-font .btn-primary {
  background-color: #be123c;
  color: white;
}

.statmat-tool.japanese-font .btn-primary:hover {
  background-color: #9f1239;
}

/* Results */
.statmat-tool.japanese-font .results-section {
  background-color: #fff;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.statmat-tool.japanese-font .results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.statmat-tool.japanese-font .results-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1e293b;
}

.statmat-tool.japanese-font .result-box {
  padding: 24px;
  font-size: 26px;
  color: #0f172a;
  background-color: #fff1f2;
  border: 1px dashed #fda4af;
  border-radius: 6px;
  text-align: center;
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.statmat-tool.japanese-font .helper-text {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* Toast */
.statmat-tool.japanese-font .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #9f1239;
  color: white;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9999;
}

.statmat-tool.japanese-font .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;
}
