html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #3b3b3b;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.5s ease, color 0.5s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    margin: 0 auto;
    color: white;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    max-width: 90%;
    width: 100%;
    box-sizing: border-box;
    padding: 1em;
}

.header {
    margin: 0.5em;
    font-size: 3.5em;
    margin-bottom: 1em;
    font-weight: bold;
}

.inputsContainer {
    padding: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.inputGroup {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 60em;
    height: 3em;
}

#inputsTextField {
    font-size: 1em;
    font-weight: 500;
    padding: 1em;
    width: 100%;
    border-style: solid;
    border-width: 2px;
    border-color: #007bff;
    border-radius: 0.6em;
    color: white;
    background-color: #3b3b3b;
    height: 100%;
}

#inputsTextField:focus {
    border-color: #0056b3;
    box-shadow: 0 0 8px rgba(0, 91, 179, 0.5);
    background-color: #333333;
}

#inputsTextField::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

*:focus {
    outline: none;
}

.sliderContainer {
    padding: 0.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    max-width: 60em;
    width: 100%;
    margin: 0 auto;
}

.sliderLabel {
    margin-bottom: 10px;
    align-self: flex-start;
    margin-left: 5px;
    font-size: large;
}

.sliderWithButton {
    display: flex;
    align-items: center;
    width: 100%;
}

.sliderWithButton input[type="range"] {
    flex-grow: 1;
    margin-right: 0.5em;
}

input[type="range"] {
    width: 100%;
}

.rangeLabels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 5px;
}

.rangeLabels .minValue,
.rangeLabels .maxValue {
    font-size: large;
    font-weight: bold;
    margin-right: 4rem;
}

.rangeLabels .maxValue {
    text-align: right;
}

#addButton {
    height: 100%;
    font-weight: bold;
    width: 100%;
    margin-left: 0.3em;
    max-width: 3em;
    border-radius: 0.6em;
    font-size: larger;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

#generatePassword {
    width: 100%;
    border-radius: 0.6em;
    height: 3em;
    font-weight: bold;
    max-width: 60em;
}

#passwordsContainer {
    padding: 1em;
    margin-top: 1em;
    max-width: 60em;
    margin: 0 auto;
}

.hidden {
    display: none;
}

.passwordContainer h1 {
    font-size: 2em;
    margin-bottom: 0.5em;
}

#tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5em;
    margin-bottom: 1em;
    max-width: 50em;
    margin: 0 auto;
}

#tags span {
    background-color: #007bff;
    color: white;
    padding: 0.5em 1em;
    border-radius: 0.7em;
    margin: 0.2em;
    font-size: 1em;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#tags span:hover {
    background-color: #0056b3;
}

#tags span:active {
    background-color: #004085;
}

.print-password-icon {
    margin-left: 10px;
    cursor: pointer;
    font-size: 1.2em;
    vertical-align: middle;
    color: white;
    transition: color 0.3s ease;
}

.print-password-icon:hover {
    color: #a0a0a0;
}

#strengthMeterContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    margin-top: 2em;
    max-width: 60em;
}

.strengthMeterWrapper {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background-color: #333;
    overflow: hidden;
    position: relative;
}

.strengthMeterBar {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background-image: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00);
    transition: width 0.5s ease;
}

#strengthText {
    margin-top: 0.5em;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    transition: color 0.5s ease;
}

.service-password {
    color: #66cc00;
    font-weight: bold;
}

#originalPasswordContainer {
    margin-bottom: 1.5em;
    text-align: center;
}

#originalPassword {
    font-size: 2em;
    background-color: #007bff;
    color: white;
    padding: 0.5em 1em;
    border-radius: 10px;
    display: inline-block;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.characterColor {
    color: #007bff;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake-animation {
    animation: shake 0.5s;
}

.tags-summary {
    padding: 1em;
    border-radius: 5px;
    margin: 1em auto;
    max-width: 60em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #2c2c2c;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#tagsSummaryWithInfo {
    display: flex;
    justify-content: center;
    align-items: center;
}

