/*
|--------------------------------------------------------------------------
| Text Repeater Tool Styles
|--------------------------------------------------------------------------
|
| These styles are specific to the Text Repeater tool page.
| They have been mapped to the global variables in /assets/css/style.css
|
*/

/* Mapping:
| var(--foreground)       -> var(--text)
| var(--muted-foreground) -> var(--text-light)
| var(--background)       -> var(--bg)
| var(--muted)            -> var(--bg-alt)
| (All other variables like --primary, --border, etc. already match)
*/

.text-repeater-header {
  text-align: center;
  margin-bottom: 20px;
}

/* Use --primary for the title */
.text-repeater-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

/* Use --text-light for subtitle */
.text-repeater-subtitle {
  color: var(--text-light);
  font-size: 1.0rem;
  margin-bottom: 15px;
  font-weight: 500;
}

/* Use --bg-alt and --border for sections */
.text-repeater-input-section,
.text-repeater-stats-section,
.text-repeater-repetition-section,
.text-repeater-templates-section,
.text-repeater-advanced-options,
.text-repeater-output,
.text-repeater-share-section,
.text-repeater-history,
.text-repeater-seo-content {
  margin-bottom: 18px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 15px;
  border: 1px solid var(--border);
}

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

/* Use --text for titles */
.text-repeater-templates-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* Use --primary for buttons */
.text-repeater-show-more-btn {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.text-repeater-show-more-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Use --bg and --border for containers */
.text-repeater-templates-container {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg);
}

.text-repeater-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

/* Use --bg-alt and --border for template buttons */
.text-repeater-template {
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-weight: 600;
  color: var(--text);
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
}

/* Use --primary for template hover */
.text-repeater-template:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px) scale(1.02);
  border-color: var(--primary);
}

.text-repeater-template-emoji {
  font-size: 0.95rem;
  margin-right: 5px;
}

.text-repeater-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* Use --text for labels */
.text-repeater-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.85rem;
}

/* Style inputs to match site theme */
.text-repeater-input,
.text-repeater-select,
.text-repeater-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

/* Style focus to match site theme */
.text-repeater-input:focus,
.text-repeater-select:focus,
.text-repeater-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(62, 132, 244, 0.2);
  background: var(--bg);
}

.text-repeater-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Courier New', monospace;
}

.text-repeater-stats {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Use --primary for stats badges */
.text-repeater-stat {
  background: var(--primary);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

.text-repeater-advanced-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.95rem;
}

.text-repeater-advanced-content { display: none; }
.text-repeater-advanced-content.active {
  display: block;
  animation: fadeInDown 0.3s ease-out;
}

.text-repeater-toggle-icon {
  margin-left: 8px;
  transition: transform 0.3s ease;
  color: var(--primary);
  font-weight: bold;
}

.text-repeater-toggle-icon.rotated { transform: rotate(180deg); }

.text-repeater-button-group {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Base button style */
.text-repeater-button {
  flex: 1;
  min-width: 110px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.text-repeater-button:hover { transform: translateY(-2px); }

/* Use --primary for primary button */
.text-repeater-button-primary {
  background: var(--primary);
  color: #ffffff;
}
.text-repeater-button-primary:hover {
  background: var(--primary-hover);
}

/* Use --secondary for secondary button */
.text-repeater-button-secondary {
  background: var(--secondary); /* Using site's secondary color */
  color: #ffffff;
}
.text-repeater-button-secondary:hover {
  background: var(--secondary-hover);
}

/* Example of a third color (can be --primary-hover) */
.text-repeater-button-success {
  background: var(--primary-hover);
  color: #ffffff;
}
 .text-repeater-button-success:hover {
  background: var(--primary);
}

.text-repeater-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.text-repeater-progress {
  margin: 18px 0;
  background: var(--border);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
}

.text-repeater-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  transition: width 0.3s ease;
  width: 0;
}

.text-repeater-progress-text {
  text-align: center;
  margin-top: 8px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

.text-repeater-output-header {
  padding: 15px 18px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.text-repeater-output-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.text-repeater-output-content {
  padding: 18px;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  word-wrap: break-word;
}

.text-repeater-output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-repeater-share-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  text-align: center;
  font-size: 0.95rem;
}

.text-repeater-share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.text-repeater-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.8rem;
  color: #ffffff;
}

.text-repeater-share-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* Social colors are fine as they are brand-specific */
.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }
.share-telegram { background: #0088cc; }
.share-linkedin { background: #0077b5; }
.share-reddit { background: #ff4500; }
.share-discord { background: #5865f2; }
.share-pinterest { background: #bd081c; }

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

.text-repeater-history-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.text-repeater-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.text-repeater-history-item:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateX(6px);
  border-color: var(--primary-hover);
}
.text-repeater-history-item:hover small {
    color: #ffffff !important;
}

/* Notification Toast (using --secondary) */
.text-repeater-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--secondary);
  color: white;
  border-radius: 8px;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.2);
  max-width: 250px;
}

.text-repeater-notification.show {
  transform: translateX(0);
}

/* Using --primary-hover for error for consistency */
.text-repeater-notification.error {
  background: var(--primary-hover);
}

/* SEO content uses global styles from .static-page-content */
.text-repeater-seo-content {
  font-size: 1rem;
  color: var(--text-light);
}
.text-repeater-seo-content h2,
.text-repeater-seo-content h3 {
  color: var(--text); /* Will be overridden by global .static-page-content h2 */
}
/* This ensures the global h2 styles from style.css apply */
.text-repeater-seo-content h2 {
    font-size: 1.5rem;
    color: var(--text);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}
.text-repeater-seo-content h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-top: 1.5rem;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar Styling */
.text-repeater-templates-container::-webkit-scrollbar {
  width: 6px;
}
.text-repeater-templates-container::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 8px;
}
.text-repeater-templates-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
}
.text-repeater-templates-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}
.text-repeater-output-content::-webkit-scrollbar {
  width: 6px;
}
.text-repeater-output-content::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 8px;
}
.text-repeater-output-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
}
.text-repeater-output-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .text-repeater-title {
    font-size: 2.0rem;
  }
  .text-repeater-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .text-repeater-button-group {
    flex-direction: column;
  }
  .text-repeater-button {
    min-width: auto;
  }
  .text-repeater-templates {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
  .text-repeater-output-header {
    flex-direction: column;
    gap: 12px;
  }
  .text-repeater-output-actions {
    width: 100%;
    justify-content: center;
  }
  .text-repeater-share-buttons {
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  }
  .text-repeater-stats {
    flex-direction: column;
    align-items: center;
  }
  .text-repeater-templates-container {
    max-height: 140px;
  }
}

@media (max-width: 480px) {
  .text-repeater-output-actions {
    flex-direction: column;
  }
  .text-repeater-templates {
    grid-template-columns: 1fr 1fr;
  }
  .text-repeater-share-buttons {
    grid-template-columns: 1fr 1fr;
  }
  .text-repeater-template {
    font-size: 0.7rem;
    padding: 6px 8px;
  }
  .text-repeater-notification {
    max-width: 200px;
    right: 15px;
    top: 15px;
  }
}