:root {
    --bg-gradient-start: #65dfc9;
    --bg-gradient-end: #6cdbeb;
    --container-bg: rgba(255, 255, 255, 0.5);
    --text-color: #333;
    --input-bg: rgba(255, 255, 255, 0.2);
    --input-border: rgba(255, 255, 255, 0.3);
    --footer-text: #eee;
}

[data-theme='dark'] {
    --bg-gradient-start: #2c3e50;
    --bg-gradient-end: #4ca1af;
    --container-bg: rgba(0, 0, 0, 0.5);
    --text-color: #eee;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.1);
    --footer-text: #ccc;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to right top, var(--bg-gradient-start), var(--bg-gradient-end));
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    transition: background 0.3s;
    overflow: hidden;
}

#stars-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}


.container {
    background-color: var(--container-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 400px;
    transition: background-color 0.3s;
    user-select: none;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

h1 {
    color: var(--text-color);
    font-size: 24px;
    text-align: center;
    margin: 0;
    transition: color 0.3s;
}

.password-container {
    display: flex;
    margin-bottom: 20px;
}

#password-display {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px 0 0 6px;
    font-size: 16px;
    outline: none;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: background-color 0.3s, border-color 0.3s;
    user-select: auto;
}

#copy-btn {
    padding: 10px 15px;
    border: none;
    background-color: #409eff;
    color: white;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 14px;
}

#copy-btn:hover {
    background-color: #66b1ff;
}

.options-container .option {
    margin-bottom: 20px;
}

.options-container label,
.options-container p, #length-value {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
    transition: color 0.3s;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.5);
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    background: #409eff;
    border-radius: 50%;
    margin-top: -5px;
}


.checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#generate-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #6777ef;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

#generate-btn:hover {
    background-color: #7c8cf1;
}

.strength-container {
    margin-top: 20px;
}

.strength-bar {
    background-color: rgba(255, 255, 255, 0.5);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

#strength-indicator {
    height: 100%;
    width: 0; /* Default to zero */
    background-color: transparent;
    transition: width 0.3s, background-color 0.3s;
}

#strength-text {
    font-size: 14px;
    color: var(--text-color);
    margin-top: 5px;
    display: block;
    transition: color 0.3s;
}

.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
    opacity: 0;
    transition: visibility 0s 0.5s, opacity 0.5s linear;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s linear;
}

#theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

#theme-toggle-btn .sun {
    display: block;
    color: var(--text-color);
}

#theme-toggle-btn .moon {
    display: none;
    color: var(--text-color);
}

[data-theme='dark'] #theme-toggle-btn .sun {
    display: none;
}

[data-theme='dark'] #theme-toggle-btn .moon {
    display: block;
}