/* Custom CSS Design System - PassShield Dark Glassmorphism Theme */

:root {
    --bg-dark: #070913;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-glass: rgba(255, 255, 255, 0.1);
    --border-glass-focus: rgba(6, 182, 212, 0.5);

    --primary-cyan: #06b6d4;
    --primary-cyan-glow: rgba(6, 182, 212, 0.35);
    --accent-violet: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Character color coding */
    --char-upper: #38bdf8;
    --char-lower: #e2e8f0;
    --char-number: #fbbf24;
    --char-symbol: #c084fc;

    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --text-muted: #64748b;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', monospace, Consolas, Monaco;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;

    --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.2);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 24px 16px;
    position: relative;
}

/* Dynamic Radial Background Glow */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 20%, rgba(6, 182, 212, 0.15), transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(139, 92, 246, 0.15), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-violet));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 20px var(--primary-cyan-glow);
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-sub);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    gap: 6px;
    margin-top: 8px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-main);
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Tab Panels */
.tab-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-panel.hidden {
    display: none;
}

/* Output Card & Password Display */
.output-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 27, 75, 0.6));
    border: 1px solid rgba(6, 182, 212, 0.25);
    box-shadow: var(--shadow-glow);
}

.password-display-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 9, 19, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    gap: 16px;
    position: relative;
    min-height: 72px;
}

.password-display {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    word-break: break-all;
    user-select: all;
    line-height: 1.4;
    flex: 1;
}

/* Colorized character spans */
.char-upper { color: var(--char-upper); }
.char-lower { color: var(--char-lower); }
.char-number { color: var(--char-number); }
.char-symbol { color: var(--char-symbol); }

.output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn.icon-only {
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.action-btn.icon-only:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(45deg);
}

.copy-btn {
    background: linear-gradient(135deg, var(--primary-cyan), #0284c7);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-cyan-glow);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

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

.copy-btn.copied {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.hidden {
    display: none !important;
}

/* Strength & Meter Bar */
.strength-box {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.strength-label-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.strength-title {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.strength-status {
    font-size: 0.95rem;
    font-weight: 700;
}

.strength-metrics {
    display: flex;
    gap: 12px;
}

.metric-chip {
    font-size: 0.8rem;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-chip b {
    color: var(--text-main);
}

.meter-bar {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.level-0 { width: 15%; background: var(--accent-rose); box-shadow: 0 0 10px var(--accent-rose); }
.level-1 { width: 35%; background: #f97316; box-shadow: 0 0 10px #f97316; }
.level-2 { width: 60%; background: var(--accent-amber); box-shadow: 0 0 10px var(--accent-amber); }
.level-3 { width: 85%; background: var(--primary-cyan); box-shadow: 0 0 10px var(--primary-cyan); }
.level-4 { width: 100%; background: var(--accent-emerald); box-shadow: 0 0 14px var(--accent-emerald); }

/* Presets Row */
.presets-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.presets-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-sub);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.preset-chip.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary-cyan);
    border-color: rgba(6, 182, 212, 0.4);
    font-weight: 600;
}

/* Config Card & Controls */
.config-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group.inline {
    flex-direction: row;
    align-items: center;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-header label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
}

.length-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.length-input-wrap input {
    width: 60px;
    background: rgba(7, 9, 19, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--primary-cyan);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding: 4px;
}

.length-input-wrap span {
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* Custom Slider */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-cyan);
    cursor: pointer;
    box-shadow: 0 0 12px var(--primary-cyan);
    transition: transform 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.custom-checkbox:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-cyan-glow);
}

.custom-checkbox input:checked ~ .checkmark::after {
    content: "✓";
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}

.cb-content {
    display: flex;
    flex-direction: column;
}

.cb-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
}

.cb-sub {
    font-size: 0.75rem;
    color: var(--text-sub);
    font-family: var(--font-mono);
}

/* Passphrase options */
.passphrase-options {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.val-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-cyan);
}

.custom-input {
    background: rgba(7, 9, 19, 0.7);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
}

.custom-input.small {
    width: 80px;
    text-align: center;
}

.custom-input:focus {
    border-color: var(--primary-cyan);
}

/* Batch Generator Styles */
.batch-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-violet));
    color: #fff;
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.batch-results-wrapper {
    background: rgba(7, 9, 19, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.batch-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.batch-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* Analyzer Styles */
.section-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.analyzer-input-group {
    margin-bottom: 20px;
}

.input-with-toggle {
    display: flex;
    align-items: center;
    background: rgba(7, 9, 19, 0.8);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 6px 14px;
}

.input-with-toggle:focus-within {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 12px var(--primary-cyan-glow);
}

.input-with-toggle input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    padding: 10px 0;
    outline: none;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 14px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.stat-val {
    font-size: 1.15rem;
    font-weight: 700;
}

.text-green { color: var(--accent-emerald); }

.breakdown-section, .suggestions-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-section h4, .suggestions-section h4 {
    font-size: 0.9rem;
    color: var(--text-sub);
}

.breakdown-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-chip {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
}

.suggestions-list {
    list-style-type: square;
    padding-left: 20px;
    color: var(--text-sub);
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* History List */
.history-list-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border-glass);
}

.history-pwd {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.action-btn.danger-sm {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    font-size: 0.8rem;
    padding: 6px 12px;
}

.action-btn.danger-sm:hover {
    background: rgba(244, 63, 94, 0.3);
}

.empty-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

/* Footer */
.app-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-top: 10px;
}

.security-guarantee {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-main);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.footer-link {
    color: var(--primary-cyan);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--primary-cyan);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease forwards;
}

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

@media (max-width: 640px) {
    .nav-tabs {
        flex-wrap: wrap;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
