*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #2b6cb0;
  --primary-dark: #1e4e8c;
  --secondary: #4fd1c5;
  --dark: #2d3748;
  --light: #f7fafc;
  --success: #48bb78;
  --card-bg: #ffffff;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --input-bg: #edf2f7;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html,
body,
.wrapper {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--dark);
  line-height: 1.5;
}

.wrapper {
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  padding: 1rem 0 2rem;
}

header h1 {
  color: var(--light);
  margin: 0;
  font-weight: 700;
  font-size: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-body {
  padding: 1.5rem;
}

#password {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 1.25rem;
  padding: 1.5rem;
  text-align: center;
  background-color: var(--input-bg);
  border: none;
  border-radius: 0.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  min-height: 100px;
  resize: none;
  margin: 0;
}

#password:focus {
  outline: 2px solid var(--primary);
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.options-left {
  flex: 1;
  min-width: 250px;
}

.options-right {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.check-container {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.check-container input[type="checkbox"] {
  margin-right: 0.75rem;
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
}

.check-box-label {
  font-size: 1rem;
  color: var(--dark);
}

.slider-container {
  margin-top: 1.5rem;
}

.slider-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 0.5rem;
  background: #cbd5e0;
  border-radius: 0.25rem;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.textbox {
  width: 3.5rem;
  text-align: center;
  font-size: 1rem;
  padding: 0.35rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.25rem;
  background-color: var(--input-bg);
}

.buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  border: none;
  background-color: var(--primary);
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.btn:active {
  transform: translateY(1px);
}

.btn-copy {
  background-color: var(--secondary);
  color: var(--dark);
}

.btn-copy:hover {
  background-color: #36b9ae;
}

.btn-clear {
  background-color: #e53e3e;
}

.btn-clear:hover {
  background-color: #c53030;
}

button[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  background-color: #a0aec0;
}

/* History section */
.history-box {
  padding: 1.5rem;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-title {
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--dark);
}

.history-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  background-color: var(--input-bg);
  border-radius: 0.25rem;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
  .wrapper {
    padding: 1rem 0.5rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .card {
    border-radius: 0.5rem;
  }
  
  .card-body, .card-footer, .history-box {
    padding: 1rem;
  }
  
  .options-container {
    gap: 1rem;
  }
  
  .options-left, .options-right {
    min-width: 100%;
  }
  
  .buttons-container {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
  
  #password {
    font-size: 1rem;
    padding: 1rem;
  }
}