:root {
    --bg-color: #0d1117;
    --container-bg: rgba(22, 27, 34, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #3182ce;
    --success: #2ea043;
    --warning: #d29922;
    --danger: #f85149;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(46, 160, 67, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    /* For extension popup */
    min-width: 360px;
}

.container {
    width: 100%;
    max-width: 420px;
    background: var(--container-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #58a6ff, #9f65ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

header h1 i {
    -webkit-text-fill-color: #58a6ff;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.output-container {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
}

#password-output {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: 1rem 3.5rem 1rem 1rem;
    border-radius: 12px;
    outline: none;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

#password-output:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

#copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#copy-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

#copy-btn.copied {
    color: var(--success);
}

.strength-meter {
    margin-bottom: 1.5rem;
}

.strength-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
}

.strength-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-bar[data-strength="0"]::before { width: 0%; }
.strength-bar[data-strength="1"]::before { width: 25%; background-color: var(--danger); box-shadow: 0 0 10px var(--danger); }
.strength-bar[data-strength="2"]::before { width: 50%; background-color: var(--warning); box-shadow: 0 0 10px var(--warning); }
.strength-bar[data-strength="3"]::before { width: 75%; background-color: #a371f7; box-shadow: 0 0 10px #a371f7; }
.strength-bar[data-strength="4"]::before { width: 100%; background-color: var(--success); box-shadow: 0 0 10px var(--success); }

.strength-text {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.length-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.length-header label {
    font-weight: 500;
}

#length-val {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin-bottom: 1.5rem;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
    transition: transform 0.1s;
}

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

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Switch Styles */
.toggle-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .slider {
    background-color: var(--accent);
}

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

.generate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #58a6ff, #9f65ef);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

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

.generate-btn i {
    transition: transform 0.5s ease;
}

.generate-btn:hover i {
    transform: rotate(180deg);
}
