/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: #000;
    font-family: monospace;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Main layout container */
#demo-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    justify-content: flex-start;
}

/* Canvas container - auto height based on content */
#canvas-container {
    position: relative;
    width: 100%;
}

/* Main canvas */
#starfield-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Separator line under starfield (stays fixed) */
#canvas-container::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #444;
    position: relative;
    z-index: 10;
}

/* Navigation bar */
#navbar {
    width: 100%;
    background-color: #000;
    padding: 12px 0;
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    top: var(--pos-navbar-top, 0%);
    padding-left: var(--pos-navbar-left, 0%);
}

/* Nav links container (left side) - aligned with ASCII art left edge */
#nav-links {
    display: flex;
    gap: 40px;
    /* Position can be adjusted via settings */
    margin-left: var(--pos-navlinks-left, 5%);
    margin-top: var(--pos-navlinks-top, 0%);
    transition: margin-left 0.2s ease, margin-top 0.2s ease;
}

/* Navigation links */
.nav-link {
    color: #CC5500;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: text-shadow 0.3s ease, color 0.3s ease;
    /* Subtle glow effect */
    text-shadow: 
        0 0 5px rgba(204, 85, 0, 0.5),
        0 0 10px rgba(204, 85, 0, 0.3);
}

.nav-link:hover {
    color: #FF7722;
    /* Enhanced glow on hover */
    text-shadow: 
        0 0 5px rgba(255, 119, 34, 0.8),
        0 0 15px rgba(255, 119, 34, 0.6),
        0 0 25px rgba(255, 119, 34, 0.4);
}

.nav-link:active {
    color: #FF9944;
}

.nav-link.active {
    color: #FF7722;
    text-shadow: 
        0 0 5px rgba(255, 119, 34, 0.8),
        0 0 15px rgba(255, 119, 34, 0.6);
}

/* Unix timestamp display */
#unix-time {
    color: #666;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 1px;
    cursor: default;
    position: relative;
    margin-top: var(--pos-epoch-top, 0%);
    margin-left: var(--pos-epoch-left, 0%);
}

/* Tooltip for human-readable time */
#unix-time::after {
    content: attr(data-human);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #222;
    color: #999;
    padding: 6px 10px;
    border: 1px solid #444;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
}

#unix-time:hover::after {
    opacity: 1;
}

/* =============================================================================
 * SOCIAL ICONS
 * ============================================================================= */

/* Top row: social icons + epoch counter */
.nav-right-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Social icons container */
.social-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: var(--pos-social-top, 0%);
    margin-left: var(--pos-social-left, 0%);
}

/* Individual social icon link */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.social-icon:hover {
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(153, 153, 153, 0.5));
}

.social-icon img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.6);
}

.social-icon:hover img {
    filter: brightness(0) invert(0.85);
}

/* =============================================================================
 * RECENT POSTS SIDEBAR
 * ============================================================================= */

/* Right side container for timestamp and recent posts */
#nav-right {
    position: absolute;
    right: 40px;
    top: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 320px;
}

/* Recent posts container */
.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: calc(8px + 5vh);
    max-height: 600px;
    overflow-y: auto;
    width: 100%;
}

/* Individual recent post entry */
.recent-post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 1px solid #222;
    transition: all 0.2s ease;
}

.recent-post:last-child {
    border-bottom: none;
}

.recent-post:hover {
    background: rgba(204, 85, 0, 0.1);
}

/* Recent post title - bold, light orange */
.recent-title {
    color: #FF9966;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.recent-post:hover .recent-title {
    color: #FFAA77;
    text-shadow: 0 0 5px rgba(255, 153, 102, 0.5);
}

/* Recent post preview - 6 words, light orange */
.recent-preview {
    color: #CC8855;
    font-size: 10px;
    line-height: 1.3;
    opacity: 0.8;
}

.recent-post:hover .recent-preview {
    opacity: 1;
}

/* Responsive adjustments for sidebar */
@media (max-width: 1200px) {
    .recent-posts {
        display: none;
    }
}

@media (max-width: 768px) {
    #nav-links {
        gap: 20px;
        flex-wrap: wrap;
    }

    .social-icons {
        gap: 8px;
    }

    .social-icon img {
        width: 14px;
        height: 14px;
    }
}
