/* IG Username Generator Styles */
.statmat-tool.ig-username {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 650px;
  margin: 0 auto;
  color: #262626; /* IG default text color */
  border: 1px solid #dbdbdb;
  border-radius: 8px;
  background-color: #fafafa;
}

.statmat-tool.ig-username * {
  box-sizing: border-box;
}

.statmat-tool.ig-username .ig-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid #dbdbdb;
  background-color: #fff;
  border-radius: 8px 8px 0 0;
}

.statmat-tool.ig-username .ig-logo-gradient {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.statmat-tool.ig-username .ig-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.statmat-tool.ig-username .ig-container {
  padding: 24px;
  background-color: #fff;
}

.statmat-tool.ig-username .input-group {
  margin-bottom: 20px;
}

.statmat-tool.ig-username label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.statmat-tool.ig-username input[type="text"],
.statmat-tool.ig-username select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #dbdbdb;
  border-radius: 6px;
  font-size: 16px;
  background-color: #fafafa;
  transition: border-color 0.2s;
}

.statmat-tool.ig-username input[type="text"]:focus,
.statmat-tool.ig-username select:focus {
  outline: none;
  border-color: #a8a8a8;
}

.statmat-tool.ig-username .options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background-color: #fafafa;
  border: 1px solid #efefef;
  border-radius: 6px;
}

.statmat-tool.ig-username .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 0;
  color: #737373;
}

.statmat-tool.ig-username input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.statmat-tool.ig-username .btn {
  display: block;
  width: 100%;
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.statmat-tool.ig-username .btn-primary {
  background-color: #0095f6;
  color: #fff;
}

.statmat-tool.ig-username .btn-primary:hover {
  background-color: #1877f2;
}

.statmat-tool.ig-username .btn-primary:active {
  opacity: 0.7;
}

.statmat-tool.ig-username .result-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #efefef;
}

.statmat-tool.ig-username .result-section h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.statmat-tool.ig-username .subtitle {
  color: #8e8e8e;
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 16px;
}

.statmat-tool.ig-username .username-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.statmat-tool.ig-username .username-item {
  background-color: #fafafa;
  border: 1px solid #dbdbdb;
  padding: 12px 8px;
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statmat-tool.ig-username .username-item:hover {
  background-color: #f1f1f1;
  border-color: #a8a8a8;
}

.statmat-tool.ig-username .username-item:active {
  background-color: #efefef;
}

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

@media (max-width: 480px) {
  .statmat-tool.ig-username .username-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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