/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #121218;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b8;
    --accent-cyan: #00d9ff;
    --accent-purple: #b026ff;
    --accent-green: #00ff88;
    --accent-pink: #ff006e;
    --accent-yellow: #ffbe0b;
    
    /* Strength Colors */
    --strength-weak: #ff4757;
    --strength-medium: #ffa502;
    --strength-good: #5f27cd;
    --strength-strong: #00d9ff;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: 0 0 20px rgba(0, 217, 255, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(176, 38, 255, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Background Gradient Animation
   ======================================== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, 
        var(--bg-primary) 0%,
        #0d0d14 25%,
        #0f0f1a 50%,
        #0d0d14 75%,
        var(--bg-primary) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.bg-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(0, 217, 255, 0.1) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 70% 70%,
        rgba(176, 38, 255, 0.1) 0%,
        transparent 50%
    );
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   Header
   ======================================== */
.header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header-description {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========================================
   Main Content
   ======================================== */
.main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.generator-card {
    animation-delay: 0.2s;
}

.info-section {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Password Display
   ======================================== */
.password-display {
    position: relative;
    margin-bottom: 1.5rem;
}

.password-output {
    width: 100%;
    padding: 1.25rem 4rem 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 500;
    text-align: left;
    transition: all var(--transition-normal);
    outline: none;
    cursor: text;
}

.password-output:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.password-output.typing {
    animation: typing 0.5s ease;
}

@keyframes typing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.password-actions {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-icon:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon svg {
    transition: transform var(--transition-fast);
}

.btn-icon:hover svg {
    transform: rotate(90deg);
}

.btn-icon:active svg {
    transform: rotate(180deg);
}

/* ========================================
   Strength Indicator
   ======================================== */
.strength-indicator {
    margin-bottom: 2rem;
}

.strength-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.strength-text {
    font-weight: 600;
    transition: color var(--transition-normal);
}

.strength-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: var(--radius-sm);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.strength-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.strength-bar-fill[data-strength="1"] {
    width: 25%;
    background: var(--strength-weak);
}

.strength-bar-fill[data-strength="2"] {
    width: 50%;
    background: var(--strength-medium);
}

.strength-bar-fill[data-strength="3"] {
    width: 75%;
    background: var(--strength-good);
}

.strength-bar-fill[data-strength="4"] {
    width: 100%;
    background: var(--strength-strong);
}

/* ========================================
   Settings
   ======================================== */
.settings {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-value {
    color: var(--accent-cyan);
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* Slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.4);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.6);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.4);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    background: var(--bg-secondary);
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: var(--accent-cyan);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-primary);
    font-weight: bold;
    font-size: 14px;
}

.checkbox-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
}

/* Generate Button */
.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-normal);
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-generate:active::before {
    width: 300px;
    height: 300px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate svg {
    transition: transform var(--transition-fast);
}

.btn-generate:hover svg {
    transform: rotate(45deg);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Info Section
   ======================================== */
.info-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.info-list {
    list-style: none;
    margin-bottom: 2rem;
}

.info-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

.security-notice {
    padding: 1.5rem;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

.security-notice h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--accent-cyan);
}

.security-notice p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

.security-notice code {
    background: rgba(0, 217, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85em;
    color: var(--accent-cyan);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.footer-link svg {
    transition: transform var(--transition-fast);
}

.footer-link:hover svg {
    transform: translate(2px, -2px);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--accent-green);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .password-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .password-output {
        padding-right: 5rem;
        font-size: 0.9rem;
    }
    
    .settings {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .password-output {
        padding: 1rem 4.5rem 1rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-generate {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

