/* ==================== CSS RESET & VARIABLES ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Dark Premium Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --bg-card: rgba(22, 22, 35, 0.7);
    --bg-card-hover: rgba(30, 30, 48, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-strong: rgba(255, 255, 255, 0.06);

    /* Accent Colors */
    --accent-primary: #6c5ce7;
    --accent-primary-rgb: 108, 92, 231;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --accent-gradient-hover: linear-gradient(135deg, #7c6cf7, #b2abfe);

    /* Semantic Colors */
    --color-success: #00b894;
    --color-success-bg: rgba(0, 184, 148, 0.1);
    --color-warning: #fdcb6e;
    --color-warning-bg: rgba(253, 203, 110, 0.1);
    --color-danger: #e17055;
    --color-danger-bg: rgba(225, 112, 85, 0.1);
    --color-info: #74b9ff;
    --color-info-bg: rgba(116, 185, 255, 0.1);

    /* Stat card colors */
    --stat-following: #74b9ff;
    --stat-followers: #a29bfe;
    --stat-mutual: #00b894;
    --stat-notback: #e17055;
    --stat-notfollowing: #fdcb6e;
    --stat-ratio: #fd79a8;

    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #9a9ab0;
    --text-muted: #5a5a70;
    --text-inverse: #0a0a0f;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(108, 92, 231, 0.3);

    /* 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 30px rgba(108, 92, 231, 0.15);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== BACKGROUND ANIMATION ==================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.3), transparent 70%);
    top: -150px;
    right: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(162, 155, 254, 0.2), transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 18s ease-in-out infinite;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, 80px) scale(1.1); }
    66% { transform: translate(40px, -40px) scale(0.9); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(80px, -60px) scale(1.15); }
    66% { transform: translate(-50px, 50px) scale(0.85); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ==================== HEADER ==================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.logo-life {
    color: #ff0000;
    -webkit-text-fill-color: #ff0000;
}

.logo-invader {
    color: #730000;
    -webkit-text-fill-color: #730000;
    font-weight: 400;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(0, 184, 148, 0); }
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ==================== UPLOAD SECTION ==================== */
.upload-section {
    animation: fadeInUp 0.6s ease-out;
}

.upload-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-icon-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.2), transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
}

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

.hero-icon {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Upload Zone */
.upload-zone {
    position: relative;
    max-width: 640px;
    margin: 0 auto 2.5rem;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: var(--transition-base);
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition-base);
    border-radius: var(--radius-xl);
}

.upload-zone:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.upload-zone:hover::before {
    opacity: 0.03;
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 0 40px rgba(var(--accent-primary-rgb), 0.2);
}

.upload-zone-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-icon-animated {
    color: var(--accent-secondary);
    animation: uploadBounce 3s ease-in-out infinite;
}

@keyframes uploadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upload-text-primary {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-text-secondary {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-file-types {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.upload-selected {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--accent-primary-rgb), 0.08);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.selected-file-icon {
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.upload-selected span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.remove-file-btn:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* Instructions */
.instructions-card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.instructions-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-glass-strong);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.instructions-header svg {
    color: var(--accent-secondary);
}

.instructions-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.instruction-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.step-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-content kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
}


/* ==================== LOADING SECTION ==================== */
.loading-section {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.loading-card {
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent-primary);
    animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
    inset: 8px;
    border-right-color: var(--accent-secondary);
    animation: spin 1.6s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    inset: 16px;
    border-bottom-color: var(--color-success);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.loading-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-glass-strong);
    border-radius: var(--radius-full);
    margin: 0 auto;
    overflow: hidden;
}

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

/* ==================== RESULTS SECTION ==================== */
.results-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Action bar */
.results-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
}

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

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

.action-btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(var(--accent-primary-rgb), 0.3);
}