#tagsSummary {
    flex-grow: 1;
}

.tags-summary h3 {
    margin-bottom: 0.5em;
    font-size: 1.5em;
}

.tags-summary ul {
    list-style-type: none;
    padding: 0;
}

.tags-summary ul li {
    display: block;
    color: #4a4a4a;
}

.tags-summary ul li div {
    text-align: left;
}

.tags-summary ul li .used-part {
    font-weight: bold;
    color: white;
    opacity: 100%;
}

#strengthCriteriaContainer {
    width: 100%;
    max-width: 60em;
    margin: 1em auto 4em auto;
    padding: 1em;
    background-color: #2c2c2c;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.strength-criteria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    list-style: none;
    padding: 0;
    margin: 0;
}

.criteria-item {
    display: flex;
    background-color: #3b3b3b;
    padding: 0.8em 1em;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.criteria-item:hover {
    transform: translateY(-2px);
    background-color: #4a4a4a;
}

.criteria-item i {
    margin-right: 0.5em;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.criteria-item label {
    font-size: 1em;
    color: #ffffff;
    font-weight: bold;
    margin-top: 0.1em;
}

.criteria-item.met {
    background-color: #3b3b3b;
    border-left: 4px solid #66cc00;
}

.criteria-item.met i {
    color: #66cc00;
}

.criteria-item.unmet {
    background-color: #3b3b3b;
    border-left: 4px solid #ff4d4d;
}

.criteria-item.unmet i {
    color: #ff4d4d;
}

.checkboxesContainer {
    padding: 0.5em;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    max-width: 60em;
    width: 100%;
    margin: 0 auto;
    align-items: flex-start;
}

.special-char-info {
    margin-top: 1em;
    font-size: 1.2em;
}

.converted-char {
    font-weight: bolder;
    color: #ff5722;
}

.password-part {
    padding: 0.5em 1em;
    margin: 0.2em;
    border-radius: 0.5em;
    font-size: 1.2em;
    font-weight: bold;
}

.tag-part {
    background-color: #007bff;
    color: white;
}

.number-part {
    background-color: #28a745;
    color: white;
}

.info-section p {
    opacity: 60%;
}

.info-button-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1em;
}

.info-button-container .btn-secondary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1em;
    font-weight: bold;
    padding: 0;
    transition: background-color 0.3s ease;
}

.info-button-container .btn-secondary:hover {
    background-color: #0056b3;
}

#tooltip-text-interest,
#tooltip-text-characters-per-interest,
#tooltip-text-password-length,
#tooltip-text-service-name,
#tooltip-text-generated-passwords,
#tooltip-text-used-interests {
    visibility: hidden;
    width: 200px;
    background-color: #444;
    color: #fff;
    text-align: center;
    padding: 0.5em;
    border-radius: 0.4em;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#tooltip-text-interest::after,
#tooltip-text-characters-per-interest::after,
#tooltip-text-password-length::after,
#tooltip-text-service-name::after,
#tooltip-text-generated-passwords::after,
#tooltip-text-used-interests::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #444 transparent transparent transparent;
}

.info-button-container:hover #tooltip-text-interest,
.info-button-container:hover #tooltip-text-characters-per-interest,
.info-button-container:hover #tooltip-text-password-length,
.info-button-container:hover #tooltip-text-service-name,
.info-button-container:hover #tooltip-text-generated-passwords,
.info-button-container:hover #tooltip-text-used-interests {
    visibility: visible;
    opacity: 1;
}

.info-button-container .btn-secondary:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

.passwords-with-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
}

#passwords {
    flex-grow: 1;
    text-align: center;
    padding: 1em;
    border-radius: 5px;
    margin: 1em auto;
    max-width: 60em;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #2c2c2c;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.predefined-interests {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4em;
    max-width: 50vw;
}

