/* ==========================================================================
   LinkCloud Design System
   Theme: Modern Dark Navy & Purple Glassmorphism
   ========================================================================== */

:root {
    /* Color Palette: Dark Navy & Rich Purples */
    --bg-primary: #070a13;
    --bg-secondary: #0d1222;
    --bg-surface: #131a30;
    --bg-card: rgba(19, 26, 48, 0.72);
    --bg-card-hover: rgba(28, 38, 70, 0.85);
    --bg-input: #090e1a;

    /* Accent & Brand Colors */
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.35);
    --accent-violet: #a855f7;
    --accent-indigo: #6366f1;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;

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

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(139, 92, 246, 0.25);
    --border-glow: rgba(139, 92, 246, 0.6);

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.15);
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.4);

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Light Orbs */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.orb-purple {
    top: -100px;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.55), rgba(99, 102, 241, 0.05));
    animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-blue {
    bottom: 50px;
    right: 15%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), rgba(6, 182, 212, 0.05));
    animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(60px) scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin-icon {
    animation: spin 0.8s linear infinite;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #c084fc 0%, #8b5cf6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.glass-panel:hover {
    border-color: var(--border-medium);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 10, 19, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
    transition: transform var(--transition-fast);
}

.brand:hover .brand-icon {
    transform: scale(1.05);
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-sqlite {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseDot 2s infinite;
}

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

/* ==========================================================================
   Page Wrapper
   ========================================================================== */
.page-wrapper {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ==========================================================================
   Hero & Shortener Component
   ========================================================================== */
.hero-section {
    max-width: 860px;
    margin: 1.5rem auto 0;
    text-align: center;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2.25rem;
    line-height: 1.6;
}

/* Input Form Card */
.shortener-card {
    padding: 1.75rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: linear-gradient(180deg, rgba(19, 26, 48, 0.9) 0%, rgba(13, 18, 34, 0.95) 100%);
    position: relative;
    overflow: hidden;
}

.shortener-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-violet), transparent);
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.input-group:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.input-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.65rem 0.25rem;
    width: 100%;
}

.url-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.4rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #9333ea, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-paste {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-paste:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Alert Banner */
.alert-banner {
    display: none;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    text-align: left;
    animation: fadeInSlide 0.25s ease-out;
}

.alert-banner.visible {
    display: flex;
}

.alert-error {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fda4af;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Result Card
   ========================================================================== */
.result-card {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    text-align: left;
    animation: fadeInSlide 0.3s ease-out forwards;
}

.result-card.visible {
    display: block;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-emerald);
    font-weight: 600;
    font-size: 0.92rem;
}

.check-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    font-size: 0.75rem;
    font-weight: 800;
}

.code-badge {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    background: rgba(139, 92, 246, 0.18);
    color: var(--text-accent);
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.result-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 10, 19, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    gap: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.short-url-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.short-url-text a {
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color var(--transition-fast);
}

.short-url-text a:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: #7c3aed;
    box-shadow: 0 2px 10px var(--accent-purple-glow);
}

.btn-copy .icon-check {
    display: none;
}

.btn-copy.copied {
    background: var(--accent-emerald) !important;
}

.btn-copy.copied .icon-copy {
    display: none;
}

