@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    --accent: #3b82f6;

    /* Strength colors */
    --strength-weak: #ef4444;
    --strength-fair: #f59e0b;
    --strength-good: #10b981;
    --strength-strong: #059669;
    --strength-verystrong: #065f46;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Background Blobs */
.bg-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary-gradient);
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.12;
}

.blob-1 {
    top: -10%;
    right: -10%;
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

/* Calculator Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 35px 45px;
    width: 100%;
    max-width: 750px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 5px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.app-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: -10px;
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 5px;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Tab Contents */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.tab-content.active {
    display: flex;
}

/* Sliders */
.setting-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.setting-row>label {
    min-width: 90px;
    color: #cbd5e1;
    font-weight: 500;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 15px;
}

.slider {
    flex-grow: 1;
    -webkit-appearance: none;
    /* For Chrome, Safari, Opera */
    -moz-appearance: none;
    /* For Firefox */
    appearance: none;
    /* Standard property */
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border: 2px solid var(--accent);
}

.num-input {
    width: 65px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
}

.num-input:focus {
    border-color: var(--accent);
}

/* Toggles */
.setting-row.checks {
    flex-wrap: wrap;
    gap: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-text {
    color: #cbd5e1;
    font-size: 0.95rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.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: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #94a3b8;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider-toggle {
    background-color: var(--accent);
}

input:checked+.slider-toggle:before {
    transform: translateX(20px);
    background-color: white;
}

/* Output Area */
.password-display {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 110px;
    word-break: break-all;
}

.password-output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
}

.password-output span.num {
    color: #38bdf8;
}

.password-output span.sym {
    color: #fbbf24;
}

/* Strength Bar */
.strength-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: -5px;
}

.strength-bar-bg {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.4s ease, background-color 0.4s ease;
    border-radius: 4px;
}

.strength-label {
    min-width: 80px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: right;
}

/* Action Buttons */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.action-grid button {
    padding: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
}

.primary-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.secondary-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .calculator-card {
        padding: 25px 20px;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .slider-wrapper {
        width: 100%;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .password-output {
        font-size: 1.5rem;
    }
}