:root {
    --bg-color: #0B1120;
    --card-bg: #141B2D;
    --input-bg: #1F2937;
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #ffffff;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --slider-track: #374151;
    --slider-thumb: #e0e7ff;
    --toggle-inactive: #4b5563;
    --toggle-active: #6366f1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Password Display */
.password-display-container {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border-radius: 8px;
    padding: 5px;
}

#passwordDisplay {
    width: 100%;
    padding: 15px 50px 15px 15px;
    font-size: 1.1rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    outline: none;
}

#copyBtn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#copyBtn:hover {
    color: #818cf8;
    transform: scale(1.1);
}

/* Controls Container */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Length Slider */
.length-control {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.length-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#lengthValue {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--slider-track);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--slider-thumb);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Settings Section */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
}

.section-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.option-item span {
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-inactive);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--toggle-active);
    background-image: var(--primary-gradient);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--toggle-active);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Generate Button */
#generateBtn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#generateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#generateBtn:active {
    transform: translateY(1px);
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.3rem;
    }
}