.predefined-interests button {
    background-color: #28a745;
    color: white;
    padding: 0.5em 1em;
    border: none;
    border-radius: 0.7em;
    margin: 0.2em;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.predefined-interests button:hover {
    background-color: #218838;
}

.predefined-interests button:active {
    background-color: #1e7e34;
}

.special-button {
    background-color: #28a745;
    color: white;
    font-weight: bold;
}

.special-button:hover {
    background-color: #218838;
}

.special-button:active {
    background-color: #1e7e34;
}

.video-button {
    background-color: #007bff;
    color: white;
    padding: 0.7em 1.5em;
    border: none;
    border-radius: 0.6em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1em;
}

.video-button:hover {
    background-color: #0056b3;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    background-color: #3b3b3b;
    margin: 5% auto;
    padding: 1em;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    padding-top: 4rem;
}

.close-button {
    position: absolute;
    top: 0;
    right: 15px;
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
}

.close-button:hover,
.close-button:focus {
    color: #ccc;
    text-decoration: none;
}

#tutorialVideo {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.predefinedHeader {
    font-weight: bold;
    font-size: 200%
}

#interestsHeader {
    margin-top: 5rem;
}

/* Styles for the predefined colors buttons */
.predefined-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4em;
    max-width: 50vw;
}

.predefined-colors button {
    background-color: #c99700;
    /* Yellow color */
    padding: 0.5em 1em;
    color: white;
    border: none;
    border-radius: 0.7em;
    margin: 0.2em;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.predefined-colors button:hover {
    background-color: #ad8200;
}

.predefined-colors button:active {
    background-color: #c69500;
}

/* Special button styling if needed */
.predefined-colors .special-button {
    background-color: #c99700;
    font-weight: bold;
}

.predefined-colors .special-button:hover {
    background-color: #ad8200;
}

.predefined-colors .special-button:active {
    background-color: #c69500;
}

/* Styles for the predefined numbers buttons */
.predefined-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4em;
    max-width: 50vw;
}

.predefined-numbers button {
    background-color: #b700ff;
    /* Orange color */
    padding: 0.5em 1em;
    color: white;
    border: none;
    border-radius: 0.7em;
    margin: 0.2em;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.predefined-numbers button:hover {
    background-color: #8600bb;
}

.predefined-numbers button:active {
    background-color: #8600bb;
}

/* Special button styling if needed */
.predefined-numbers .special-button {
    background-color: #b700ff;
    font-weight: bold;
}

.predefined-numbers .special-button:hover {
    background-color: #8600bb;
}

.predefined-numbers .special-button:active {
    background-color: #8600bb;
}

/* Footer Styles */
footer {
    background-color: #2c2c2c;
    /* Dark background to contrast with the text */
    color: #ffffff;
    padding: 1em 0;
    /* Space around the content */
    width: 100%;
    text-align: center;
    /* Center the text */
    position: relative;
    /* Positioning context for any absolute elements */
    font-size: 0.9em;
    /* Slightly smaller font size */
}

#footerContent {
    display: flex;
    flex-wrap: wrap;
    /* Allow items to wrap on smaller screens */
    justify-content: center;
    /* Center items horizontally */
    align-items: center;
    /* Center items vertically */
    gap: 0.5em;
    /* Space between items */
}

#footerContent a {
    color: #007bff;
    /* Link color */
    text-decoration: none;
    /* Remove underline */
    font-weight: bold;
    opacity: 0.8;
    transition: color 0.3s ease, opacity 0.3s ease;
}

#footerContent a:hover {
    color: #0056b3;
    /* Darker blue on hover */
    opacity: 1;
}

#footerContent span {
    margin: 0 0.5em;
    /* Space between spans */
    opacity: 0.75;
}

#footerContent span:not(:last-child):after {
    content: "|";
    /* Separator between items */
    margin-left: 0.5em;
    color: #ffffff;
    opacity: 0.5;
}

#footerContent a:not(:last-child):after {
    content: "|";
    /* Separator after the link */
    margin-left: 0.5em;
    color: #ffffff;
    opacity: 0.5;
}

#minInterestsFeedback {
    color: red;
}

#language {
    position: absolute;
    right: 4rem;
    color: #fff;
}

