/* ==========================================
   Password Generator - Design System
   Based on xray.elaine.is & elaine.is
   ========================================== */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* CSS Variables (Design Tokens) */
:root {
    /* Colors - Backgrounds */
    --bg-primary: #09090b;
    --bg-secondary: rgba(24, 24, 32, 0.7);
    --bg-card: rgba(24, 24, 32, 0.8);
    --bg-input: rgba(255, 255, 255, 0.05);
    
    /* Colors - Accents */
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #9d8df1;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-glow-strong: rgba(139, 92, 246, 0.3);
    
    /* Colors - Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Colors - Status */
    --color-safe: #10b981;
    --color-warning: #f97316;
    --color-critical: #ef4444;
    --color-good: #22c55e;
    
    /* Colors - Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.2);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-full: 99px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* Background Glow Effects */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

body::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
}

/* Container */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 0.5px solid var(--border-accent);
    color: var(--accent-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius-full);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: var(--transition-normal);
}

.badge:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.badge-icon {
    font-size: 16px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

h1 .gradient-text {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Card / Main Container */
.card {
    background: var(--bg-card);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.2),
        0 0 80px rgba(139, 92, 246, 0.05);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 100px rgba(139, 92, 246, 0.08);
}

/* Password Display Section */
.password-section {
    margin-bottom: 32px;
}

.password-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    display: block;
}

.password-display {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.password-field {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: 1px;
    outline: none;
    transition: var(--transition-normal);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--text-secondary);
}

.copy-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-safe);
    color: var(--color-safe);
}

.copy-btn svg {
    width: 20px;
    height: 20px;
}

/* Strength Indicator */
.strength-section {
    margin-bottom: 32px;
}

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

.strength-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.strength-value {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    transition: var(--transition-normal);
}

.strength-value.weak {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-critical);
}

.strength-value.fair {
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-warning);
}

.strength-value.good {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-good);
}

.strength-value.strong {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-safe);
}

.strength-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: var(--border-radius-full);
    transition: var(--transition-normal);
    width: 0%;
}

.strength-fill.weak {
    width: 25%;
    background: linear-gradient(90deg, var(--color-critical), #f87171);
}

.strength-fill.fair {
    width: 50%;
    background: linear-gradient(90deg, var(--color-warning), #fb923c);
}

.strength-fill.good {
    width: 75%;
    background: linear-gradient(90deg, var(--color-good), #4ade80);
}

.strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, var(--color-safe), #34d399);
}

/* Options Section */
.options-section {
    margin-bottom: 32px;
}

.options-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.options-header svg {
    color: var(--accent-primary);
}

/* Length Control */
.length-control {
    margin-bottom: 24px;
}

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

.length-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.length-value {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-sm);
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-secondary);
    min-width: 48px;
    text-align: center;
}

/* Range Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--border-radius-full);
    outline: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Checkbox Options Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    user-select: none;
}

.checkbox-option:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: var(--border-accent);
}

.checkbox-option.checked {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
}

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

.checkbox-custom {
    width: 20px;
    height: 20px;
    background: transparent;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.checkbox-option.checked .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-custom svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition-fast);
}

.checkbox-option.checked .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.checkbox-example {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
    font-family: 'Courier New', monospace;
}

/* Advanced Options */
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    padding: 8px 0;
    transition: var(--transition-normal);
}

.advanced-toggle:hover {
    color: var(--accent-secondary);
}

.advanced-toggle svg {
    transition: var(--transition-normal);
}

.advanced-toggle.open svg {
    transform: rotate(180deg);
}

.advanced-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
}

.advanced-options.open {
    max-height: 200px;
    margin-top: 16px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 140px;
    padding: 16px 24px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Tip Section */
.tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(139, 92, 246, 0.05);
    border: 0.5px solid var(--border-accent);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: 24px;
}

.tip-icon {
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.tip-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.tip-text strong {
    color: var(--accent-secondary);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 0.5px solid var(--border-subtle);
}

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-link {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .card {
        padding: 24px;
    }
    
    .password-field {
        font-size: 1rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .checkbox-example {
        display: none;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .password-display {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}

/* Copy notification toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 0.5px solid var(--color-safe);
    border-radius: var(--border-radius-md);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-safe);
    font-weight: 500;
    font-size: 14px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast svg {
    width: 18px;
    height: 18px;
}

/* Exclude similar characters option styling */
.exclude-option {
    margin-top: 12px;
}
