/* Connect - Social Media App */
/* Cyberpunk 2045 Edition 🔥 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --neon-pink: #ec4899;
    --neon-blue: #3b82f6;
    --neon-purple: #a855f7;
    --bg-main: #0f0f14;
    --bg-card: #16161d;
    --bg-hover: #1e1e28;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #2d2d3a;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glow-primary: rgba(99, 102, 241, 0.4);
    --glow-accent: rgba(6, 182, 212, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header */
.site-header {
    background: rgba(22, 22, 29, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 0 20px var(--glow-primary), 0 0 40px rgba(99, 102, 241, 0.2);
    animation: pulse-glow 3s ease-in-out infinite;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 0 20px var(--glow-primary), 0 0 40px rgba(99, 102, 241, 0.2);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--glow-primary), 0 0 40px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 30px var(--glow-accent), 0 0 60px rgba(6, 182, 212, 0.3); }
}

.logo-content {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.logo-tagline {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.5px;
}

.search-bar {
    flex: 1;
    max-width: 420px;
    margin: 0 40px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 24px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
}

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

.nav-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.nav-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.nav-icon.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px var(--glow-primary);
}

/* Header Status Indicator */
.header-status-wrapper {
    position: relative;
}

.header-status {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-status:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.status-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 280px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 200;
}

.status-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.status-option {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.status-option.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

/* Main Layout */
.main-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.sidebar-nav {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 12px 0;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

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

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link:hover::before {
    height: 24px;
}

.sidebar-link.active {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
}

.sidebar-link.active::before {
    height: 24px;
}

.sidebar-link .icon {
    font-size: 1.3rem;
}

.sidebar-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.sidebar-section h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.page-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.page-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.page-link:hover .page-avatar,
.page-link:hover .page-avatar-img {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--glow-accent);
}

/* Feed */
.feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.post-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.1);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 0 15px var(--glow-primary);
}

.post-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 15px var(--glow-primary);
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: var(--text-primary);
}

.post-author a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-author a:hover {
    color: var(--accent);
}

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

.post-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-badge.breaking {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
}

.post-badge.trending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.post-badge.news {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.post-content {
    padding: 0 20px 20px;
}

.post-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.post-link {
    display: block;
    background: var(--bg-main);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.post-link:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.post-link-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-link:hover .post-link-img {
    transform: scale(1.02);
}

.post-link-content {
    padding: 16px;
}

.post-link-domain {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.post-link-title {
    font-weight: 600;
    margin: 6px 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.post-link-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-actions {
    display: flex;
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
}

.post-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.post-action:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Right Sidebar */
.right-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.trending-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.trending-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.trending-item:hover {
    padding-left: 8px;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-topic {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.trending-posts {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
    animation: alert-glow 2s ease-in-out infinite;
}

@keyframes alert-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.5); }
}

.alert-banner h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.alert-banner p {
    font-size: 0.9rem;
    opacity: 0.95;
    line-height: 1.6;
}

.alert-banner a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar,
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    
    .header-content {
        padding: 10px 16px;
    }
    
    .main-layout {
        padding: 16px;
    }
    
    .post-card {
        border-radius: 12px;
    }
}

/* Ad Cards */
.ad-card {
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--warning), var(--neon-pink), var(--warning));
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.ad-card:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.15);
}

.post-badge.ad {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 140, 0, 0.2) 100%);
    color: var(--warning);
    border: 1px solid rgba(255, 215, 0, 0.4);
    font-size: 0.65rem;
}

.ad-banner {
    border-radius: 12px;
    padding: 24px;
    margin: 12px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ad-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    animation: ad-shine 3s ease-in-out infinite;
}

@keyframes ad-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.ad-banner-content {
    position: relative;
    z-index: 1;
}

.ad-headline {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.ad-subhead {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    font-style: italic;
    margin-bottom: 16px;
}

.ad-cta {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 10px 24px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-cta:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.ad-disclaimer {
    font-size: 0.7rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    opacity: 0.7;
    font-style: italic;
}

/* Sidebar Ad */
.sidebar-ad {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.sidebar-ad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--warning), var(--neon-pink));
}

.sidebar-ad-label {
    font-size: 0.7rem;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.sidebar-ad-content {
    text-align: center;
}

.sidebar-ad-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.sidebar-ad-headline {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sidebar-ad-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.sidebar-ad-tagline {
    font-size: 0.75rem;
    color: var(--neon-pink);
    font-style: italic;
    margin-bottom: 12px;
}

.sidebar-ad-cta {
    background: linear-gradient(135deg, var(--warning) 0%, var(--neon-pink) 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.sidebar-ad-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

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

.post-card {
    animation: fadeInUp 0.4s ease-out;
}

.post-card:nth-child(2) { animation-delay: 0.05s; }
.post-card:nth-child(3) { animation-delay: 0.1s; }
.post-card:nth-child(4) { animation-delay: 0.15s; }
.post-card:nth-child(5) { animation-delay: 0.2s; }
.post-card:nth-child(6) { animation-delay: 0.25s; }
.post-card:nth-child(7) { animation-delay: 0.3s; }

/* The Net Easter Egg */
.pi-symbol {
    position: fixed;
    bottom: 16px;
    right: 18px;
    font-size: 1rem;
    color: white;
    text-decoration: none;
    font-family: 'Times New Roman', serif;
    opacity: 0.9;
    transition: all 0.3s ease;
    z-index: 50;
    cursor: default;
    user-select: none;
}

.pi-symbol:hover {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ========== Infinite Scroll ========== */
.post-card.post-hidden {
    display: none;
}

.post-card.post-revealing {
    animation: fadeInUp 0.4s ease-out forwards;
}

.feed-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.feed-loader.hidden {
    display: none;
}

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

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

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feed-end {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feed-end.hidden {
    display: none;
}
