/* CSS Variables for Light/Dark Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #d32f2f;
    --accent-hover: #b71c1c;
    --shadow: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --accent-color: #ef5350;
    --accent-hover: #f44336;
    --shadow: rgba(0, 0, 0, 0.3);
    --input-bg: #2d2d2d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px var(--shadow);
    transition: background 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
}

.moon-icon {
    opacity: 0;
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
}

.password-display {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

#passwordOutput {
    flex: 1;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#passwordOutput:focus {
    outline: none;
    border-color: var(--accent-color);
}

.copy-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    width: 56px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.copy-btn:hover svg {
    stroke: white;
}

.copy-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
    transition: stroke 0.3s ease;
}

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

.copy-btn.copied svg {
    stroke: white;
}

.options {
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

#lengthValue {
    color: var(--accent-color);
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

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

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-group label:hover {
    background: var(--border-color);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.checkbox-group span {
    font-size: 15px;
    color: var(--text-primary);
}

.generate-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.generate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.generate-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.strength-indicator {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
}

.strength-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Strength levels */
.strength-weak {
    background: #f44336;
    width: 25%;
}

.strength-fair {
    background: #ff9800;
    width: 50%;
}

.strength-good {
    background: #ffc107;
    width: 75%;
}

.strength-strong {
    background: #4caf50;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    #passwordOutput {
        font-size: 16px;
        padding: 12px;
    }

    .generate-btn {
        font-size: 16px;
        padding: 14px;
    }
}