/**
 * Gerador de Senhas - Estilos
 */

/* Password display */
.password-display {
  position: relative;
  background: var(--gray-900);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.password-text {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 1.5rem;
  color: #10b981;
  word-break: break-all;
  text-align: center;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.password-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.password-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.password-action-btn.copied {
  background: #10b981;
}

/* Strength indicator */
.strength-indicator {
  margin-bottom: 1.5rem;
}

.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 0.5rem;
}

.strength-segment {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  transition: background 0.3s;
}

.strength-segment.active.weak {
  background: #ef4444;
}

.strength-segment.active.fair {
  background: #f59e0b;
}

.strength-segment.active.good {
  background: #10b981;
}

.strength-segment.active.strong {
  background: #059669;
}

.strength-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.strength-text {
  font-weight: 500;
}

.strength-text.weak {
  color: #ef4444;
}
.strength-text.fair {
  color: #f59e0b;
}
.strength-text.good {
  color: #10b981;
}
.strength-text.strong {
  color: #059669;
}

.strength-time {
  color: var(--gray-500);
}

/* Options */
.password-options {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.option-row:last-child {
  border-bottom: none;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--gray-700);
}

.option-label svg {
  color: var(--gray-400);
}

/* Length slider */
.length-control {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.length-slider {
  width: 150px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
}

.length-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.length-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.length-value {
  min-width: 3rem;
  padding: 0.375rem 0.75rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Generate button */
.generate-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* History */
.password-history {
  margin-top: 1.5rem;
}

.history-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 0.875rem;
}

.history-item-password {
  word-break: break-all;
  flex: 1;
}

.history-item-btn {
  padding: 0.375rem;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.history-item-btn:hover {
  color: var(--primary);
  background: var(--gray-100);
}

/* Responsive */
@media (max-width: 640px) {
  .password-text {
    font-size: 1.125rem;
  }

  .length-control {
    flex-wrap: wrap;
  }

  .length-slider {
    width: 100%;
    order: 1;
  }

  .option-row {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}
