/* ZaliDating Admin - Same dark theme as LeadHub, pink accent */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,500,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #14141c;
    --bg-elevated: #1c1c28;
    --text-primary: #f4f4f6;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --accent-primary: #ec4899;
    --accent-primary-glow: rgba(236, 72, 153, 0.4);
    --accent-secondary: #6366f1;
    --accent-warning: #fbbf24;
    --accent-danger: #ef4444;
    --accent-info: #38bdf8;
    --accent-success: #10b981;
    --gradient-primary: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    --gradient-border: linear-gradient(135deg, rgba(236, 72, 153, 0.5) 0%, rgba(168, 85, 247, 0.5) 100%);
    --sidebar-width: 260px;
    --header-height: 72px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-primary-glow);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(236, 72, 153, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(236, 72, 153, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

.wrapper { display: flex; min-height: 100vh; }
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.content { flex: 1; padding: 2rem; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-primary) 20%, var(--accent-primary) 80%, transparent);
    opacity: 0.3;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    letter-spacing: -0.02em;
}

.sidebar-brand i {
    width: 40px; height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav .nav { padding: 0 0.75rem; }
.sidebar-nav .nav-item { margin-bottom: 0.25rem; }

.sidebar-nav .nav-link {
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px; height: 60%;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.sidebar-nav .nav-link.active { color: var(--accent-primary); background: rgba(236, 72, 153, 0.08); }
.sidebar-nav .nav-link.active::before { transform: translateY(-50%) scaleY(1); }
.sidebar-nav .nav-link i { font-size: 1.125rem; width: 22px; opacity: 0.8; }
.sidebar-nav .nav-link.active i { opacity: 1; }
.sidebar-nav hr { border-color: rgba(255, 255, 255, 0.06); margin: 1rem 0.75rem; }

/* Navbar */
.navbar {
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.8) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 0 2rem !important;
}

.sidebar-toggle { color: var(--text-secondary) !important; padding: 0.5rem !important; }
.navbar .text-muted { color: var(--text-secondary) !important; font-size: 0.875rem; }

.navbar .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.navbar .btn-outline-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-lg);
    padding: 1px;
    background: var(--gradient-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.bg-primary-soft { background: rgba(236, 72, 153, 0.12); color: var(--accent-primary); }
.stat-card .stat-icon.bg-success-soft { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-card .stat-icon.bg-warning-soft { background: rgba(251, 191, 36, 0.12); color: var(--accent-warning); }
.stat-card .stat-icon.bg-info-soft { background: rgba(56, 189, 248, 0.12); color: var(--accent-info); }

.stat-card .stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

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

/* Table Cards */
.table-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.table-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
}

.table-card .card-header h5 { color: var(--text-primary); font-weight: 600; font-size: 1rem; margin: 0; }
.table-card .card-body { padding: 1.5rem; }

.table { margin-bottom: 0; color: var(--text-primary); background: var(--bg-card) !important; }
.table-responsive { background: var(--bg-card) !important; }
.table thead { background: var(--bg-tertiary) !important; }

.table thead th {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1.25rem;
}

.table tbody { background: var(--bg-card) !important; }

.table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
}

.table tbody tr { transition: background 0.15s ease; background: var(--bg-card) !important; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.04) !important; }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: 'JetBrains Mono', monospace;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-info { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.badge-secondary { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.badge.bg-primary { background: var(--gradient-primary) !important; color: #fff !important; font-weight: 600; }

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px var(--accent-primary-glow);
}

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

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: transparent;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-light, .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-light:hover, .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Forms */
.form-control, .form-select {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus, .form-select:focus {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
    color: var(--text-primary);
}

.form-label { color: var(--text-secondary); font-weight: 500; font-size: 0.8125rem; margin-bottom: 0.5rem; }

/* Charts */
.chart-container { position: relative; height: 280px; padding: 0.5rem; }

/* Pagination */
.pagination { gap: 0.375rem; }
.pagination .page-link {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
}

.pagination .page-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.pagination .page-item.active .page-link { background: var(--gradient-primary); border-color: transparent; color: #fff; }
.pagination .page-item.disabled .page-link { background: transparent; color: var(--text-muted); opacity: 0.5; }

/* Modals */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
}

.modal-header { border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding: 1.25rem 1.5rem; }
.modal-title { color: var(--text-primary); font-weight: 600; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 1rem 1.5rem; }
.btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: 0.5; }
.btn-close:hover { opacity: 0.8; }

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.login-card .subtitle { color: var(--text-muted); margin-bottom: 2rem; }

/* Alerts */
.alert {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius);
    color: var(--text-primary);
}

.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); color: #34d399; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #f87171; }
.alert-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.alert-info { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.2); color: #7dd3fc; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; color: var(--accent-primary); }

/* Health Status Dot */
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.status-dot.unknown { background: #5a5a6e; }

/* Live indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.live-indicator::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent-primary-glow);
}

/* Funnel */
.funnel-step {
    text-align: center;
    padding: 1rem;
    position: relative;
}

.funnel-step .funnel-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
}

.funnel-step .funnel-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.funnel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stat-card { animation: fadeInUp 0.5s ease forwards; }
.row > [class*="col-"]:nth-child(1) .stat-card { animation-delay: 0s; }
.row > [class*="col-"]:nth-child(2) .stat-card { animation-delay: 0.1s; }
.row > [class*="col-"]:nth-child(3) .stat-card { animation-delay: 0.2s; }
.row > [class*="col-"]:nth-child(4) .stat-card { animation-delay: 0.3s; }

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
hr { border-color: rgba(255, 255, 255, 0.06); opacity: 1; }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-primary); }

code {
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent-primary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content { padding: 1.25rem; }
    .stat-card .stat-value { font-size: 1.75rem; }
}
