/* ============================================
   2FA Tools — Design System & Global Styles
   ============================================ */

/* --- CSS Custom Properties (Tokens) --- */
:root {
    /* Background Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0d1225;
    --bg-card: #141b2d;
    --bg-card-hover: #1a2340;
    --bg-input: #0f1529;
    --bg-elevated: #1e2744;

    /* Accent Colors */
    --accent-primary: #6c5ce7;
    --accent-primary-light: #a29bfe;
    --accent-secondary: #00cec9;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --accent-gradient-hover: linear-gradient(135deg, #7c6df7, #b2abfe);
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-glow-strong: rgba(108, 92, 231, 0.5);

    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a29bfe;

    /* Status Colors */
    --success: #00b894;
    --success-bg: rgba(0, 184, 148, 0.12);
    --warning: #fdcb6e;
    --warning-bg: rgba(253, 203, 110, 0.12);
    --danger: #ff7675;
    --danger-bg: rgba(255, 118, 117, 0.12);

    /* Border */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-hover: rgba(148, 163, 184, 0.2);
    --border-accent: rgba(108, 92, 231, 0.3);

    /* Sizing */
    --sidebar-width: 260px;
    --header-height: 56px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle grid pattern on body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(108, 92, 231, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(13, 18, 37, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding: 0 16px;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.menu-toggle:hover { background: var(--bg-elevated); }

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.mobile-logo i {
    color: var(--accent-primary-light);
    font-size: 1.2rem;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition-slow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px;
    margin-bottom: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-item:hover:not(.disabled) {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-primary-light);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.badge-soon {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--warning-bg);
    color: var(--warning);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
    position: relative;
    z-index: 1;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    color: var(--accent-primary-light);
    font-size: 1.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-color-hover);
}

.card-glow {
    box-shadow: var(--shadow-glow);
    border-color: var(--border-accent);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--accent-primary-light);
}

/* ============================================
   2FA Input Section
   ============================================ */
.input-section {
    margin-bottom: 24px;
}

.input-group {
    position: relative;
}

.key-input {
    width: 100%;
    min-height: 100px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    transition: all var(--transition-fast);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.key-input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.key-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.input-hint i { font-size: 0.7rem; }

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 20px var(--accent-glow-strong);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 118, 117, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 118, 117, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ============================================
   2FA Results Section
   ============================================ */
.results-section {
    margin-top: 24px;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.otp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-normal);
    animation: slideIn 0.35s ease-out;
}

.otp-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

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

/* Timer Circle */
.timer-ring {
    flex-shrink: 0;
    position: relative;
    width: 52px;
    height: 52px;
}

.timer-ring svg {
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 3.5;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--accent-primary-light);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-ring-progress.warning { stroke: var(--warning); }
.timer-ring-progress.danger { stroke: var(--danger); }

.timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* OTP Code Display */
.otp-info {
    flex: 1;
    min-width: 0;
}

.otp-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    display: flex;
    gap: 2px;
}

.otp-digit {
    display: inline-block;
    transition: all 0.3s ease;
}

.otp-digit.flip {
    animation: digitFlip 0.4s ease;
}

@keyframes digitFlip {
    0% { transform: rotateX(0); opacity: 1; }
    50% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

.otp-separator {
    color: var(--text-muted);
    margin: 0 2px;
}

/* OTP Actions */
.otp-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-copy {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-copy:hover {
    box-shadow: 0 4px 16px var(--accent-glow-strong);
    transform: translateY(-1px);
}

.btn-copy.copied {
    background: var(--success);
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.3);
}

.btn-save-key {
    background: var(--bg-elevated);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 206, 201, 0.2);
}

.btn-save-key:hover {
    background: rgba(0, 206, 201, 0.1);
    border-color: rgba(0, 206, 201, 0.4);
}

.btn-save-key.saved {
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

.empty-state .sub {
    font-size: 0.78rem;
    margin-top: 4px;
    opacity: 0.7;
}

/* ============================================
   Saved Keys Section
   ============================================ */
.saved-section {
    margin-top: 32px;
}

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

.saved-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.saved-keys-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-key-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.saved-key-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-accent);
}

.saved-key-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.saved-key-info {
    flex: 1;
    min-width: 0;
}

.saved-key-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.saved-key-value {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-key-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    opacity: 0;
}

.saved-key-item:hover .saved-key-delete {
    opacity: 1;
}

.saved-key-delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 220px;
}

.toast.success { border-color: rgba(0, 184, 148, 0.3); }
.toast.success i { color: var(--success); }

.toast.error { border-color: rgba(255, 118, 117, 0.3); }
.toast.error i { color: var(--danger); }

.toast.info { border-color: rgba(108, 92, 231, 0.3); }
.toast.info i { color: var(--accent-primary-light); }

.toast.removing { animation: toastOut 0.25s ease forwards; }

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

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* ============================================
   Save Key Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 400px;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    margin-bottom: 18px;
    transition: all var(--transition-fast);
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   Two Column Layout (2FA page)
   ============================================ */
.two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* ============================================
   Stats Bar
   ============================================ */
.stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stat-item i {
    color: var(--accent-primary-light);
    font-size: 0.85rem;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Check Live UID Page
   ============================================ */
.uid-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 24px;
    align-items: start;
}

/* Progress bar */
.uid-progress-wrap {
    margin-top: 16px;
}

.uid-progress-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.uid-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

.uid-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Summary cards */
.uid-summary {
    margin-top: 16px;
    margin-bottom: 12px;
}

.uid-summary-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.uid-summ-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    text-align: center;
}