.btn-copy.copied .icon-check {
    display: inline-block;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.original-url-preview {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    overflow: hidden;
}

.preview-label {
    flex-shrink: 0;
    font-weight: 500;
}

.preview-text {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

.result-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.link-analytics {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.link-analytics:hover {
    color: #e9d5ff;
    text-decoration: underline;
}

/* ==========================================================================
   Features Grid
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 3.5rem;
    text-align: left;
}

.feature-card {
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    transition: transform var(--transition-base), border-color var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-medium);
}

.feature-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.feature-icon-wrapper.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.feature-icon-wrapper.violet {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-violet);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.feature-title {
    font-size: 1.1rem;
    margin-bottom: 0.45rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* ==========================================================================
   Analytics Dashboard Styles
   ========================================================================== */
.analytics-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 2.2rem;
    margin-top: 0.35rem;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Stat Metric Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.35rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-icon-wrapper.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.stat-icon-wrapper.amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.stat-icon-wrapper.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.stat-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Table Card & Toolbar */
.table-card {
    border-radius: 18px;
    overflow: hidden;
}

.table-toolbar {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.table-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-title {
    font-size: 1.15rem;
}

.counter-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    min-width: 260px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px var(--accent-purple-glow);
    color: var(--accent-purple);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 100%;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.analytics-table th {
    padding: 0.85rem 1.25rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(7, 10, 19, 0.4);
    border-bottom: 1px solid var(--border-subtle);
}

.analytics-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.link-row {
    transition: background var(--transition-fast);
}

.link-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.col-short {
    min-width: 220px;
}

.short-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.code-pill {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.table-short-url {
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.table-short-url:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.col-original {
    max-width: 320px;
}

.original-url-cell {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.click-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 36px;
}

.click-badge.zero {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.click-badge.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.click-badge.high {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.date-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.date-muted {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-table-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-copy-inline.copied {
    background: var(--accent-emerald) !important;
    color: #ffffff !important;
    border-color: var(--accent-emerald) !important;
}

/* Empty State */
.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.empty-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.empty-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.empty-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.no-search-results {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   404 Error Page
   ========================================================================== */
.error-page-container {
    max-width: 580px;
    margin: 4rem auto 0;
    text-align: center;
}

.error-card {
    padding: 3rem 2rem;
    border-radius: 24px;
}

.error-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.error-icon-glow {
    color: var(--accent-purple);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.5));
}

.error-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.error-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #18223d;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 0.8rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    font-weight: 500;
    pointer-events: auto;
    animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.4);
}

.toast-success .toast-icon {
    color: #34d399;
}

.toast-error {
    border-color: rgba(244, 63, 94, 0.4);
}

.toast-error .toast-icon {
    color: #fb7185;
}

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

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

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--border-subtle);
    background: rgba(7, 10, 19, 0.9);
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 500px;
    margin-top: 0.4rem;
}

.footer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tech-pill {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.footer-bottom {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    width: 100%;
    padding-top: 1.25rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }

    .badge-sqlite {
        display: none;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .url-input {
        padding: 0.5rem 0;
    }

    .btn-paste, .btn-primary {
        width: 100%;
    }

    .result-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .result-actions {
        justify-content: flex-end;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
    }

    .modal-card {
        margin: 1rem;
        max-width: 95%;
    }
}

/* ==========================================================================
   Feature 1 & 3: Custom Alias Inputs & QR Code Modal
   ========================================================================== */

/* Custom Alias Input Row */
.alias-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    text-align: left;
}

.alias-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.alias-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.optional-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.alias-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.alias-tip code {
    font-family: var(--font-mono);
    color: var(--text-accent);
}

.alias-input-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    gap: 0.35rem;
    transition: all var(--transition-fast);
}

.alias-input-box:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px var(--accent-purple-glow);
}

.alias-prefix {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    user-select: none;
    white-space: nowrap;
}

.alias-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
}

.alias-input::placeholder {
    color: rgba(148, 163, 184, 0.4);
    font-weight: 400;
}

/* QR Action Buttons */
.btn-qr-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-qr-inline {
    color: var(--text-accent);
}

.btn-qr-inline:hover {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Modal Overlay & Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 15, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: #0f1527;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.25);
    padding: 1.5rem;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.modal-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.15rem;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.modal-btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-btn-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.qr-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.qr-image-wrapper {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qr-image-wrapper img {
    display: block;
    border-radius: 6px;
}

.qr-target-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.modal-link-preview {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-accent);
    text-decoration: none;
    word-break: break-all;
    max-width: 320px;
}

.modal-link-preview:hover {
    text-decoration: underline;
}

.modal-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-size: 0.78rem;
    color: #fef08a;
    line-height: 1.45;
}

.modal-notice .notice-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.modal-notice p {
    color: #fef9c3;
    margin-top: 0.15rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Feature 2: Click Analytics Chart Panel
   ========================================================================== */
.chart-card {
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chart-title {
    font-size: 1.2rem;
}

.chart-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.chart-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.chart-content {
    min-height: 230px;
    position: relative;
}

.chart-canvas-wrapper {
    position: relative;
    height: 230px;
    width: 100%;
}

.chart-empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.chart-empty-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.chart-empty-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* ==========================================================================
   Security & Authentication Styles
   ========================================================================== */

/* Navbar Admin & Auth Elements */
.badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-accent);
}

.btn-logout-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fca5a5;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-logout-nav:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
    color: #ffffff;
}

.btn-login-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
    transition: var(--transition-fast);
}

.btn-login-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
    color: #ffffff;
}

.nav-lock-icon {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

/* Home Page Auth Lock Notice */
.auth-notice-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.5rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
}

.auth-notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    flex-shrink: 0;
}

.auth-notice-content {
    flex: 1;
}

.auth-notice-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.auth-notice-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.auth-login-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
}

/* Login Page Layout */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 460px;
    margin: 2.5rem auto 3.5rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    margin-top: 1.25rem;
    padding: 2.25rem;
    border-radius: 20px;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.1));
    border: 1px solid var(--border-glow);
    color: var(--accent-violet);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
    margin-bottom: 1rem;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.login-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.9rem 0.75rem 2.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    margin-top: 0.5rem;
}

.login-footer {
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.login-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-notice .notice-icon {
    font-size: 1rem;
    line-height: 1;
}

.login-notice strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.15rem;
}

.login-notice p {
    margin: 0;
}

.back-link {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-purple);
}

@media (max-width: 640px) {
    .auth-notice-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-login-btn {
        width: 100%;
        justify-content: center;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
    }
}


