/* Cursive Font Generator Styles */
.statmat-tool.cursive-font {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  color: #4a4a4a;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

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

.statmat-tool.cursive-font .cf-header {
  background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
  color: #fff;
  padding: 32px 24px;
  text-align: center;
}

.statmat-tool.cursive-font .cf-icon {
  font-size: 38px;
  margin-bottom: 12px;
}

.statmat-tool.cursive-font .cf-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.statmat-tool.cursive-font .cf-header p {
  margin: 0;
  font-size: 16px;
  color: #fdf8e7;
}

.statmat-tool.cursive-font .cf-container {
  padding: 30px;
  background-color: #fcfbf9;
}

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

.statmat-tool.cursive-font label {
  display: block;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.statmat-tool.cursive-font textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 20px;
  color: #333;
  transition: all 0.2s;
  resize: vertical;
  font-family: inherit;
  font-style: italic;
}

.statmat-tool.cursive-font textarea:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.statmat-tool.cursive-font .input-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.statmat-tool.cursive-font .btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.statmat-tool.cursive-font .btn-secondary {
  background-color: #f5f5f5;
  color: #888;
}

.statmat-tool.cursive-font .btn-secondary:hover {
  background-color: #e0e0e0;
  color: #4a4a4a;
}

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

.statmat-tool.cursive-font .results-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f9f9f9;
}

.statmat-tool.cursive-font .results-header h3 {
  margin: 0;
  font-size: 18px;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.statmat-tool.cursive-font .font-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.statmat-tool.cursive-font .font-card {
  display: flex;
  flex-direction: column;
  background-color: #fdfcfb;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s;
}

.statmat-tool.cursive-font .font-card:hover {
  border-color: #d4af37;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.statmat-tool.cursive-font .font-label {
  background-color: #f9f9f9;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #f0f0f0;
}

.statmat-tool.cursive-font .font-output-row {
  display: flex;
}

.statmat-tool.cursive-font .font-output {
  flex: 1;
  padding: 16px 20px;
  font-size: 26px; /* Slightly larger for script */
  color: #222;
  word-break: break-all;
  white-space: pre-wrap;
  border-right: 1px solid #f0f0f0;
  line-height: 1.4;
}

.statmat-tool.cursive-font .copy-btn {
  width: 90px;
  background-color: #fff;
  border: none;
  color: #aa8c2c;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
}

.statmat-tool.cursive-font .copy-btn:hover {
  background-color: #d4af37;
  color: #fff;
}

.statmat-tool.cursive-font .copy-icon {
  font-size: 20px;
}

/* Toast */
.statmat-tool.cursive-font .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #4a4a4a;
  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.cursive-font .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .statmat-tool.cursive-font .font-output {
    font-size: 22px;
    padding: 12px 16px;
  }
  .statmat-tool.cursive-font .copy-btn {
    width: 70px;
  }
}

/* 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;
}