.uid-summ-val {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.uid-summ-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.uid-summ-live .uid-summ-val { color: var(--success); }
.uid-summ-die  .uid-summ-val { color: var(--danger); }

/* Result list */
.uid-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uid-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    transition: all var(--transition-fast);
    animation: slideIn 0.25s ease-out;
}

.uid-row--live {
    border-color: rgba(0, 184, 148, 0.25);
    background: rgba(0, 184, 148, 0.04);
}

.uid-row--die {
    border-color: rgba(255, 118, 117, 0.2);
    opacity: 0.7;
}

/* Avatar */
.uid-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.uid-avatar--placeholder {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Row info */
.uid-row-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
}

.uid-row-uid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    white-space: normal;
}

.uid-row-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right section */
.uid-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Status badge */
.uid-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.uid-badge--live {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.uid-badge--die {
    background: rgba(255, 118, 117, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 118, 117, 0.25);
}

.uid-badge--pending {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Stat labels */
.uid-live-label { color: var(--success); }
.uid-die-label  { color: var(--danger); }
.uid-live-val   { color: var(--success) !important; }
.uid-die-val    { color: var(--danger)  !important; }

/* Responsive */
@media (max-width: 900px) {
    .uid-layout {
        grid-template-columns: 1fr;
    }
    .uid-summary-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .uid-summary-inner {
        grid-template-columns: repeat(2, 1fr);
    }
    .uid-row {
        flex-wrap: wrap;
    }
    .uid-row-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   Text Tools Page (textfree)
   ============================================ */

/* Overall page layout */
.tf-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 24px;
    align-items: start;
}

/* Tab bar */
.tf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.tf-tab {
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tf-tab:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.tf-tab.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* Options panel */
.tf-options-panel {
    padding: 16px 20px;
    margin-bottom: 16px;
    min-height: 52px;
}

.tf-opts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.tf-opt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.tf-opt-item.tf-opt-full {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.tf-opt-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.tf-opt-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tf-select,
.tf-input-sm {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 5px 10px;
    transition: border-color var(--transition-fast);
}

.tf-select:focus,
.tf-input-sm:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* IO dual-textarea area */
.tf-io {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
}

.tf-io-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.tf-io-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tf-io-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tf-line-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.tf-textarea {
    width: 100%;
    min-height: 340px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.tf-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.tf-textarea[readonly] {
    background: var(--bg-card);
    cursor: default;
}

/* Run / Swap column */
.tf-run-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 36px;
}

.tf-run-btn {
    writing-mode: vertical-lr;
    text-orientation: mixed;
    padding: 18px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    gap: 6px;
    white-space: nowrap;
}

.tf-run-btn i {
    writing-mode: initial;
    text-orientation: initial;
}

.tf-swap-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* Right stats sidebar */
.tf-sidebar .card {
    /* inherits base card styles */
}

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

.tf-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.tf-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tf-stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.tf-tip {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tf-tip strong {
    color: var(--accent-primary-light);
}

/* Responsive */
@media (max-width: 900px) {
    .tf-layout {
        grid-template-columns: 1fr;
    }
    .tf-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .tf-sidebar .card + .card {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .tf-io {
        grid-template-columns: 1fr;
    }
    .tf-run-col {
        flex-direction: row;
        padding-top: 0;
    }
    .tf-run-btn {
        writing-mode: initial;
        text-orientation: initial;
        flex: 1;
    }
    .tf-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Ad Card (Sidebar Promotion)
   ============================================ */
.ad-card {
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    margin: 4px 0;
    transition: transform var(--transition-normal);
}

.ad-card:hover {
    transform: translateY(-2px);
}

/* Animated glow layer */
.ad-card-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #6c5ce7, #00cec9, #fdcb6e, #6c5ce7);
    background-size: 300% 300%;
    border-radius: calc(var(--radius-md) + 2px);
    animation: adGlow 4s ease infinite;
    z-index: 0;
}

@keyframes adGlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Inner content sits above glow */
.ad-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: linear-gradient(135deg, #12103a, #0e1f2e);
    border-radius: calc(var(--radius-md) - 1px);
    overflow: hidden;
}

/* Shimmer sweep */
.ad-card-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.07) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg);
    animation: adShimmer 3.5s ease-in-out infinite;
}

@keyframes adShimmer {
    0%   { left: -75%; }
    60%  { left: 125%; }
    100% { left: 125%; }
}

.ad-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6c5ce7, #00cec9);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.5);
}

.ad-body {
    flex: 1;
    min-width: 0;
}

.ad-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.01em;
}

.ad-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #a29bfe;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: gap var(--transition-fast);
}

.ad-card:hover .ad-cta {
    gap: 8px;
    color: #fff;
}

.ad-cta i {
    font-size: 0.6rem;
    transition: transform var(--transition-fast);
}

.ad-card:hover .ad-cta i {
    transform: translateX(3px);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablets & Small Desktops */
@media (max-width: 1100px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }

    .page-header h2 {
        font-size: 1.35rem;
    }

    .card {
        padding: 18px;
    }

    .otp-card {
        flex-wrap: wrap;
        gap: 14px;
        padding: 16px;
    }

    .otp-code {
        font-size: 1.6rem;
    }

    .otp-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row .btn {
        width: 100%;
    }

    .stats-bar {
        gap: 8px;
    }

    .stat-item {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .otp-code {
        font-size: 1.35rem;
    }

    .timer-ring {
        width: 44px;
        height: 44px;
    }

    .timer-ring svg {
        width: 44px;
        height: 44px;
    }
}
