/* CogniKin Design System
 * Core styles extracted from how.cognikin.me
 * Dark theme with neon green accents, glass morphism, particle effects
 */

/* ============================================================
   CSS Custom Properties
   ============================================================ */

:root {
    --bg-deep: #050510;
    --bg-mid: #0a0a2e;
    --bg-glow: #0d1117;
    --green-bright: #00ff88;
    --green-mid: #0d9373;
    --green-dim: #064e3b;
    --gold: #ffd700;
    --gold-dim: #c5a55a;
    --red: #ff4444;
    --red-dim: #7f2222;
    --text-primary: #e8e8f0;
    --text-secondary: rgba(232, 232, 240, 0.65);
    --text-dim: rgba(232, 232, 240, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

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

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

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    background: linear-gradient(135deg, var(--text-primary), var(--green-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-primary);
}

h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

p {
    color: var(--text-secondary);
    max-width: 65ch;
}

.mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
}

.text-green { color: var(--green-bright); }
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-red { color: var(--red); }

a {
    color: var(--green-bright);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.8;
}

/* ============================================================
   Glass Morphism Cards
   ============================================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.glass-sm {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.glass:hover {
    border-color: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.05);
}

/* ============================================================
   Layout
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ============================================================
   Navigation
   ============================================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    background: rgba(5, 5, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-brand-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--green-bright), var(--green-mid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    color: var(--green-bright);
}

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

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-dim), var(--green-mid));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--green-bright);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-bright), var(--green-mid));
    color: var(--bg-deep);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--green-bright);
    color: var(--green-bright);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

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

/* ============================================================
   Forms
   ============================================================ */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    transition: border-color var(--transition);
    outline: none;
    width: 100%;
}

.input:focus {
    border-color: var(--green-bright);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

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

.input-otp {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5em;
    padding: 18px;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover td {
    background: rgba(0, 255, 136, 0.02);
}

/* ============================================================
   Entity Cards
   ============================================================ */

.entity-card {
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition);
}

.entity-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 136, 0.2);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.08);
}

.entity-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.entity-card-acn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.entity-card-type {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
    background: rgba(0, 255, 136, 0.08);
    color: var(--green-bright);
}

/* ============================================================
   Badges & Tags
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
}

.badge-green {
    background: rgba(0, 255, 136, 0.1);
    color: var(--green-bright);
}

.badge-gold {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.badge-red {
    background: rgba(255, 68, 68, 0.1);
    color: var(--red);
}

.badge-dim {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

/* ============================================================
   Group Headers
   ============================================================ */

.group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 32px 0 16px;
}

.group-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
}

.group-header-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    white-space: nowrap;
}

/* ============================================================
   Stat Cards
   ============================================================ */

.stat-card {
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--green-bright), var(--green-mid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ============================================================
   Loading / Spinner
   ============================================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--green-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-deep);
    z-index: 1000;
}

.loading-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-dim);
}

/* ============================================================
   Animations
   ============================================================ */

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.2); }
}

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============================================================
   Particles Background
   ============================================================ */

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Ambient gradient blobs */
.ambient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--green-bright);
    top: -100px;
    right: -100px;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--green-mid);
    bottom: -50px;
    left: -50px;
    animation: blobFloat 25s ease-in-out infinite reverse;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ============================================================
   Page Content Wrapper
   ============================================================ */

.page-content {
    position: relative;
    z-index: 1;
    padding-top: 80px;
    min-height: 100vh;
}

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

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 16px;
    }
    .nav {
        padding: 12px 16px;
    }
    .nav-links {
        display: none;
    }
    .page-content {
        padding-top: 68px;
    }
}
