* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(to bottom right, #0f172a, #581c87, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 42rem;
}

.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(16px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: rgba(147, 51, 234, 0.2);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.icon {
    color: #c084fc;
}

h1 {
    font-size: 2.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #94a3b8;
}

/* Password Display */
.password-section {
    margin-bottom: 1.5rem;
}

.password-display-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.password-display {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1.125rem;
    font-family: 'Courier New', monospace;
    color: white;
    overflow-x: auto;
    white-space: nowrap;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

.password-display::-webkit-scrollbar {
    height: 6px;
}

.password-display::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 3px;
}

.password-display::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.text-muted {
    color: #94a3b8;
}

.char-uppercase {
    color: white;
}

.char-lowercase {
    color: white;
}

.char-number {
    color: #60a5fa;
}

.char-special {
    color: #f87171;
}

.copy-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #94a3b8;
}

.copy-button:hover {
    background: #334155;
}

.icon-copy,
.icon-check {
    display: block;
}

.icon-check {
    color: #4ade80;
}

.hidden {
    display: none !important;
}

/* Strength Meter */
.strength-section {
    margin-top: 0.75rem;
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.strength-label {
    font-size: 0.875rem;
    color: #94a3b8;
}

.strength-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.strength-text.weak {
    color: #ef4444;
}

.strength-text.medium {
    color: #eab308;
}

.strength-text.strong {
    color: #22c55e;
}

.strength-bar-bg {
    height: 0.5rem;
    background: #334155;
    border-radius: 9999px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
    width: 0%;
}

.strength-bar.weak {
    background-color: #ef4444;
}

.strength-bar.medium {
    background-color: #eab308;
}

.strength-bar.strong {
    background-color: #22c55e;
}

.entropy-section {
    margin-top: 0.5rem;
    text-align: center;
}

.entropy-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.entropy-value {
    color: #c084fc;
    font-weight: 600;
}

/* Length Slider */
.length-section {
    margin-bottom: 1.5rem;
}

.length-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.label-text {
    color: white;
    font-weight: 500;
}

.length-value {
    color: #c084fc;
    font-weight: bold;
    font-size: 1.125rem;
}

.slider {
    width: 100%;
    height: 0.5rem;
    background: #334155;
    border-radius: 0.5rem;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: #9333ea;
    border-radius: 50%;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background: #9333ea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Options */
.options-section {
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 0.75rem;
}

.option-item:hover {
    background: rgba(15, 23, 42, 0.5);
}

.option-text {
    color: white;
}

.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #9333ea;
}

.custom-chars-section {
    padding-left: 0.75rem;
    margin-top: 0.5rem;
}

.custom-chars-label {
    display: block;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.custom-chars-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: white;
    font-family: 'Courier New', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.custom-chars-input:focus {
    border-color: #9333ea;
}

/* Buttons */
.buttons-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.button-primary {
    flex: 1;
    background: #9333ea;
    color: white;
}

.button-primary:hover {
    background: #7e22ce;
}

.button-secondary {
    background: #334155;
    color: white;
}

.button-secondary:hover {
    background: #475569;
}

.button-icon {
    flex-shrink: 0;
}

/* Info Box */
.info-box {
    padding: 1rem;
    background: rgba(88, 28, 135, 0.2);
    border: 1px solid rgba(126, 34, 206, 0.3);
    border-radius: 0.5rem;
}

.info-box p {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* Responsive */
@media (min-width: 640px) {
    .card {
        padding: 2.5rem;
    }

    .buttons-section {
        flex-direction: row;
    }

    .button-secondary {
        width: auto;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem;
    }

    .password-display {
        font-size: 1rem;
        padding-right: 2.5rem;
    }
}
