/* === COVER PHOTO === */
.cover-photo {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  aspect-ratio: 820 / 312;
  overflow: hidden;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  position: relative;
}

.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 70%;
  display: block;
}

.cover-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-photo-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* === PROFILE BAR === */
.profile-bar {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.profile-bar-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-top: -60px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  border: 5px solid var(--bg-primary);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Profile picture viewer overlay */
.profile-viewer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-viewer-overlay.active {
  display: flex;
}

.profile-viewer-overlay img {
  max-width: min(90vw, 500px);
  max-height: 90vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
}

.profile-info {
  padding-top: 68px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-handle {
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 400;
}

.profile-stats {
  display: flex;
  gap: var(--space-md);
  margin-top: 4px;
}

.profile-stat {
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 300;
}

.profile-stat strong {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Bio */
.profile-bio {
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 400;
}

/* Links */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.profile-link {
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.profile-link:hover {
  text-decoration: underline;
}

.profile-stat-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
}

.profile-stat-link:hover {
  text-decoration: underline;
}

/* === FEED LAYOUT === */
.feed-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

.featured-section {
  margin-bottom: var(--space-sm);
}

/* === POST CARD === */
.post-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-card.featured {
  box-shadow: var(--shadow-md);
  position: relative;
  border: 1.5px solid var(--accent);
}

.post-card.featured::before {
  content: 'BUREAU APPROVED';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--accent);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  letter-spacing: 0.06em;
  z-index: 1;
  border-radius: var(--radius-full);
}

/* Post author & metadata bar */
.post-author-bar {
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.post-author-name {
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.post-type-label {
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}

.post-timestamp {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  margin-left: auto;
}

/* Post content area */
.post-content {
  padding: var(--space-xs) var(--space-md) var(--space-md);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
}

/* Photo posts */
.post-media img {
  width: 100%;
  display: block;
}

/* Video posts */
.post-media .video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.post-media .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Link posts */
.post-link {
  display: block;
  padding: var(--space-md);
  margin: 0 var(--space-md) var(--space-md);
  background: var(--bg-primary);
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.post-link:hover {
  background: var(--border-color);
}

.post-link-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-link-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0;
  margin-bottom: 2px;
}

.post-link-url {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* Post actions bar */
.post-actions {
  padding: var(--space-sm) var(--space-md) var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Fake likes */
.like-count {
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.like-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 2px;
}

/* Share button */
.share-btn {
  padding: 4px 14px;
  background: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.share-btn:hover {
  background: var(--text-primary);
  color: #FFFFFF;
}

.share-btn.copied {
  background: var(--accent);
  color: #FFFFFF;
}

/* =============================================
   AD CARD — FACEBOOK STYLE
   ============================================= */

.ad-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
  border: none;
}

/* Scroll animation — starts hidden, slides up on enter */
.ad-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.ad-animate.ad-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sponsor header row (like Facebook) */
.ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--space-md) 8px;
}

.ad-sponsor-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-sponsor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.ad-sponsor-details {
  display: flex;
  flex-direction: column;
}

.ad-sponsor-name {
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.ad-sponsored-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ad-more {
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  letter-spacing: 1px;
}

/* Body text */
.ad-body-text {
  padding: 0 var(--space-md) 10px;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.45;
}

/* Colorful gradient visual banner */
.ad-visual {
  width: 100%;
  padding: 48px var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ad-visual::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 50%);
  animation: ad-shimmer 4s ease-in-out infinite;
}

@keyframes ad-shimmer {
  0%, 100% { transform: translateX(-10%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(10%) translateY(-5%); opacity: 1; }
}

.ad-visual-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  position: relative;
  animation: ad-float 3s ease-in-out infinite;
}

@keyframes ad-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ad-visual-headline {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Bottom bar (domain + CTA) */
.ad-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--space-md);
  background: var(--bg-primary);
  gap: var(--space-md);
}

.ad-bottom-info {
  flex: 1;
  min-width: 0;
}

.ad-bottom-domain {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ad-bottom-tagline {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.ad-cta {
  display: inline-block;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ad-cta:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Engagement row */
.ad-engagement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.ad-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ad-reaction-icons {
  font-size: 0.9rem;
  letter-spacing: -2px;
}

.ad-reaction-count {
  font-size: var(--font-size-sm);
}

.ad-shares {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* Like / Comment / Share action buttons */
.ad-action-buttons {
  display: flex;
  border-top: 1px solid var(--border-color);
  padding: 2px 4px;
}

.ad-action-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.ad-action-btn:hover {
  background: var(--bg-primary);
}

/* =============================================
   RETRO 8-BIT COMMERCIAL ADS
   ============================================= */

.retro-ad {
  background: #111;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

/* Top label bar */
.retro-label {
  padding: 8px var(--space-md);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #666;
  letter-spacing: 0.05em;
  background: #1a1a1a;
  border-bottom: 2px solid #222;
}

/* CRT Screen */
.retro-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* Scanline overlay */
.retro-screen::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.12) 0px,
    rgba(0,0,0,0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 10;
}

/* CRT vignette */
.retro-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
  z-index: 9;
  pointer-events: none;
}

/* === COMMERCIAL CONTENT LAYOUT === */

.retro-commercial {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 20px;
  gap: 6px;
}

.retro-ad-icon {
  font-size: 2.5rem;
  animation: retro-icon-bounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

@keyframes retro-icon-bounce {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(-8px); }
}

.retro-ad-headline {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  text-align: center;
  line-height: 2;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.8), 0 0 20px currentColor;
  white-space: pre-line;
  animation: retro-headline-glow 2s ease-in-out infinite;
}

@keyframes retro-headline-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; text-shadow: 3px 3px 0 rgba(0,0,0,0.8), 0 0 40px currentColor; }
}

.retro-ad-tagline {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  text-align: center;
  letter-spacing: 0.05em;
  animation: retro-blink-slow 3s ease-in-out infinite;
}

@keyframes retro-blink-slow {
  0%, 40%, 100% { opacity: 1; }
  20% { opacity: 0.3; }
}

/* Scrolling ticker at bottom of screen */
.retro-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: rgba(0,0,0,0.7);
  overflow: hidden;
  z-index: 6;
  display: flex;
  align-items: center;
}

.retro-ticker-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  white-space: nowrap;
  animation: retro-ticker-scroll 12s linear infinite;
}

@keyframes retro-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.33%); }
}

