/* Hashtag Generator Component Styles */

/* Tone Dropdown Enhancements */
.form-select option {
  padding: 8px 12px;
}

.form-select option[title] {
  position: relative;
}

/* Tone dropdown help text */
.tone-help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.text-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.text-actions .button {
  min-width: 120px;
}

.text-actions .form-help {
  flex-basis: 100%;
  text-align: right;
  margin-top: 4px;
  color: var(--text-secondary);
}

/* Usage info at top */
.usage-info-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.usage-emoji {
  font-size: 1.2rem;
  margin-right: 8px;
}

.usage-text {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 500;
}

.usage-count {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Trial mode specific styling */
.trial-mode .usage-info-top {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--background-secondary) 100%);
  border-color: var(--accent-color);
}

.trial-mode .usage-count {
  color: var(--accent-color);
}

/* Custom Select Dropdown */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select {
  position: relative;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.custom-select.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.custom-select:not(.disabled):hover .custom-select-trigger {
  border-color: var(--primary-color);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.custom-select-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.custom-select-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.custom-select.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--background-secondary);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background-color: var(--background-secondary);
}

.custom-select-option.selected {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.option-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
}

.option-description {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Error Toast Notifications */
.error-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--error-color);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 9999;
  max-width: 400px;
}

.error-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.shorten-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
}

.shorten-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9010;
}

.shorten-modal.hidden,
.shorten-modal-backdrop.hidden {
  display: none;
}

.shorten-modal__panel {
  background: var(--background-color);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  max-width: 420px;
  width: 100%;
  padding: 24px;
}

.shorten-modal__panel h3 {
  margin-bottom: 8px;
}

.shorten-modal__panel p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.shorten-modal__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.shorten-modal__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}

.shorten-modal__option .shorten-modal__limit {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shorten-modal__option[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.shorten-modal__cancel {
  align-self: flex-start;
}

/* Trial Mode Styles */
.trial-mode .badge-premium {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  color: var(--text-light);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: normal;
}

/* Trial Used Message */
.trial-used-message {
  text-align: center;
  padding: 40px 20px;
  background: var(--background-secondary);
  border-radius: 12px;
  margin-bottom: 30px;
}

.trial-used-message h3 {
  color: var(--text-color);
  margin-bottom: 10px;
}

.trial-used-message p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Trial CTA Section */
.trial-cta-section {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--background-secondary), var(--background-muted));
  border-radius: 12px;
  margin-top: 30px;
}

.trial-cta-section h3 {
  color: var(--text-color);
  margin-bottom: 10px;
}

.trial-cta-section p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Button Success State */
.button-success {
  background-color: var(--success-color) !important;
}

/* Step Indicators */
.steps-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  padding: 0 20px;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.step-indicator:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-secondary);
  z-index: -1;
}

.step-indicator.active,
.step-indicator.completed {
  opacity: 1;
}

.step-indicator.completed::after {
  background: var(--accent-color);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.step-indicator.active .step-number {
  background: var(--accent-color);
  color: var(--text-light);
  transform: scale(1.1);
}

.step-indicator.completed .step-number {
  background: var(--accent-color);
  color: var(--text-light);
}

.step-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 120px;
}

.step-indicator.active .step-text,
.step-indicator.completed .step-text {
  color: var(--text-color);
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .steps-container {
    padding: 0 10px;
  }
  
  .step-text {
    font-size: 0.75rem;
    max-width: 80px;
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
}

/* Disabled state for trial used */
.trial-used .generate-form {
  opacity: 0.6;
  pointer-events: none;
}

.trial-used .form-textarea:disabled,
.trial-used .form-select:disabled,
.trial-used .form-input:disabled {
  background-color: var(--background-muted);
  cursor: not-allowed;
}

/* Character count states */
.char-count-warning {
  color: var(--warning-color);
}

.char-count-over {
  color: var(--error-color);
}

.char-count-bold {
  font-weight: 600;
}

/* Usage count states */
.usage-count-low {
  color: var(--warning-color);
  font-weight: 600;
}

.usage-count-zero {
  color: var(--error-color);
  font-weight: 600;
}

/* Hashtag states */
.hashtag {
  background-color: var(--background-secondary);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  margin: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.hashtag:hover {
  background-color: var(--background-muted);
}

.hashtag.hashtag-selected {
  background-color: var(--accent-color);
  color: var(--text-light);
  border-color: var(--accent-dark);
}

.hashtag-copied {
  background-color: var(--success-color) !important;
  color: var(--text-light) !important;
}

/* Custom Tone UI Styles */
.tone-selection-wrapper {
  width: 100%;
}

.tone-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.tone-toggle .toggle-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-color);
  transition: color 0.2s ease;
}

.tone-toggle .toggle-option:hover {
  color: var(--primary-color);
}

.tone-toggle input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
}

.tone-toggle input[type="radio"]:checked + span {
  color: var(--primary-color);
  font-weight: 600;
}

.tone-section {
  transition: opacity 0.3s ease;
}

.custom-tone-input {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}

.custom-tone-input::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: pre-line;
}

/* Character count feedback for custom tone */
.custom-tone-input + .form-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.custom-tone-input + .form-help.char-count-warning {
  color: var(--warning-color);
}

.custom-tone-input + .form-help.char-count-over {
  color: var(--error-color);
  font-weight: 600;
}

/* Premium badge for custom tone feature */
.tone-selection-wrapper::before {
  content: "✨ Premium Feature";
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-color);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Error state for custom tone */
.custom-tone-input.error {
  border-color: var(--error-color);
  background-color: var(--error-light);
}

.custom-tone-input.error:focus {
  outline-color: var(--error-color);
  border-color: var(--error-color);
}

.form-error.custom-tone-error {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 8px 12px;
  background: var(--error-light);
  border-radius: 4px;
  border-left: 3px solid var(--error-color);
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .tone-toggle {
    flex-direction: column;
    gap: 12px;
  }
  
  .custom-tone-input {
    font-size: 0.9rem;
  }
}
