@import url("https://fonts.googleapis.com/css2?family=Anton&family=Outfit:wght@100..900&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

:root {
  --light-background: #ffffff;
  --light-card-color: #f5f5f5;
  --light-text-color: #1f2937;
  --light-border-color: #e5e7eb;
  --light-box-shadow: inset 0 0 0 0.4px #0000001a;

  --dark-background: #121212;
  --dark-primary-text: #e0e0e0;
  --dark-secondary-text: #b0b0b0;
  --dark-border-color: #444444;
  --dark-accent-color: #888888;
  --dark-card-color: #292929;
  --dark-text-color: #f3f4f6;
  --dark-box-shadow: 0 0 0 0.4px #ffffff4d;

  --light-password-capital-color: #0ae448;
  --light-password-small-color: rgb(250 82 142);
  --light-password-number-color: rgb(255 218 0);
  --light-password-symbol-color: black;

  --dark-password-capital-color: #60a5fa;
  --dark-password-small-color: #34d399;
  --dark-password-number-color: #fdba74;
  --dark-password-symbol-color: #f472b6;
}

.opacity-down {
  cursor: default !important;
  opacity: 40%;
}

body {
  width: 100%;
  height: 100vh;
  background-color: var(--light-background);
}

.navbar {
  width: 100%;
  box-shadow: var(--light-box-shadow);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 0;
}

.container nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logobox a {
  text-decoration: none;
}

.logobox span {
  font-size: 32px;
  text-transform: uppercase;
  font-family: "Anton", sans-serif;
  color: #000000;
}

.links-box ul {
  display: flex;
  align-items: center;
  font-size: 16px;
  list-style: none;
  gap: 30px;
}

.links-box ul li a {
  text-decoration: none;
  color: var(--light-text-color);
}

.mode-change {
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background-color: var(--dark-background);
  color: #fff;
  border-radius: 200px;
  cursor: pointer;
}

.mode-change-indicator {
  display: block;
  padding-left: 0.4rem;
}

.mode-change .mode-btn {
  border-radius: 50%;
  outline: none;
  border: none;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  background-color: #fff;
}

.mode-btn span {
  font-size: 18px;
}

.main-section {
  margin: 0 auto;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 700px 500px;
  gap: 8px;
}

.wrapper {
  width: 100%;
  border-right: 1px solid var(--light-border-color);
}

.wrapper-inside {
  transition: all 0.3s;
  padding: 40px 40px;
}

.capital-letter {
  color: var(--light-password-capital-color);
}

.small-letter {
  color: var(--light-password-small-color);
}

.password-number {
  color: var(--light-password-number-color);
}

.password-symbols {
  color: var(--light-password-symbol-color);
}

.small-letter,
.capital-letter,
.password-number,
.password-symbols {
  white-space: nowrap;
}

.password-fields {
  width: 100%;
  display: grid;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.pass-display-input {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  word-break: keep-all;
  white-space: normal;
  width: 100%;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 10px 10px;
  border: 2px solid var(--light-border-color);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.pass-display-input:active {
  border: 2px solid var(--dark-password-capital-color);
}

.pass-generate-btn {
  padding: 4px 10px;
  border-radius: 100px;
  background-color: var(--dark-background);
  border: none;
  outline: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;

  position: absolute;
  bottom: -50px;
  right: 0;
}

.pass-generate-btn span {
  font-size: 14px;
}

.custom-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  width: 100%;
  font-size: 16px;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

.custom-label input {
  accent-color: black;
  transform: scale(1.3);
}

.range-label-grp {
  display: block;
  width: 100%;
  padding: 10px 0;
}

.range-length {
  font-size: 14px;
  margin: 10px 0;
  margin-bottom: 25px;
}

.range-length label {
  font-size: inherit;
}

.display-range {
  width: 25px;
  font-size: 16px;
  display: inline-block;
}

#new-pass-gen {
  width: 100%;
  margin-top: 30px;
  border: none;
  padding: 12px 18px;
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  border-radius: 10px;
  transition: all 0.3s;
  background-color: var(--dark-background);
}

#new-pass-gen:hover {
  background-color: #272727;
}

#range {
  width: 100%;
  accent-color: var(--dark-background);
}

.form-wrapper {
  margin: 10px 0;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
}

/* PASSWORD HISTORY */
.password-history {
  width: 100%;
}

.password-container {
  width: 100%;
  padding: 40px;
}

.password-history-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.password-history h2 {
  color: #000000;
  font-size: 26px;
  font-weight: 500;
}

