/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Reset dan Pengaturan Dasar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f4ff;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
    border: 2px solid #e0e8ff;
}

.robot-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    color: #6a82fb;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

h1 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #4a4a68;
}

.password-display-container {
    position: relative;
    background-color: #f0f4ff;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: flex-start; /* <<< PERBAIKAN DI SINI */
    word-break: break-all;
}

.password-display {
    font-size: 20px;
    font-weight: 600;
    color: #6a82fb;
    flex-grow: 1;
    text-align: left;
    padding-right: 10px; /* Memberi sedikit jarak dari tombol copy */
}

.copy-button {
    background-color: #6a82fb;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0; /* Mencegah tombol menyusut */
}

.copy-button:hover {
    background-color: #5568d7;
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button.copied {
    background-color: #4caf50;
}

/* Indikator Kekuatan Password */
.strength-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 25px;
    height: 20px;
}

.strength-bar-track {
    flex-grow: 1;
    height: 10px;
    background-color: #e0e8ff;
    border-radius: 5px;
    overflow: hidden;
}

.strength-bar-indicator {
    height: 100%;
    width: 0;
    border-radius: 5px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-bar-indicator.weak {
    width: 33%;
    background-color: #ff7b7b;
}

.strength-bar-indicator.medium {
    width: 66%;
    background-color: #ffde7b;
}

.strength-bar-indicator.strong {
    width: 100%;
    background-color: #7bff8a;
}

#strength-text {
    font-size: 14px;
    font-weight: 500;
    width: 60px;
    text-align: right;
    color: #4a4a68;
}

/* Pengaturan */
.setting {
    margin-bottom: 20px;
    text-align: left;
}

.setting label {
    font-weight: 500;
    font-size: 16px;
    color: #4a4a68;
    display: block;
    margin-bottom: 10px;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: #e0e8ff;
    border-radius: 5px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #6a82fb;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 5px rgba(106, 130, 251, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #6a82fb;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 5px rgba(106, 130, 251, 0.5);
    cursor: pointer;
}

#length-value {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    background-color: #6a82fb;
    min-width: 40px;
    text-align: center;
    padding: 5px;
    border-radius: 8px;
}

.options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option {
    display: flex;
    align-items: center;
    background-color: #f0f4ff;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option:hover {
    background-color: #e0e8ff;
}

.option input[type="checkbox"] {
    display: none;
}

.option label {
    margin-bottom: 0;
    padding-left: 30px;
    position: relative;
    cursor: pointer;
}

.option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #6a82fb;
    border-radius: 5px;
    background-color: white;
    transition: all 0.3s;
}

.option label::after {
    content: '✔';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-size: 16px;
    color: white;
    transition: all 0.3s ease-in-out;
}

.option input[type="checkbox"]:checked + label::before {
    background-color: #6a82fb;
    border-color: #6a82fb;
}

.option input[type="checkbox"]:checked + label::after {
    transform: translateY(-50%) scale(1);
}

.generate-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background-color: #ff7aa2;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 122, 162, 0.4);
}

.generate-btn:hover {
    background-color: #f76391;
}

.generate-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(255, 122, 162, 0.4);
}