:root {
    --bg-dark: #0A0A0A; /* Deep luxury black */
    --card-bg: rgba(20, 20, 20, 0.7); /* Subtle dark grey glass */
    --gold: #E5C158; /* Premium Champagne Gold */
    --gold-glow: rgba(229, 193, 88, 0.3);
    --purple: #C5A059; /* Deeper metallic gold for accents */
    --purple-glow: rgba(197, 160, 89, 0.3);
    --text-white: #F8F8F8;
    --text-gray: #A1A1AA;
    --border: rgba(229, 193, 88, 0.15); /* Subtle gold borders */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    /* Edge-to-edge support */
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* Hide scrollbars for native feel */
::-webkit-scrollbar {
    display: none;
}

/* Sticky Top Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: var(--safe-area-top);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--purple);
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Feed Container */
#feed-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 80px 0; /* padding bottom for nav bar */
    min-height: 100vh;
}

/* Loader */
.loader {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Post Cards */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin: 16px;
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--purple));
    margin-right: 12px;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.author-handle {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.post-text {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #e2e8f0;
}

.post-media-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #111;
}

.post-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

/* Signal Data Box */
.signal-data {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.signal-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.signal-metrics strong {
    color: #fff;
    font-size: 1rem;
    display: block;
}

.join-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--purple);
    color: var(--purple);
    padding: 8px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.join-btn:active {
    background: var(--purple);
    color: #fff;
}

/* Action Bar */
.post-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
}

.like-btn.liked {
    color: var(--purple);
}
.like-btn.liked svg {
    fill: var(--purple);
    stroke: var(--purple);
}

/* Sticky Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 10px calc(12px + var(--safe-area-bottom));
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--gold);
}

.nav-item svg {
    transition: transform 0.2s;
}

.nav-item.active svg {
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    #feed-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        min-height: 100vh;
    }
}