.password-list-box {
  display: flex;
  overflow-x: hidden;
  flex-flow: column wrap;
}

.password-list {
  width: 100%;
  cursor: pointer;
  font-size: 18px;
  padding: 15px 10px;
  border-bottom: 1px solid black;
  transition: all 0.3s;
  position: relative;
  color: #979797;
}

.password-list span {
  word-break: keep-all;
  white-space: normal;
  word-wrap: break-word;
}

.password-list:hover {
  background-color: #ececec;
  color: #000000;
}

.password-list:hover .password-edit-options {
  display: inline-flex;
}

.password-edit-options {
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  padding: inherit;
  align-items: center;
  gap: 10px;
}

.password-copy-btn,
.password-delete-btn {
  padding: 4px 12px;
  color: #fff;
  gap: 4px;
  outline: none;
  border: none;
  border-radius: 200px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: black;
}

.password-copy-btn span,
.password-delete-btn span {
  font-size: 14px;
}

.password-delete-btn {
  background-color: red;
}

.clear-history-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
  gap: 6px;
  cursor: pointer;
  outline: none;
  border: none;
  background-color: #000000;
  color: #fff;
}

.clear-history-btn span {
  font-size: 18px;
}

.hidden {
  display: none;
}

/* DARK MODE */
body.dark-theme {
  background-color: var(--dark-background);
  color: var(--dark-primary-text);
}

body.dark-theme .wrapper {
  border-color: var(--dark-border-color);
}

body.dark-theme .password-history-info h2 {
  color: var(--dark-primary-text);
}

body.dark-theme .pass-generate-btn,
body.dark-theme #new-pass-gen,
body.dark-theme .clear-history-btn,
body.dark-theme .password-copy-btn {
  background-color: var(--dark-accent-color);
  color: var(--dark-text-color);
}

body.dark-theme .password-list:hover {
  background-color: #333;
  color: #fff;
}

body.dark-theme .links-box ul li a {
  color: var(--dark-secondary-text);
}

body.dark-theme .logobox span,
body.dark-theme .password-symbols {
  color: #ffffff;
}

body.dark-theme #range,
body.dark-theme .custom-label input {
  accent-color: white;
}
body.dark-theme .navbar {
  border-color: var(--dark-border-color);
  box-shadow: var(--dark-box-shadow);
}

body.dark-theme .password-list {
  color: var(--dark-secondary-text);
  border-color: var(--dark-border-color);
}

body.dark-theme #new-pass-gen,
body.dark-theme .pass-generate-btn,
body.dark-theme .clear-history-btn,
body.dark-theme .password-copy-btn {
  background-color: white;
  color: black !important;
}

body.dark-theme .mode-change {
  background-color: var(--dark-card-color);
}

.hidden {
  display: none !important;
}

body {
  transition: background-color 0.4s ease, color 0.4s ease;
}

.mode-change-indicator,
.mode-btn {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  position: absolute; /* keeps layout clean */
}

@media screen and (max-width: 1240px) {
  .main-section {
    max-width: 100%;
    grid-template-columns: 1fr 450px;
  }

  .container {
    padding: 8px 40px;
  }

  .password-item {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    font-family: monospace;
    cursor: default;
  }

  .password-list span {
    display: inline-block;
    max-width: 70vw; /* or use % if inside flex/grid */
    overflow: hidden;
    text-overflow: ellipsis;
    /* white-space: nowrap; */
  }
}

@media screen and (max-width: 938px) {
  .main-section {
    max-width: 100%;
    grid-template-columns: 1fr 400px;
  }
}

@media screen and (max-width: 788px) {
  .main-section {
    grid-template-columns: 1fr 350px;
  }

  .wrapper-inside,
  .password-container {
    padding: 40px 20px;
  }
  .container {
    padding: 8px 20px;
  }
}
@media screen and (max-width: 694px) {
  .main-section {
    grid-template-columns: 1fr 250px;
  }

  .clear-history-btn {
    padding: 0.4rem;
    font-size: 0.8rem;
    border-radius: 0.4rem;
  }

  .clear-history-btn span {
    font-size: 1rem;
  }

  .password-container h2 {
    font-size: 1.3rem;
  }

  .custom-label {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 611px) {
  .main-section {
    grid-template-columns: 1fr;
  }

  .clear-history-btn {
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 0.4rem;
  }

  .clear-history-btn span {
    font-size: 1.2rem;
  }

  .password-container h2 {
    font-size: 1.5rem;
  }

  .custom-label {
    font-size: 1.2rem;
  }

  .password-container {
    width: 100%;
  }
}
