/* Updated: August 6, 2025 - Fixed desktop header sizing and button positioning */
/* CSS Custom Properties for theming */
:root {
    /* Colors - Fixed attractive gradient */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --button-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    --border-color: #e2e8f0;
    --accent-color: #667eea;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    
    /* Dark mode colors */
    --dark-bg: #1a202c;
    --dark-card-bg: #2d3748;
    --dark-text-primary: #f7fafc;
    --dark-text-secondary: #e2e8f0;
    --dark-border-color: #4a5568;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    
    /* Borders & Radius */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Focus-visible support for better accessibility */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
.js-focus-visible *:focus:not(.focus-visible) {
    outline: none;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #1a202c !important;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: var(--spacing-lg);
    transition: background var(--transition-base);
}

/* Fix default label colors to prevent dark-on-dark issues */
body:not(.dark-mode):not(.light-mode) .option-label {
    color: #2d3748 !important;
}

body:not(.dark-mode):not(.light-mode) .section-title {
    color: #1a202c !important;
}

/* Ensure light mode text is always visible */
body.light-mode .option-label {
    color: #2d3748 !important;
}

body.light-mode .section-title {
    color: #1a202c !important;
}

body:not(.dark-mode) .option-label {
    color: #2d3748 !important;
}

body:not(.dark-mode) .section-title {
    color: #1a202c !important;
}

/* Logo theme-aware styling */
.header img, .header svg {
    color: #4A5568;
}

body.dark-mode .header img, 
body.dark-mode .header svg {
    color: #ffffff;
    filter: none;
}

/* SVG logo styling - theme-aware classes */
.logo-text-primary {
    fill: #4A5568 !important;
}

.logo-text-accent {
    fill: #5B9BD5 !important;
}

/* Legacy selectors for compatibility */
#logo-quick,
.logo-quick,
svg text.logo-quick {
    fill: #4A5568 !important;
}

/* Dark mode logo text colors - maximum specificity */
body.dark-mode .logo-text-primary,
body.dark-mode .header-logo .logo-text-primary,
body.dark-mode svg .logo-text-primary {
    fill: #ffffff !important;
}

body.dark-mode .logo-text-accent,
body.dark-mode .header-logo .logo-text-accent,
body.dark-mode svg .logo-text-accent {
    fill: #ffffff !important;
}

/* Nuclear option - target all SVG text in header during dark mode */
body.dark-mode .header-logo svg text,
body.dark-mode img[src*="logo"] + svg text,
body.dark-mode svg text {
    fill: #ffffff !important;
}

/* Legacy dark mode selectors with enhanced specificity */
body.dark-mode #logo-quick,
body.dark-mode .logo-quick,
body.dark-mode svg text.logo-quick,
body.dark-mode .header-logo #logo-quick,
body.dark-mode .header-logo .logo-quick,
body.dark-mode .header-logo svg text.logo-quick {
    fill: #ffffff !important;
}

/* Remove conflicting logo filter that causes yellow tint */
body.dark-mode .header-logo {
    filter: none;
}

/* Additional dark mode text fixes */
body.dark-mode .history-timestamp {
    color: #ffffff !important;
}

body.dark-mode .length-value {
    color: #ffffff !important;
}

body.dark-mode .bulk-password-item {
    color: #ffffff !important;
}

/* Ensure light mode text is always dark and readable */
body:not(.dark-mode) * {
    color: inherit;
}

body:not(.dark-mode) .bulk-password-text,
body:not(.dark-mode) .history-timestamp,
body:not(.dark-mode) .length-value,
body:not(.dark-mode) .history-meta,
body:not(.dark-mode) .leak-status,
body:not(.dark-mode) .footer,
body:not(.dark-mode) p,
body:not(.dark-mode) span,
body:not(.dark-mode) div:not(.generate-btn):not(.copy-btn):not(.control-btn) {
    color: #1a202c !important;
}

/* Comprehensive dark mode text fixes - ensure ALL text is white */
body.dark-mode * {
    color: inherit;
}

/* Comprehensive dark mode text fixes - ALL text must be white */
body.dark-mode .bulk-password-text,
body.dark-mode .history-timestamp,
body.dark-mode .length-value,
body.dark-mode .history-meta,
body.dark-mode .leak-status,
body.dark-mode .footer,
body.dark-mode p,
body.dark-mode span,
body.dark-mode div:not(.generate-btn):not(.copy-btn):not(.control-btn),
body.dark-mode .password-placeholder,
body.dark-mode .placeholder-text,
body.dark-mode #password-output,
body.dark-mode textarea,
body.dark-mode input,
body.dark-mode label {
    color: #ffffff !important;
}

/* Dark mode logo fixes - nuclear option for all logo elements */
body.dark-mode .header-logo,
body.dark-mode .header-logo *,
body.dark-mode .header-logo svg,
body.dark-mode .header-logo svg *,
body.dark-mode img[src*="logo"],
body.dark-mode img[src*="logo"] *,
body.dark-mode svg[width="240"],
body.dark-mode svg[width="240"] * {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

/* Extreme specificity - override ANY SVG text colors in dark mode */
body.dark-mode svg text[fill],
body.dark-mode svg text[color],
body.dark-mode .header-logo svg text[fill],
body.dark-mode .header-logo svg text[color] {
    fill: #ffffff !important;
    color: #ffffff !important;
}

/* Override any gray colors in dark mode logo */
body.dark-mode .header-logo svg path,
body.dark-mode .header-logo svg circle,
body.dark-mode .header-logo svg rect,
body.dark-mode .header-logo svg text {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* Mobile spacing improvements */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-md);
    }
    
    .container {
        padding: 0;
    }
    
    .generator-card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
    }
    
    .options-grid {
        gap: var(--spacing-lg);
    }
    
    .bulk-password-item {
        padding: var(--spacing-md);
    }
    

}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header styles for desktop layout */
.header {
    margin-bottom: 30px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 68px;
    min-height: 68px;
}

