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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Floating particles */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s infinite ease-in-out;
}

.particle:nth-child(1) { width: 80px; height: 80px; top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 60px; height: 60px; top: 60%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { width: 40px; height: 40px; top: 80%; left: 20%; animation-delay: 4s; }
.particle:nth-child(4) { width: 100px; height: 100px; top: 10%; left: 70%; animation-delay: 3s; }
.particle:nth-child(5) { width: 50px; height: 50px; top: 40%; left: 5%; animation-delay: 1s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.3; }
    25% { transform: translateY(-30px) rotate(90deg); opacity: 0.6; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.8; }
    75% { transform: translateY(-40px) rotate(270deg); opacity: 0.5; }
}

/* Magic sparkles */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

.main-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    align-items: flex-start;
}

.generator-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.8s ease-out;
    overflow: hidden;
}

.saved-passwords-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 35px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.8s ease-out 0.2s both;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.header {
    text-align: center;
    margin-bottom: 35px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: pulse 2s infinite;
    box-shadow: 0 10px 30px rgba(254, 202, 87, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(254, 202, 87, 0.5); }
}

.title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.5;
}

/* Password strength indicator */
.strength-indicator {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 15px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.strength-bar {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.active {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.password-display {
    margin-bottom: 30px;
    position: relative;
}

.password-container {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.password-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-container:hover::before {
    left: 100%;
}

.password-container:hover {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.password-output {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 1.6rem;
    color: #ffffff;
    background: none;
    border: none;
    width: 100%;
    text-align: center;
    outline: none;
    letter-spacing: 3px;
    font-weight: 700;
    min-height: 40px;
    cursor: pointer;
    user-select: all;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.password-output::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    letter-spacing: 1px;
}

/* Character type indicators */
.char-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.char-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.char-type.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.btn {
    width: 100%;
    padding: 18px 30px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transform: translateY(0);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

.btn-save {
    background: linear-gradient(135deg, #48cab2, #42a5f5);
    color: white;
    box-shadow: 0 10px 30px rgba(72, 202, 178, 0.4);
    position: relative;
}

.btn-save:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(72, 202, 178, 0.6);
}

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

/* Save counter badge */
.save-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.save-counter.show {
    transform: scale(1);
}

/* Celebration effects */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Achievement popup */
.achievement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 300px;
}

.achievement.show {
    transform: translate(-50%, -50%) scale(1);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.achievement h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.achievement p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.saved-header {
    margin-bottom: 25px;
}

.saved-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.saved-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.saved-passwords-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    padding-right: 8px;
}

.saved-passwords-list::-webkit-scrollbar {
    width: 6px;
}

.saved-passwords-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.saved-passwords-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.saved-password-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease;
}

.saved-password-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

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

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

.saved-password-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

.saved-password-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.saved-password-display {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.saved-password-text {
    font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace;
    color: #ffffff;
    font-size: 1.1rem;
    letter-spacing: 2px;
    word-break: break-all;
    user-select: all;
    font-weight: 600;
}

.saved-password-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
}

.btn-copy-saved {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-copy-saved:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.clear-all-btn {
    margin-top: 15px;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: rgb(241, 169, 169);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 600;
}

.clear-all-btn:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateY(-2px);
}

.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, #48cab2, #42a5f5);
    color: white;
    padding: 16px 28px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

/* Newly generated animation */
.newly-generated {
    animation: newContentGlow 2.5s ease-out;
    position: relative;
}

@keyframes newContentGlow {
    0% {
        background: rgba(72, 202, 178, 0.4);
        box-shadow: 0 0 30px rgba(72, 202, 178, 0.8);
        transform: scale(1.05);
    }
    100% {
        background: rgba(0, 0, 0, 0.4);
        box-shadow: none;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    .generator-container,
    .saved-passwords-container {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .generator-container,
    .saved-passwords-container {
        padding: 25px;
        margin: 8px;
    }
    .title {
        font-size: 2.2rem;
    }
    .password-output {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .generator-container,
    .saved-passwords-container {
        padding: 20px;
    }
    .title {
        font-size: 1.9rem;
    }
    .password-output {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
}