/* 비밀번호 생성기 - 도구 고유 스타일 */

/* 비밀번호 표시 영역 */
.password-display {
  position: relative;
  margin-bottom: 1.5rem;
}

.password-output {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  word-break: break-all;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  line-height: 1.4;
  transition: border-color 0.2s;
  user-select: all;
  cursor: text;
  overflow-wrap: break-word;
}

.password-output:focus-within {
  border-color: var(--primary);
}

.btn-copy {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.2rem;
  transition: color 0.2s, background 0.2s;
}

.btn-copy:hover {
  color: var(--primary);
  background: var(--bg);
}

/* 강도 미터 */
.strength-meter {
  margin-bottom: 1.5rem;
}

.strength-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.strength-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}

.strength-bar[data-level="weak"] {
  width: 25%;
  background: var(--error);
}

.strength-bar[data-level="fair"] {
  width: 50%;
  background: var(--warning);
}

.strength-bar[data-level="good"] {
  width: 75%;
  background: #4CAF50;
}

.strength-bar[data-level="strong"] {
  width: 100%;
  background: var(--success);
}

.strength-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub);
}

/* 옵션 패널 */
.options-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.option-row + .option-row {
  border-top: 1px solid var(--border);
}

.option-row label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 길이 슬라이더 */
.length-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 280px;
}

.length-control input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.length-control input[type="number"] {
  width: 60px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  font-family: inherit;
}

.length-control input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}

/* 체크박스 스타일 */
.option-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 커스텀 기호 입력 */
.symbols-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  transition: border-color 0.2s;
}

.symbols-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 버튼 영역 */
.btn-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-generate {
  flex: 1;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-generate:hover {
  background: var(--primary-hover);
}

.btn-multi {
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-multi:hover {
  border-color: var(--primary);
  background: var(--bg);
}

/* 다중 비밀번호 결과 */
.multi-result {
  margin-bottom: 1.5rem;
}

.multi-result[hidden] {
  display: none;
}

.multi-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.multi-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  word-break: break-all;
  line-height: 1.4;
}

.multi-item-pw {
  flex: 1;
  user-select: all;
  cursor: text;
}

.multi-item .btn-copy-sm {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 6px;
  font-size: 1rem;
  transition: color 0.2s, background 0.2s;
}

.multi-item .btn-copy-sm:hover {
  color: var(--primary);
  background: var(--bg);
}

/* 히스토리 */
.history-section {
  margin-top: 0.5rem;
}

.history-section[hidden] {
  display: none;
}

.history-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-clear-history {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.2s;
}

.btn-clear-history:hover {
  color: var(--error);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--text-sub);
  word-break: break-all;
  line-height: 1.3;
}

.history-item-pw {
  flex: 1;
  user-select: all;
  cursor: text;
}

.history-item .btn-copy-sm {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.history-item .btn-copy-sm:hover {
  color: var(--primary);
}

/* 반응형 */
@media (max-width: 480px) {
  .password-output {
    font-size: 1rem;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
  }

  .option-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .length-control {
    max-width: 100%;
    width: 100%;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-multi {
    width: 100%;
  }

  .multi-item {
    font-size: 0.8rem;
  }
}
