:root {
    --bg: #0a0a0f;
    --bg2: #12121a;
    --glass: rgba(18, 18, 26, 0.8);
    --text: #fff;
    --text2: #8b8b9a;
    --accent: #00d4aa;
    --accent2: #00ff88;
    --gradient: linear-gradient(135deg, #00d4aa, #00ff88);
    --danger: #ff4757;
    --warning: #ffa502;
    --success: #00d4aa;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px
}

[data-theme=light] {
    --bg: #f4f7fa;
    --bg2: #fff;
    --glass: rgba(255, 255, 255, 0.9);
    --text: #1a1a2e;
    --text2: #64748b;
    --border: rgba(0, 0, 0, 0.1)
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden
}

.app {
    position: relative;
    min-height: 100vh;
    padding: 24px
}

.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .4
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -200px;
    right: -100px;
    animation: float 15s ease-in-out infinite
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    bottom: -150px;
    left: -100px;
    animation: float 20s ease-in-out infinite reverse
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0)
    }

    50% {
        transform: translate(30px, 30px)
    }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 50px 50px
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius)
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 32px;
    position: relative;
    z-index: 1
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo-icon {
    font-size: 2rem
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

.logo h1 span {
    font-weight: 400;
    opacity: .8
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: .3s
}

.icon-btn:hover {
    background: rgba(0, 212, 170, .2);
    border-color: var(--accent)
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2
}

[data-theme=light] .sun {
    display: none
}

[data-theme=light] .moon {
    display: block
}

.moon {
    display: none
}

.sun {
    display: block
}

.main {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1
}

.generator-card {
    padding: 32px
}

.password-display {
    display: flex;
    gap: 12px;
    margin-bottom: 20px
}

#password-output {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: 1px
}

.password-actions {
    display: flex;
    gap: 8px
}

.action-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: .2s
}

.action-btn:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.05)
}

.action-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2
}

.strength-meter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px
}

.strength-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width .4s, background .4s
}

.strength-fill.weak {
    width: 25%;
    background: var(--danger)
}

.strength-fill.fair {
    width: 50%;
    background: var(--warning)
}

.strength-fill.good {
    width: 75%;
    background: #3b82f6
}

.strength-fill.strong {
    width: 100%;
    background: var(--success)
}

.strength-text {
    font-size: .85rem;
    font-weight: 600;
    min-width: 60px
}

.controls {
    margin-bottom: 24px
}

.control-group {
    margin-bottom: 20px
}

.control-group label {
    display: block;
    font-size: .9rem;
    color: var(--text2);
    margin-bottom: 8px
}

.control-group label span {
    color: var(--accent);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 212, 170, .5)
}

.checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 10px;
    cursor: pointer;
    transition: .2s;
    font-size: .9rem
}

.checkbox:hover {
    background: rgba(0, 212, 170, .1)
}

.checkbox input {
    display: none
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s
}

.checkbox input:checked+.checkmark {
    background: var(--gradient);
    border-color: var(--accent)
}

.checkbox input:checked+.checkmark::after {
    content: '✓';
    color: #000;
    font-weight: 700
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: .2s
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 170, .3)
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

.info-card {
    padding: 20px;
    text-align: center
}

.info-icon {
    font-size: 1.5rem;
    margin-bottom: 8px
}

.info-card h3 {
    font-size: .75rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 4px
}

.info-card p {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent)
}

.history-section {
    padding: 24px
}

.history-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    margin-bottom: 16px
}

.history-section h2 svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem
}

.history-item button {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: .2s
}

.history-item button:hover {
    background: var(--accent);
    color: #000
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text2);
    cursor: pointer;
    transition: .2s
}

.secondary-btn:hover {
    border-color: var(--danger);
    color: var(--danger)
}

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 212, 170, .4);
    transition: .2s;
    z-index: 100
}

.fab:hover {
    transform: scale(1.1)
}

.fab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #000;
    stroke-width: 2
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg2);
    border: 1px solid var(--accent);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: .9rem;
    opacity: 0;
    transition: .3s;
    z-index: 1000
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

@media(max-width:600px) {
    .info-cards {
        grid-template-columns: 1fr
    }

    .checkboxes {
        grid-template-columns: 1fr
    }
}