.action-btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(var(--accent-primary-rgb), 0.4);
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-base);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.stat-card-following::before { background: var(--stat-following); }
.stat-card-followers::before { background: var(--stat-followers); }
.stat-card-mutual::before { background: var(--stat-mutual); }
.stat-card-notback::before { background: var(--stat-notback); }
.stat-card-notfollowing::before { background: var(--stat-notfollowing); }
.stat-card-ratio::before { background: var(--stat-ratio); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-following .stat-icon { background: rgba(116, 185, 255, 0.1); color: var(--stat-following); }
.stat-card-followers .stat-icon { background: rgba(162, 155, 254, 0.1); color: var(--stat-followers); }
.stat-card-mutual .stat-icon { background: rgba(0, 184, 148, 0.1); color: var(--stat-mutual); }
.stat-card-notback .stat-icon { background: rgba(225, 112, 85, 0.1); color: var(--stat-notback); }
.stat-card-notfollowing .stat-icon { background: rgba(253, 203, 110, 0.1); color: var(--stat-notfollowing); }
.stat-card-ratio .stat-icon { background: rgba(253, 121, 168, 0.1); color: var(--stat-ratio); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

/* ==================== ANALYTICS ROW ==================== */
.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card,
.insights-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.card-title svg {
    color: var(--accent-secondary);
}

.chart-container {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Insights */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.insight-item:hover {
    background: var(--bg-glass-strong);
    border-color: var(--border-medium);
}

.insight-emoji {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.insight-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== USER LISTS ==================== */
.user-lists-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Tabs */
.tabs-wrapper {
    overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs {
    display: flex;
    min-width: max-content;
    padding: 0 0.5rem;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--text-secondary);
    background: var(--bg-glass);
}

.tab.active {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-primary);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: var(--radius-full);
    background: var(--bg-glass-strong);
    font-size: 0.7rem;
    font-weight: 600;
}

.tab.active .tab-count {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-secondary);
}

/* List controls */
.list-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
}

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

.search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

.search-clear:hover {
    color: var(--text-primary);
}

.sort-controls {
    display: flex;
    gap: 0.375rem;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.7rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

.sort-btn.active {
    color: var(--accent-secondary);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    background: rgba(var(--accent-primary-rgb), 0.08);
}

/* User list */
.user-list-container {
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.user-list-container::-webkit-scrollbar {
    width: 6px;
}

.user-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.user-list-container::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.user-list {
    padding: 0.5rem;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    gap: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.user-item:hover {
    background: var(--bg-glass-strong);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.user-index {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-glass-strong);
    transition: var(--transition-fast);
}

.user-item:hover .user-avatar {
    border-color: rgba(var(--accent-primary-rgb), 0.3);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.visit-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-secondary);
}

.visit-btn.visited {
    background: var(--color-success-bg);
    border-color: rgba(0, 184, 148, 0.3);
    color: var(--color-success);
}

/* List empty */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.list-empty p {
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-secondary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==================== TOAST ==================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 420px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

.toast.removing {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

.toast-success { border-left: 3px solid var(--color-success); }
.toast-success .toast-icon { color: var(--color-success); }

.toast-error { border-left: 3px solid var(--color-danger); }
.toast-error .toast-icon { color: var(--color-danger); }

.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-warning .toast-icon { color: var(--color-warning); }

.toast-info { border-left: 3px solid var(--color-info); }
.toast-info .toast-icon { color: var(--color-info); }

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

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100px); opacity: 0; }
}

/* ==================== FOOTER ==================== */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 1.5rem 1rem 3rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.875rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-controls {
        justify-content: flex-start;
    }

    .results-action-bar {
        flex-direction: column;
    }

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

    .upload-zone {
        padding: 2rem 1.25rem;
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

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

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== FOOTER ADMIN TRIGGER ==================== */
.footer-admin-trigger {
    cursor: default;
    user-select: none;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    display: inline-block;
}

.footer-admin-trigger:hover {
    color: var(--text-secondary);
}

/* ==================== ADMIN PANEL ==================== */
.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease-out;
}

.admin-overlay.active {
    display: flex;
}

.admin-modal {
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(231, 76, 60, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Admin Login */
.admin-login {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.admin-login-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e74c3c;
    margin-bottom: 0.75rem;
}

.admin-login-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-login-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.admin-input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 360px;
}

.admin-input {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.admin-input:focus {
    border-color: rgba(231, 76, 60, 0.5);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.admin-login-btn {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-base);
}

.admin-login-btn:hover {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

.admin-error {
    font-size: 0.8rem;
    color: #e74c3c;
    min-height: 1.2em;
    margin-top: 0.5rem;
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
}

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

.admin-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.admin-title svg {
    color: #e74c3c;
}

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

.admin-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    background: var(--color-danger-bg);
    border: 1px solid rgba(225, 112, 85, 0.2);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-danger);
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-clear-btn:hover {
    background: rgba(225, 112, 85, 0.2);
    border-color: rgba(225, 112, 85, 0.4);
}

.admin-password-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.admin-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

/* Admin Stats */
.admin-stats-row {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.admin-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #e74c3c;
}

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

/* Admin Logs */
.admin-logs-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.admin-export-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.7rem;
    background: rgba(var(--accent-primary-rgb), 0.1);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-export-all-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.2);
}

.admin-logs-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.admin-logs-list::-webkit-scrollbar {
    width: 5px;
}

.admin-logs-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.admin-logs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.admin-log-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.admin-log-item:hover {
    background: var(--bg-glass-strong);
    border-color: var(--border-subtle);
}

.admin-log-index {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 24px;
    text-align: center;
}

.admin-log-info {
    flex: 1;
    min-width: 0;
}

.admin-log-filename {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-log-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.2rem;
}

.admin-log-ip,
.admin-log-date,
.admin-log-size {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-log-ip {
    color: #e74c3c;
    font-weight: 600;
}

.admin-log-download {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.admin-log-download:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-secondary);
}

@media (max-width: 640px) {
    .admin-modal {
        max-height: 90vh;
    }

    .admin-stats-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-log-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-log-download {
        width: 100%;
        justify-content: center;
    }
}