.header-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    display: block;
}

.header-button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #2d3748;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.header-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

/* Dark mode header styles */
body.dark-mode .header-row {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-mode .header-text {
    color: var(--dark-text-primary);
}

body.dark-mode .header-button {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
}

body.dark-mode .header-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Grid header - guaranteed single row */
.grid-header {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
    width: 100% !important;
    min-height: 60px !important;
}

.grid-logo {
    height: 50px !important;
    width: auto !important;
}

.grid-text {
    font-size: 1.1rem !important;
    color: var(--text-secondary) !important;
    opacity: 0.9 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.grid-button {
    background: rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    color: #1a202c !important;
    border-radius: 8px !important;
    padding: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    min-height: 44px !important;
}

.grid-button:hover {
    background: rgba(0, 0, 0, 0.15) !important;
    transform: scale(1.05) !important;
}

/* Dark mode styles */
body.dark-mode .grid-button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

body.dark-mode .grid-button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .grid-text {
    color: var(--dark-text-secondary) !important;
}

/* Main card styles */
.generator-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c !important;
    margin-bottom: 15px;
    display: block;
}

/* Length section styles */
.length-section {
    margin-bottom: 30px;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.length-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
    min-width: 30px;
    text-align: center;
}

/* Options section styles */
.options-section {
    margin-bottom: 30px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Advanced options styles */
.advanced-options {
    margin-bottom: 30px;
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Bulk generation styles */
.bulk-section {
    margin-bottom: 30px;
}

.bulk-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bulk-select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.bulk-select:focus {
    outline: none;
    border-color: #667eea;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 26px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider-toggle {
    background-color: #667eea;
}

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

.option-label {
    font-size: 0.95rem;
    color: #2d3748 !important;
    cursor: pointer;
    user-select: none;
}

/* Error message styles */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    border-left: 4px solid #c53030;
}

.error-message.show {
    display: block;
}

/* Generate button styles with enhanced animations */
.generate-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--button-gradient);
    color: white !important;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

/* Ensure button text is always white regardless of theme */
.generate-btn,
.generate-btn:hover,
.generate-btn:active,
.generate-btn:focus,
body.dark-mode .generate-btn,
body.light-mode .generate-btn,
body:not(.dark-mode) .generate-btn {
    color: white !important;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:hover::before {
    left: 100%;
}

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

/* Result section styles */
.result-section {
    margin-top: 25px;
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-output {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease;
}

.password-output:focus {
    border-color: #667eea;
}

.copy-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #667eea !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure copy button maintains its blue color */
.copy-btn,
.copy-btn:focus,
body.dark-mode .copy-btn,
body.light-mode .copy-btn {
    color: #667eea !important;
}

.copy-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #5a67d8;
}

.copy-btn:disabled {
    color: #a0aec0;
    cursor: not-allowed;
}

/* Copy feedback with animations */
.copy-feedback {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: #c6f6d5;
    color: #22543d;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    animation: fadeOut var(--transition-slow) ease-in-out 2s forwards;
}

.copy-feedback.show {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp var(--transition-base) ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    0%, 60% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Shake animation for error messages */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Skip link for accessibility - visually hidden when not focused */
.skip-link {
    position: absolute;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
    font-size: 14px;
    transition: all var(--transition-base);
}

.skip-link:focus {
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    top: 0;
    left: 6px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .generate-btn::before {
        display: none;
    }
}

/* System dark mode preference fallback */
/* Auto dark mode - but ensure labels remain readable */
@media (prefers-color-scheme: dark) {
    body:not(.dark-mode):not(.light-mode) {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        color: #e2e8f0;
    }
    
    body:not(.dark-mode):not(.light-mode) .generator-card {
        background: var(--dark-card-bg);
        color: var(--dark-text-primary);
    }
    
    /* Ensure labels are visible in auto dark mode */
    body:not(.dark-mode):not(.light-mode) .option-label {
        color: #cbd5e0 !important;
    }
    
    body:not(.dark-mode):not(.light-mode) .section-title {
        color: #e2e8f0 !important;
    }
    
    body:not(.dark-mode):not(.light-mode) footer {
        color: var(--dark-text-secondary);
    }
    
    body:not(.dark-mode):not(.light-mode) footer a {
        color: var(--dark-text-primary);
    }
}

/* Light mode override */
body.light-mode {
    background: var(--primary-gradient) !important;
    color: #1a202c !important;
}

body.light-mode .generator-card,
body.light-mode .history-section {
    background: #ffffff !important;
    color: #1a202c !important;
}

body.light-mode .section-title {
    color: #1a202c !important;
}

body.light-mode .option-label {
    color: #2d3748 !important;
}

body.light-mode .password-output {
    background: #f7fafc !important;
    border-color: #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-mode footer {
    color: #4a5568 !important;
}

body.light-mode footer a {
    color: #667eea !important;
}

body.light-mode .grid-button {
    background: rgba(45, 55, 72, 0.1) !important;
    color: #4a5568 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .grid-button:hover {
    background: rgba(45, 55, 72, 0.2) !important;
    color: #2d3748 !important;
}

body.light-mode .control-btn {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #4a5568 !important;
}

body.light-mode .control-btn:hover {
    background: #f7fafc !important;
    color: #2d3748 !important;
}

body.light-mode .history-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-mode .history-password {
    color: #2d3748 !important;
}

body.light-mode .history-empty {
    color: #718096 !important;
}

body.light-mode .bulk-select {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #2d3748 !important;
}

body.light-mode .bulk-password-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-mode .bulk-password {
    color: #2d3748 !important;
}

body.light-mode .length-value {
    color: #667eea !important;
}

body.light-mode h1 {
    color: #1a202c !important;
}

body.light-mode header h1 {
    color: #1a202c !important;
}

/* Enhanced focus styles for all interactive elements */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Active toggle state enhancement */
input:checked + .slider-toggle {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* High contrast mode support - simplified to prevent label conflicts */
@media (prefers-contrast: high) {
    body:not(.dark-mode) .option-label {
        color: #000000 !important;
    }
    
    body:not(.dark-mode) .section-title {
        color: #000000 !important;
    }
    
    body.dark-mode .option-label {
        color: #ffffff !important;
    }
    
    body.dark-mode .section-title {
        color: #ffffff !important;
    }
    
    .generate-btn,
    .copy-btn,
    .control-btn {
        border: 2px solid;
    }
    
    button:focus-visible,
    input:focus-visible,
    select:focus-visible {
        outline: 3px solid;
        outline-offset: 3px;
    }
    
    input:checked + .slider-toggle {
        box-shadow: 0 0 0 4px;
    }
}

/* Enhanced dark mode focus styles */
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible,
body.dark-mode select:focus-visible {
    outline-color: #a78bfa;
}

body.dark-mode input:checked + .slider-toggle {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3);
}

/* Dark mode header text colors */
body.dark-mode header {
    color: var(--dark-text-primary);
}

body.dark-mode .subtext {
    color: var(--dark-text-secondary);
}



/* Password history section */
.history-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

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

.history-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #edf2f7;
    color: #2d3748;
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    color: #a0aec0;
    padding: 40px 20px;
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f7fafc;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.history-password {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2d3748;
    flex: 1;
    margin-right: 15px;
    word-break: break-all;
}

.history-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 120px;
}

.history-timestamp {
    font-size: 0.8rem;
    color: #718096;
}



.history-actions {
    display: flex;
    gap: 5px;
}

.history-copy-btn {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.history-copy-btn:hover {
    background: #edf2f7;
    color: #5a67d8;
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
    background-attachment: fixed !important;
    color: #ffffff !important;
}

/* Light mode explicit styles to prevent text color issues */
body:not(.dark-mode),
body.light-mode {
    background: var(--primary-gradient) !important;
    background-attachment: fixed !important;
    color: #1a202c !important;
}

/* Generator card explicit styles */
.generator-card {
    background: var(--card-bg);
    color: #1a202c;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-xl);
}

body:not(.dark-mode) .generator-card,
body.light-mode .generator-card {
    background: #ffffff !important;
    color: #1a202c !important;
}

/* Force all text elements to have proper colors in light mode */
body:not(.dark-mode) .section-title,
body:not(.dark-mode) .option-label,
body:not(.dark-mode) .length-value,
body:not(.dark-mode) label,
body:not(.dark-mode) p,
body:not(.dark-mode) span:not(.header-text),
body:not(.dark-mode) div:not(.generate-btn):not(.copy-btn):not(.header-button) {
    color: #1a202c !important;
}

body.light-mode .section-title,
body.light-mode .option-label,
body.light-mode .length-value,
body.light-mode label,
body.light-mode p,
body.light-mode span:not(.header-text),
body.light-mode div:not(.generate-btn):not(.copy-btn):not(.header-button) {
    color: #1a202c !important;
}

body.dark-mode .generator-card,
body.dark-mode .history-section {
    background: #2d3748;
    color: #ffffff !important;
}

body.dark-mode .section-title {
    color: #ffffff !important;
}

body.dark-mode .slider {
    background: #4a5568;
}

body.dark-mode .option-label {
    color: #ffffff !important;
}

body.dark-mode .password-output {
    background: #1a202c;
    border-color: #4a5568;
    color: #ffffff !important;
}

/* Dark mode placeholder text fix - make it white/light gray */
body.dark-mode .password-output::placeholder {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

body.dark-mode .password-output:focus {
    border-color: #667eea;
}

body.dark-mode .control-btn {
    background: #1a202c;
    border-color: #4a5568;
    color: #ffffff !important;
}

body.dark-mode .control-btn:hover {
    background: #4a5568;
    color: #ffffff !important;
}

body.dark-mode .history-item {
    background: #1a202c;
    border-color: #4a5568;
}

body.dark-mode .history-item:hover {
    background: #4a5568;
    border-color: #718096;
}

body.dark-mode .history-password {
    color: #ffffff !important;
}

body.dark-mode .history-empty {
    color: #ffffff !important;
}



body.dark-mode .error-message {
    background: #742a2a;
    color: #feb2b2;
    border-color: #c53030;
}

body.dark-mode .bulk-select {
    background: #1a202c;
    border-color: #4a5568;
    color: #ffffff !important;
}

body.dark-mode .bulk-select:focus {
    border-color: #667eea;
}

/* Bulk password container styles */
.bulk-password-container {
    margin-top: 15px;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bulk-password-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
}

.bulk-password-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.bulk-password-item:last-child {
    border-bottom: none;
}

.bulk-password-item:hover {
    background: #edf2f7;
}

.bulk-password-text {
    flex: 1;
    margin-right: 10px;
}

.bulk-password-copy {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bulk-password-copy:hover {
    background: #edf2f7;
    color: #5a67d8;
}

/* Leak check results with loading state and animations */
.leak-check-result {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border-left: 4px solid;
    transition: all var(--transition-base);
    animation: slideDown var(--transition-base) ease-out;
}

.leak-status.safe {
    background: #c6f6d5;
    color: #22543d;
    border-color: var(--success-color);
}

.leak-status.leaked {
    background: #fed7d7;
    color: #c53030;
    border-color: var(--error-color);
}

.leak-status.checking {
    background: #bee3f8;
    color: #2c5282;
    border-color: #3182ce;
    position: relative;
}

.leak-status.checking::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #2c5282;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: var(--spacing-sm);
    vertical-align: middle;
}

.leak-status.error {
    background: #feebc8;
    color: #c05621;
    border-color: var(--warning-color);
}

/* Dark mode styles for new features */
body.dark-mode .bulk-password-list {
    background: #1a202c;
    border-color: #4a5568;
}

body.dark-mode .bulk-password-item {
    border-color: #4a5568;
    color: #ffffff !important;
}

body.dark-mode .bulk-password-item:hover {
    background: #4a5568;
}

body.dark-mode .bulk-password-copy {
    color: #667eea;
}

body.dark-mode .bulk-password-copy:hover {
    background: #4a5568;
    color: #ffffff !important;
}

/* PWA-friendly styles for standalone display */
@media (display-mode: standalone) {
    body {
        padding-top: calc(var(--spacing-xl) + env(safe-area-inset-top));
        padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    }
    
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
}

/* Footer styles */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xl);
}



/* Clean header layout - desktop first */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
    min-height: 60px;
    position: relative;
}

.header-logo {
    height: 60px;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    font-size: 1.6rem;
    color: var(--text-secondary);
    opacity: 0.9;
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-button {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #2d3748;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    order: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    display: block;
}

.header-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode .header-button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .header-button svg {
    stroke: white;
}

body.dark-mode .header-button:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .header-text {
    color: var(--dark-text-secondary);
}

body.light-mode .header-button {
    background: rgba(45, 55, 72, 0.1) !important;
    color: #4a5568 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .header-button svg {
    stroke: #4a5568 !important;
}

body.light-mode .header-button:hover {
    background: rgba(45, 55, 72, 0.2) !important;
    color: #2d3748 !important;
}

/* Clean desktop and mobile separation */

/* Mobile-only complete reset */
@media screen and (max-width: 479px) {
    /* Override any desktop styles completely */
    .header-row * {
        position: static !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }
    
    body {
        padding: 15px !important;
    }

    .header-row {
        display: block !important;
        text-align: center !important;
        margin-bottom: 20px !important;
        position: relative !important;
        height: auto !important;
        padding: 10px 50px 10px 10px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 8px !important;
    }

    .header-logo {
        display: block !important;
        height: 40px !important;
        width: auto !important;
        margin: 0 auto 8px auto !important;
        position: static !important;
    }

    .header-text {
        display: block !important;
        font-size: 1.2rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        text-align: center !important;
        position: static !important;
        color: var(--text-secondary) !important;
        opacity: 0.9 !important;
        font-weight: 500 !important;
    }
    
    .header-button {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 8px !important;
        margin: 0 !important;
    }
    
    .header-button svg {
        width: 18px !important;
        height: 18px !important;
        stroke-width: 2.5 !important;
        display: block !important;
        color: inherit !important;
        stroke: currentColor !important;
        fill: none !important;
    }

    .generator-card {
        padding: 25px;
    }

    .length-control {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .length-value {
        align-self: center;
    }

    .options-grid {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header-text h1 {
        font-size: 1.2rem;
    }

    .subtext {
        font-size: 1.2rem;
        white-space: nowrap;
    }

    .generator-card {
        padding: 20px;
    }

    .generate-btn {
        padding: 12px;
        font-size: 1rem;
    }

    .password-output {
        padding: 12px;
        font-size: 0.9rem;
    }
}
/* Force cache bust */