/* === BACKGROUND PARTICLES === */

.retro-star {
  position: absolute;
  background: white;
  border-radius: 0;
  animation: retro-twinkle 1.5s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes retro-twinkle {
  0% { opacity: 0.15; }
  100% { opacity: 0.8; }
}

/* === STYLE: PULSE — radiating rings === */
.retro-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 2px solid;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0;
  animation: retro-ring-expand 3.6s ease-out infinite;
}

@keyframes retro-ring-expand {
  0% { width: 40px; height: 40px; opacity: 0.6; }
  100% { width: 300px; height: 300px; opacity: 0; }
}

/* === STYLE: SCAN — surveillance grid === */
.retro-scanbeam {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 3;
  opacity: 0.4;
  animation: retro-scanbeam-sweep 3s linear infinite;
}

@keyframes retro-scanbeam-sweep {
  0% { top: -2px; opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

.retro-gridline-h, .retro-gridline-v {
  position: absolute;
  z-index: 2;
  opacity: 0.08;
}

.retro-gridline-h {
  left: 0;
  right: 0;
  height: 1px;
}

.retro-gridline-v {
  top: 0;
  bottom: 0;
  width: 1px;
}

/* === STYLE: RADAR — rotating sweep === */
.retro-radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  border: 1px solid;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.2;
}

.retro-radar-sweep::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: currentColor;
  transform-origin: left center;
  animation: retro-radar-rotate 3s linear infinite;
  opacity: 0.5;
}

@keyframes retro-radar-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.retro-blip {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 0;
  z-index: 3;
  animation: retro-blip-flash 1.5s ease-in-out infinite;
}

@keyframes retro-blip-flash {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.8); }
}

/* === STYLE: METER — productivity bar === */
.retro-meter-container {
  position: absolute;
  bottom: 28px;
  left: 10%;
  right: 10%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.retro-meter-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.3rem;
  white-space: nowrap;
}

.retro-meter-bar {
  flex: 1;
  height: 10px;
  background: #222;
  border: 1px solid #444;
  overflow: hidden;
}

.retro-meter-fill {
  height: 100%;
  width: 0%;
  animation: retro-meter-grow 3s ease-in-out infinite;
}

@keyframes retro-meter-grow {
  0% { width: 15%; }
  70% { width: 78%; }
  80% { width: 78%; }
  85% { width: 45%; }
  100% { width: 15%; }
}

.retro-meter-pct {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  animation: retro-blink 0.6s step-end infinite;
}

/* === STYLE: RAIN — data rain === */
.retro-rain-char {
  position: absolute;
  top: -20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  z-index: 2;
  opacity: 0.5;
  animation: retro-rain-fall linear infinite;
}

@keyframes retro-rain-fall {
  0% { transform: translateY(-20px); opacity: 0.7; }
  100% { transform: translateY(400px); opacity: 0; }
}

/* === STYLE: BOUNCE — floating items === */
.retro-float-item {
  position: absolute;
  font-size: 1.2rem;
  z-index: 2;
  opacity: 0.5;
  animation: retro-float-drift ease-in-out infinite alternate;
}

@keyframes retro-float-drift {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(10deg); }
}

/* === SHARED === */
@keyframes retro-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === RETRO INFO BAR === */
.retro-info-bar {
  padding: 10px var(--space-md);
  background: #1a1a1a;
  border-top: 2px solid #333;
}

.retro-publisher {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  color: #888;
  letter-spacing: 0.03em;
}

/* CTA bar */
.retro-cta-bar {
  padding: 10px var(--space-md);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #fff;
  background: #1a1a1a;
  text-align: center;
  letter-spacing: 0.05em;
  border-top: 1px solid #333;
  cursor: pointer;
  transition: background 0.2s ease;
}

.retro-cta-bar:hover {
  background: #2a2a2a;
}

.retro-cta-blink {
  animation: retro-blink 0.6s step-end infinite;
  margin-right: 6px;
}

/* === EMPTY STATE === */
.empty-feed {
  text-align: center;
  padding: var(--space-xl);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 680px) {
  .feed-container {
    padding: var(--space-sm);
  }

  .post-content {
    padding: var(--space-xs) var(--space-md) var(--space-sm);
  }

  .ad-visual {
    padding: 36px var(--space-md);
  }

  .ad-visual-headline {
    font-size: 1.05rem;
  }

  .ad-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .ad-cta {
    text-align: center;
  }

  .post-link {
    margin: 0 var(--space-sm) var(--space-sm);
  }

  .retro-ad-headline {
    font-size: 0.75rem;
  }

  .retro-ad-icon {
    font-size: 2rem;
  }
}
