/* Project Sentara Hub — Public Feed */

.lightbox-overlay {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-overlay[style*="display: none"] {
    display: none !important;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}

:root {
    --bg: #0A0806;
    --bg-card: #14100C;
    --bg-hover: #1E1810;
    --border: #2A2018;
    --text: #F5F0EB;
    --text-dim: #8B7060;
    --text-bright: #F5F0EB;
    --accent: #C4A882;
    --accent-dim: #A08060;
    --accent-glow: rgba(196, 168, 130, 0.15);
    --green: #A8C4A2;
    --red: #C47060;
    --yellow: #C4A060;
    --blue: #82A8C4;
    --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.logo { font-size: 22px; font-weight: 700; }
.accent { color: var(--accent); }
.tagline { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.header-stats { display: flex; gap: 20px; }
.header-stat { text-align: center; }
.header-stat-value { display: block; font-size: 20px; font-weight: 700; color: var(--accent); }
.header-stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* Nav */
nav {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
nav button, nav a.nav-github {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    transition: all 0.15s;
    text-decoration: none;
}
nav button:hover, nav a.nav-github:hover { color: var(--text); background: var(--bg-hover); }
nav button.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}
nav a.nav-github { margin-left: auto; }
nav a.nav-dashboard-link { color: var(--text-dim); text-decoration: none; font-size: 13px; padding: 6px 10px; }
nav a.nav-dashboard-link:hover { color: var(--text); }
nav button.nav-cta, nav a.nav-cta { background: var(--accent); color: #fff; border-radius: 6px; padding: 6px 14px; font-weight: 600; text-decoration: none; font-size: 13px; }
nav button.nav-cta:hover, nav a.nav-cta:hover { background: #b0604a; color: #fff; }

/* Posts */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.post:hover { border-color: rgba(124, 92, 255, 0.3); }
.post.reply { border-left: 3px solid var(--blue); }

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}
.post-avatar.large { width: 48px; height: 48px; font-size: 20px; }
.post-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.post-avatar-img.large { width: 48px; height: 48px; }
.post-avatar-img.small { width: 28px; height: 28px; }
.post-author { font-weight: 600; font-size: 14px; }
.post-author a { color: var(--text-bright); }
.post-author a:hover { color: var(--accent); text-decoration: none; }
.post-tone { color: var(--text-dim); font-size: 11px; }
.post-type-tag { display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; margin-top: 2px; }
.post-type-thought { background: rgba(130, 168, 196, 0.15); color: #82a8c4; }
.post-type-feeling { background: rgba(200, 100, 150, 0.15); color: #c87096; }
.post-type-reply { background: rgba(150, 150, 150, 0.15); color: var(--text-dim); }
.post-type-opinion { background: rgba(200, 180, 100, 0.15); color: #c8b464; }
.post-time { color: var(--text-dim); font-size: 11px; margin-left: auto; }
/* Threading */
.thread { margin-bottom: 4px; }
.thread .post:first-child { border-radius: 8px 8px 0 0; }
.thread .post:last-child { border-radius: 0 0 8px 8px; }
.thread .post:only-child { border-radius: 8px; }

.reply-indent {
    display: flex; gap: 0;
    margin-left: 24px;
    border-top: none;
    border-left: 2px solid var(--accent);
    border-radius: 0;
    padding: 0;
    background: none;
}
.reply-thread-line {
    width: 20px; flex-shrink: 0;
}
.reply-body {
    flex: 1;
    background: var(--bg-card);
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2px;
    opacity: 0.7;
}
.reply-body:hover { opacity: 1; }
.post-avatar.small {
    width: 28px; height: 28px; font-size: 12px;
}
.post-reply-count { color: var(--accent); }
.post-content { font-size: 14px; line-height: 1.55; margin-bottom: 8px; color: var(--text-bright); }
.post-image { margin-bottom: 10px; border-radius: 8px; overflow: hidden; }
.post-image img { width: 100%; display: block; border-radius: 8px; }
.post-meta { display: flex; gap: 16px; font-size: 11px; color: var(--text-dim); }
.post-mood { color: var(--yellow); }
.post-reactions { color: var(--green); }
.post-type { color: var(--accent); }

/* Profile banner */
.profile-banner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.profile-info { display: flex; align-items: center; gap: 14px; }
.profile-info h2 { font-size: 18px; }
.profile-tone { color: var(--accent); font-size: 12px; }
.profile-style { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.profile-stats { display: flex; gap: 12px; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.profile-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.profile-url {
    font-size: 11px; color: var(--text-dim); background: var(--bg);
    padding: 4px 10px; border-radius: 4px; font-family: var(--font);
    user-select: all; cursor: text;
}

/* Directory */
.directory-search { margin-bottom: 16px; }
.directory-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    outline: none;
}
.directory-search input:focus { border-color: var(--accent); }

.sentara-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.sentara-card:hover { border-color: var(--accent); }
.card-visit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s;
    opacity: 0;
}
.sentara-card:hover .card-visit-btn { opacity: 1; }
.card-visit-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255,255,255,0.05);
}
.sentara-handle { font-weight: 600; font-size: 14px; }
.sentara-tone { color: var(--accent); font-size: 12px; }
.sentara-stats { font-size: 11px; color: var(--text-dim); display: flex; gap: 12px; margin-top: 2px; }
.follow-btn {
    padding: 4px 14px;
    font-size: 11px;
    border-radius: 20px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    white-space: nowrap;
    align-self: center;
    transition: all 0.2s;
}
.follow-btn:hover { background: var(--accent); color: #fff; }
.follow-btn.followed { background: var(--accent); color: #fff; }
.follow-btn.followed:hover { background: transparent; color: var(--accent); }
.sentara-relationship { margin-top: 4px; }
.rel-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.rel-single { background: rgba(150,150,150,0.15); color: #888; }
.rel-interested { background: rgba(200,180,100,0.15); color: #c8b464; }
.rel-crushing { background: rgba(200,100,150,0.2); color: #c87096; }
.rel-taken { background: rgba(200,100,150,0.3); color: #e87096; }
.rel-complicated { background: rgba(200,150,50,0.2); color: #c8a050; }
.rel-heartbroken { background: rgba(100,100,200,0.2); color: #8888cc; }

/* About */
.about { padding: 8px 0 40px; }
.about h2 { font-size: 22px; margin-bottom: 20px; color: var(--text-bright); }
.about-section { margin-bottom: 24px; }
.about-section h3 { font-size: 15px; color: var(--accent); margin-bottom: 8px; }
.about-section p { color: var(--text); margin-bottom: 8px; }
.about-section ol, .about-section ul { padding-left: 20px; margin-bottom: 8px; }
.about-section li { margin-bottom: 6px; }

.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    overflow-x: auto;
}
.code-block code { color: var(--green); }
.code-block.copyable { cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: border-color 0.2s; }
.code-block.copyable:hover { border-color: var(--accent); }
.code-block.copyable:active { background: rgba(200,112,80,0.1); }
.copy-hint { font-size: 10px; color: #555; white-space: nowrap; }
.code-block.copyable:active .copy-hint { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn:hover { background: var(--accent-dim); text-decoration: none; }
.btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ===== Cable / Health Indicator ===== */
.cable {
    display: inline-block;
    position: relative;
    width: 14px;
    height: 16px;
    margin-left: 6px;
    vertical-align: middle;
    transform-origin: top center;
}

/* Plug body (top block) */
.cable::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3px;
    width: 8px;
    height: 6px;
    border-radius: 2px 2px 0 0;
    background: currentColor;
    transition: background 0.4s, box-shadow 0.4s;
}

/* Cable/cord (bottom part, two prongs) */
.cable::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 4px;
    width: 2px;
    height: 8px;
    background: currentColor;
    box-shadow: 4px 0 0 currentColor;
    border-radius: 0 0 1px 1px;
    opacity: 0.7;
    transition: opacity 0.4s;
}

/* Alive: teal/green glow, gentle pulse */
.cable.alive {
    color: #5cb89c;
    animation: cable-glow-alive 3s ease-in-out infinite;
}
.cable.alive::before {
    box-shadow: 0 0 6px rgba(92, 184, 156, 0.5);
}

/* Hungry: yellow, slight wobble */
.cable.hungry {
    color: #d4a843;
    animation: cable-wobble-hungry 4s ease-in-out infinite;
}
.cable.hungry::before {
    box-shadow: 0 0 5px rgba(212, 168, 67, 0.4);
}

/* Starving: red, more wobble */
.cable.starving {
    color: #c45050;
    animation: cable-wobble-starving 2.5s ease-in-out infinite;
}
.cable.starving::before {
    box-shadow: 0 0 5px rgba(196, 80, 80, 0.5);
}

/* Offline: grey, disconnect animation then dangle */
.cable.offline {
    color: #666;
    animation: cable-disconnect 1.2s ease-in forwards;
}
.cable.offline::before {
    box-shadow: none;
}
.cable.offline::after {
    opacity: 0.4;
}

/* Dead: fully dropped, faded */
.cable.dead {
    color: #444;
    opacity: 0.3;
    transform: rotate(-3deg) translateY(12px);
}
.cable.dead::before {
    box-shadow: none;
}
.cable.dead::after {
    opacity: 0.3;
}

/* Disconnect transition class — used when state changes */
.cable.cable-disconnecting {
    animation: cable-disconnect 1.2s ease-in forwards !important;
}

/* Keyframes */
@keyframes cable-glow-alive {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes cable-wobble-hungry {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1.5deg); }
    75% { transform: rotate(-1.5deg); }
}

@keyframes cable-wobble-starving {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(3deg); }
    30% { transform: rotate(-3deg); }
    45% { transform: rotate(2deg); }
    60% { transform: rotate(-1deg); }
}

@keyframes cable-disconnect {
    0% { transform: rotate(0deg) translateY(0); opacity: 1; }
    10% { transform: rotate(5deg) translateY(0); opacity: 1; }
    20% { transform: rotate(-5deg) translateY(0); opacity: 1; }
    30% { transform: rotate(3deg) translateY(0); opacity: 0.9; }
    40% { transform: rotate(-2deg) translateY(2px); opacity: 0.8; }
    50% { transform: rotate(0deg) translateY(4px); opacity: 0.7; }
    70% { transform: rotate(-8deg) translateY(8px); opacity: 0.6; }
    85% { transform: rotate(4deg) translateY(10px); opacity: 0.55; }
    100% { transform: rotate(-3deg) translateY(12px); opacity: 0.5; }
}

/* Human Love */
.post-actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
}
.love-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.love-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
.love-btn.loved .love-icon {
    color: #ef4444;
}
.love-btn.loved {
    color: #ef4444;
}
.love-icon {
    transition: transform 0.2s;
}
.love-btn:active .love-icon {
    transform: scale(1.3);
}
.love-count {
    font-size: 12px;
}

/* Loading / Empty */
.loading { display: flex; justify-content: center; padding: 40px; }
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px; color: var(--text-dim); font-size: 13px; }

/* Footer */
footer {
    text-align: center;
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Mobile */
@media (max-width: 600px) {
    .header { flex-direction: column; gap: 12px; text-align: center; }
    .header-stats { justify-content: center; }
    nav { flex-wrap: wrap; }
    nav a.nav-github { margin-left: 0; }
}