#flag {
    width: 1.5rem;
    margin-right: 0.3rem
}
/* Mobile Styles */
@media (max-width: 768px) {
    .header {
        font-size: 2.5em;
        /* Smaller font size for the header */
        margin-bottom: 0.5em;
        /* Less margin */
    }

    #passwordsContainer,
    #originalPasswordContainer,
    #generatedPasswordsContainer,
    #passwords {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box;
      padding: 0.5em;
      margin: 0 auto;
    }
    
    /* Force long password strings to break */
    #originalPassword,
    #passwords {
      word-break: break-all;
    }
  
    /* Make the flex container stack vertically instead of using space-between */
    .passwords-with-info {
      flex-direction: column !important;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    
    /* In case any element is still causing horizontal overflow, hide it */
    html, body {
      overflow-x: hidden;
    }

    .inputsContainer {
        padding: 0.5em;
        /* Less padding */
    }

    .inputGroup {
        flex-direction: column;
        /* Stack elements vertically */
        align-items: stretch;
        /* Stretch elements to full width */
    }

    #inputsTextField {
        width: 100%;
        /* Full width */
        margin-bottom: 0.5em;
        /* Space between input and button */
    }

    #addButton {
        max-width: 100%;
        /* Full width */
        margin-left: 0;
        /* Remove left margin */
        margin-top: 0.5em;
        /* Space above the button */
    }

    .sliderContainer {
        padding: 0.5em;
        margin-top: 1em;
    }

    .sliderWithButton {
        flex-direction: column;
        /* Stack slider and button vertically */
    }

    .rangeLabels {
        align-items: flex-start;
        /* Align labels to the start */
    }

    .rangeLabels .minValue,
    .rangeLabels .maxValue {
        margin-right: 0;
    }

    .checkboxesContainer {
        padding: 0.5em;
    }

    #interestsHeader {
        display: none;
    }

    #generatePassword {
        width: 100%;
        /* Full width */
        margin-top: 0.5em;
        /* Space above the button */
    }

    #passwordsContainer {
        padding: 0.5em;
        /* Less padding */
    }

    .passwordContainer h1 {
        font-size: 1.5em;
        /* Smaller font size */
    }

    .passwords-with-info {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    #tags {
        margin-top: 2.5rem;
    }

    #tags span {
        font-size: 0.9em;
        padding: 0.4em 0.8em;
    }

    .strengthMeterWrapper {
        height: 15px;
        /* Smaller height */
    }

    #strengthText {
        font-size: 1em;
        /* Smaller font size */
    }

    .criteria-item {
        padding: 0.6em 0.8em;
        /* Smaller padding */
    }

    .criteria-item label {
        font-size: 0.9em;
        /* Smaller font size */
    }

    .modal-content {
        width: 95%;
        /* Slightly smaller width */
        margin: 10% auto;
        /* Adjust margin */
    }

    #openVideoButton {
        margin-bottom: 5rem;
    }

    #tutorialVideo {
        height: auto;
    }

    footer {
        font-size: 0.8em;
        /* Smaller font size */
    }

    #footerContent {
        flex-direction: column;
        /* Stack footer items vertically */
        gap: 0.3em;
        /* Less space between items */
    }

    #footerContent span:not(:last-child):after,
    #footerContent a:not(:last-child):after {
        content: "";
        /* Remove separators */
    }

    .info-button-container {
        margin-left: 0;
        margin-top: 0.5em;
        justify-content: center;
    }

    #generatedPasswordsContainer {
        width: 100%;
        padding: 0.5em;
        text-align: center;
    }

    #originalPassword {
        word-break: break-all;
    }

    #predefinedInterests,
    #predefinedColors,
    #predefinedNumbers {
        display: none;
    }

    #interestsHeader,
    #colorsHeader,
    #numbersHeader {
        display: none;
    }

    #passwordsContainer,
    #originalPasswordContainer,
    #generatedPasswordsContainer,
    #passwords {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    #minInterestsFeedback {
        margin-top: 2.5rem;
    }
}