* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #1a1a2e;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    padding: 20px;
}

.container {
    background: #16213e;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.4);
    text-align: center;
    width: 100%;
    max-width: 520px;
}

header {
    margin-bottom: 20px;
}

h1 {
    font-size: 22px;
    margin-bottom: 6px;
    font-weight: 600;
}

h1 i {
    color: #00adb5;
    margin-right: 6px;
}

header p {
    font-size: 13px;
    color: #8892b0;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #0f3460;
    border-radius: 8px;
    padding: 4px;
}

.mode-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #8892b0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.mode-tab:hover {
    color: #fff;
}

.mode-tab.active {
    background: #00adb5;
    color: #fff;
}

/* Mode Panels */
.mode-panel {
    display: none;
    text-align: left;
    margin-bottom: 16px;
}

.mode-panel.active {
    display: block;
}

/* Sub-tabs (Advanced mode) */
.sub-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sub-tab {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #0f3460;
    background: transparent;
    color: #8892b0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    min-width: 70px;
}

.sub-tab:hover {
    color: #fff;
    border-color: #00adb5;
}

.sub-tab.active {
    background: #0f3460;
    color: #00adb5;
    border-color: #00adb5;
}

/* Sub-panels */
.sub-panel {
    display: none;
}

.sub-panel.active {
    display: block;
}

/* Option Groups */
.option-group {
    margin-bottom: 14px;
}

.option-group > label {
    font-size: 13px;
    color: #ccd6f6;
    margin-bottom: 6px;
    font-weight: 500;
}

.option-group > label span:not(.hint) {
    color: #00adb5;
    font-weight: 600;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #0f3460;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00adb5;
    cursor: pointer;
    border: 2px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00adb5;
    cursor: pointer;
    border: 2px solid #fff;
}

/* Updated Toggle Label / Checkbox */
.toggle-label {
    display: flex;
    align-items: center; /* Ensures vertical centering */
    gap: 12px;
    font-size: 13px;
    color: #ccd6f6;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: #0f3460;
    border-radius: 10px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0; /* Prevents the slider from squishing */
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 14px; /* Slightly smaller for better padding */
    height: 14px;
    background: #8892b0;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #00adb5;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::after {
    left: 19px;
    background: #fff;
}

.toggle-text {
    line-height: 1.4;
    display: flex;
    flex-direction: column; /* Keeps hint text directly under main text */
}

.hint {
    font-size: 11px;
    color: #8892b0;
    font-style: italic;
}

/* Charset Toggles */
.charset-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Preset Buttons */
.preset-buttons {
    margin-bottom: 14px;
}

.preset-buttons label {
    display: block;
    font-size: 13px;
    color: #ccd6f6;
    margin-bottom: 8px;
    font-weight: 500;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.preset-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #0f3460;
    background: transparent;
    color: #8892b0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.preset-btn:hover {
    border-color: #00adb5;
    color: #fff;
}

.preset-btn.active {
    background: #00adb5;
    color: #fff;
    border-color: #00adb5;
}

/* Select Dropdown */
select {
    width: 100%;
    padding: 8px 12px;
    background: #0f3460;
    color: #fff;
    border: 1px solid #0f3460;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    cursor: pointer;
}

select:focus {
    border-color: #00adb5;
}

/* Output Area */
.output-area {
    margin-bottom: 4px;
}

.password-box {
    display: flex;
    align-items: center;
    background: #0f3460;
    padding: 10px 14px;
    border-radius: 8px;
}

.password-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    padding: 4px 0;
    outline: none;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    width: 100%;
}

.password-box input::placeholder {
    color: #8892b0;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    letter-spacing: normal;
}

/* Entropy Badge */
.entropy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.entropy-badge i {
    font-size: 11px;
}

.entropy-low {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.entropy-medium {
    background: rgba(255, 183, 77, 0.2);
    color: #ffb74d;
}

.entropy-good {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.entropy-excellent {
    background: rgba(0, 173, 181, 0.2);
    color: #00adb5;
}

/* Buttons */
.generate-btn, .copy-btn {
    border: none;
    padding: 12px;
    width: 100%;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.generate-btn {
    background: #00adb5;
}

.generate-btn:hover {
    background: #00959c;
    transform: translateY(-1px);
}

.generate-btn:active {
    transform: translateY(0);
}

.copy-btn {
    background: #e94560;
    display: none;
}

.copy-btn:hover {
    background: #d63851;
}

.copy-btn.copied {
    background: #00c853;
}

.auto-clear-hint {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 4px;
}

/* Security Notice */
.security-notice {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(0, 173, 181, 0.1);
    border: 1px solid rgba(0, 173, 181, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #8892b0;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.security-notice i {
    color: #00adb5;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Footer */
footer {
    margin-top: 20px;
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #8892b0;
}

.author a {
    color: #00adb5;
    text-decoration: none;
    font-weight: 600;
}

.author a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 18px;
    }

    .sub-tabs {
        gap: 4px;
    }

    .sub-tab {
        font-size: 11px;
        padding: 6px 8px;
    }

    .password-box input {
        font-size: 13px;
    }

    .generate-btn, .copy-btn {
        font-size: 14px;
        padding: 10px;
    }

    .preset-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}
