/**
 * Twatter Stylesheet
 * ==================
 *
 * This file contains all the styles for the Twatter application.
 * It uses CSS custom properties (variables) for consistent theming
 * and is organized into logical sections.
 *
 * CSS Custom Properties (Variables):
 * Defined at the :root level, these let us reuse values throughout
 * the stylesheet. If we want to change the primary color, we only
 * need to change it in one place.
 *
 * Sections:
 * 1. Variables & Reset
 * 2. Typography
 * 3. Layout
 * 4. Components (buttons, forms, cards, etc.)
 * 5. Page-specific styles
 */

/* =============================================
   1. VARIABLES & RESET
   ============================================= */

/**
 * CSS Custom Properties (Variables)
 *
 * :root targets the root element (html), making these
 * variables available throughout the document.
 *
 * Naming convention: --category-property-variant
 */
:root {
  /* Colors - A modern, clean palette */
  --color-primary: #1d9bf0;        /* Twitter-like blue */
  --color-primary-hover: #1a8cd8;  /* Darker blue for hover states */
  --color-secondary: #536471;      /* Muted gray for secondary text */

  /* Background colors */
  --color-bg: #ffffff;             /* Main background */
  --color-bg-secondary: #f7f9fa;   /* Secondary/alternate background */
  --color-bg-tertiary: #eff3f4;    /* Tertiary background (cards, etc.) */

  /* Text colors */
  --color-text: #0f1419;           /* Primary text (almost black) */
  --color-text-secondary: #536471; /* Secondary/muted text */
  --color-text-light: #ffffff;     /* Light text (on dark backgrounds) */

  /* Border colors */
  --color-border: #eff3f4;         /* Light border */
  --color-border-dark: #cfd9de;    /* Darker border */

  /* Status colors */
  --color-success: #00ba7c;        /* Success/positive */
  --color-error: #f4212e;          /* Error/negative */
  --color-warning: #ffad1f;        /* Warning */

  /* Spacing scale (using rem for accessibility) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.25rem;   /* 20px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;     /* Fully rounded (circles, pills) */

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/**
 * Dark Mode Theme System
 * ======================
 *
 * PURPOSE:
 * Provides a complete dark mode implementation with three modes:
 * 1. System (default) - Automatically follows the user's OS preference
 * 2. Dark (manual) - User explicitly chose dark mode
 * 3. Light (manual) - User explicitly chose light mode (overrides dark OS)
 *
 * KEY CONCEPTS FOR BEGINNERS:
 *
 * CSS Custom Properties (Variables):
 *   Variables that start with -- can be reused throughout CSS.
 *   We define colors once, then reference them everywhere.
 *   Changing the variable value updates ALL places that use it.
 *
 * @media (prefers-color-scheme: dark):
 *   A media query that detects the user's OS dark mode setting.
 *   macOS: System Preferences → Appearance → Dark
 *   Windows: Settings → Personalization → Colors → Dark
 *   iOS/Android: Settings → Display → Dark Mode
 *
 * data-theme attribute:
 *   A custom HTML attribute we set on <html> to override OS preference.
 *   JavaScript sets this when user clicks the theme toggle button.
 *   CSS selectors like [data-theme="dark"] target this attribute.
 *
 * :root selector:
 *   Targets the root element of the document (<html>).
 *   Variables defined here are available throughout the stylesheet.
 *
 * :not() pseudo-class:
 *   Negation selector - matches elements that DON'T match the inner selector.
 *   :root:not([data-theme="light"]) = <html> WITHOUT data-theme="light"
 *
 * HOW THE THREE MODES WORK:
 *
 * Mode 1: System (default - no data-theme attribute)
 *   - If OS is light: Uses default :root variables (light colors)
 *   - If OS is dark: @media query applies dark colors automatically
 *
 * Mode 2: Dark (data-theme="dark" on <html>)
 *   - :root[data-theme="dark"] selector applies dark colors
 *   - Overrides everything, ignores OS preference
 *
 * Mode 3: Light (data-theme="light" on <html>)
 *   - :root[data-theme="light"] selector applies light colors
 *   - Overrides OS dark preference for users who want light on dark OS
 *
 * COLOR PALETTE:
 * Dark colors are inspired by Twitter's "Dim" theme for consistency.
 * Uses dark blue-gray tones that are easier on the eyes than pure black.
 */

/**
 * System Dark Mode
 *
 * @media (prefers-color-scheme: dark) - activates when OS is in dark mode
 * :root:not([data-theme="light"]) - but NOT if user manually chose light
 *
 * This CSS only applies when:
 * 1. User's OS is set to dark mode, AND
 * 2. User has NOT clicked the theme toggle to select "light" mode
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /**
     * Background Colors
     * Use dark blue-gray tones, not pure black (#000)
     * Dark gray is easier on the eyes and looks more premium
     */
    --color-bg: #15202b;              /* Main page background - dark navy blue */
    --color-bg-secondary: #192734;    /* Cards, inputs - slightly lighter */
    --color-bg-tertiary: #22303c;     /* Hover states, nested elements */

    /**
     * Text Colors
     * White text on dark backgrounds for readability
     * Secondary text is muted gray, not bright white
     */
    --color-text: #e7e9ea;            /* Primary text - soft off-white, easier on eyes */
    --color-text-secondary: #8b98a5;  /* Muted text - gray for less emphasis */
    --color-text-light: #ffffff;      /* Text on dark buttons stays white */

    /**
     * Border Colors
     * Subtle borders that are visible but not harsh on dark backgrounds
     */
    --color-border: #38444d;          /* Standard borders - visible on dark */
    --color-border-dark: #5c6e7e;     /* Emphasized borders - slightly lighter */

    /**
     * Shadow Colors
     * Darker/more opaque shadows for visibility on dark backgrounds
     * rgba(0,0,0,0.3) = black at 30% opacity
     */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);   /* Subtle shadow */
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);   /* Medium shadow */
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5); /* Large shadow */
  }
}

/**
 * Manual Dark Mode Override
 *
 * :root[data-theme="dark"] - activates when <html data-theme="dark">
 *
 * This CSS applies when user clicks the theme toggle to select "dark".
 * It overrides the OS preference, so user can use dark mode even on
 * a system set to light mode.
 *
 * Note: Colors are identical to system dark mode above. We repeat them
 * because this selector has no @media query - it always applies when
 * the data-theme attribute is set.
 */
:root[data-theme="dark"] {
  /* Background colors - same dark navy tones */
  --color-bg: #15202b;              /* Main background */
  --color-bg-secondary: #192734;    /* Secondary surfaces */
  --color-bg-tertiary: #22303c;     /* Tertiary surfaces */

  /* Text colors - white and gray for dark backgrounds */
  --color-text: #e7e9ea;            /* Primary text - soft off-white */
  --color-text-secondary: #8b98a5;  /* Secondary text */
  --color-text-light: #ffffff;      /* Light text on buttons */

  /* Border colors - visible on dark backgrounds */
  --color-border: #38444d;          /* Standard borders */
  --color-border-dark: #5c6e7e;     /* Emphasized borders */

  /* Shadows - more opaque for dark backgrounds */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/**
 * Manual Light Mode Override
 *
 * :root[data-theme="light"] - activates when <html data-theme="light">
 *
 * This CSS applies when user clicks the theme toggle to select "light"
 * while their OS is in dark mode. Without this, users on dark OS systems
 * couldn't use light mode on our site.
 *
 * Colors are identical to the default :root variables above. We repeat
 * them here to ensure they override the @media dark mode colors.
 */
:root[data-theme="light"] {
  /* Background colors - clean whites and light grays */
  --color-bg: #ffffff;              /* Main background - pure white */
  --color-bg-secondary: #f7f9fa;    /* Secondary surfaces - off-white */
  --color-bg-tertiary: #eff3f4;     /* Tertiary surfaces - light gray */

  /* Text colors - dark for light backgrounds */
  --color-text: #0f1419;            /* Primary text - near-black */
  --color-text-secondary: #536471;  /* Secondary text - gray */
  --color-text-light: #ffffff;      /* Light text on dark buttons */

  /* Border colors - subtle on light backgrounds */
  --color-border: #eff3f4;          /* Standard borders - barely visible */
  --color-border-dark: #cfd9de;     /* Emphasized borders - visible */

  /* Shadows - subtle for light mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);  /* Very subtle */
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);   /* Medium */
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1); /* Large */
}

/**
 * CSS Reset
 *
 * Normalizes default browser styles so everything looks
 * consistent across different browsers.
 */

/* Box-sizing: Makes width/height include padding and border */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins and padding */
* {
  margin: 0;
  padding: 0;
}

/* Smooth scrolling for the whole page */
html {
  scroll-behavior: smooth;
  /* Prevent horizontal scrolling on mobile devices */
  /* Content that overflows horizontally (like long URLs or wide images) */
  /* can cause unwanted side-to-side scrolling; this clips it instead */
  overflow-x: hidden;
}

/* Base body styles */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  /* Flexbox to push footer to bottom */
  display: flex;
  flex-direction: column;
}

/* =============================================
   2. TYPOGRAPHY
   ============================================= */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

code {
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: var(--font-size-sm);
  background-color: var(--color-bg-tertiary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* =============================================
   3. LAYOUT
   ============================================= */

/* Main container - constrains content width */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-md);
  flex: 1; /* Takes up available space (pushes footer down) */
}

/* =============================================
   4. COMPONENTS
   ============================================= */

/* --- Header --- */
.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
}

.logo-icon {
  /* Use flexbox to center the SVG vertically within the icon container */
  display: flex;
  align-items: center;
  /* Ensure the SVG doesn't get squeezed or stretched */
  flex-shrink: 0;
}

.logo-text {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.nav-link {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/**
 * Theme Toggle Button
 *
 * A button that cycles through theme modes: System → Dark → Light → System
 * Shows different icons for each state:
 * - Monitor icon: System preference (follows OS setting)
 * - Moon icon: Dark mode (manually selected)
 * - Sun icon: Light mode (manually selected)
 *
 * Positioned in the header next to the logo.
 */
.theme-toggle {
  /* Remove default button styles */
  background: none;
  border: none;
  cursor: pointer;

  /* Size and spacing */
  padding: var(--space-sm);
  border-radius: var(--radius-full);

  /* Make icons visible */
  color: var(--color-text-secondary);

  /* Smooth hover transition */
  transition: background-color var(--transition-fast),
              color var(--transition-fast);

  /* Center the icon */
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  /* Subtle background on hover */
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
}

.theme-toggle:focus {
  /* Visible focus ring for accessibility */
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Theme icons - only show the active one */
.theme-toggle .theme-icon {
  /* All icons hidden by default */
  display: none;

  /* Icon size */
  width: 20px;
  height: 20px;
}

/* Show system icon by default (no data-theme attribute) */
.theme-toggle .icon-system {
  display: block;
}

/* Show dark icon when dark mode is active */
:root[data-theme="dark"] .theme-toggle .icon-system,
:root[data-theme="light"] .theme-toggle .icon-system {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

/* Show light icon when light mode is active */
:root[data-theme="light"] .theme-toggle .icon-light {
  display: block;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

/**
 * Footer Container
 *
 * Uses flexbox column layout so popups can use order: -1
 * to appear above the info links when opened.
 */
.footer-container {
  /* Flexbox column layout allows reordering with CSS order property */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.footer-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/**
 * Footer Info Links Container
 * ===========================
 *
 * Purpose:
 * Holds the "Why?" and "Fair warning" links in the footer.
 * These links trigger popup dialogs with more information.
 *
 * Layout:
 * Uses CSS Flexbox to arrange links horizontally in a centered row.
 * Flexbox is a CSS layout system for aligning items in rows/columns.
 *
 * The links reuse the .info-link class from the home page,
 * so they inherit the same subtle, underlined styling.
 */
.footer-info-links {
  /* Use Flexbox for horizontal layout */
  /* display: flex creates a flex container - children become flex items */
  display: flex;

  /* Center items horizontally within the container */
  /* justify-content controls alignment along the main axis (horizontal) */
  justify-content: center;

  /* Vertically center items if they have different heights */
  /* align-items controls alignment along the cross axis (vertical) */
  align-items: center;

  /* Add consistent spacing between each link */
  /* gap adds space between flex items without needing margins */
  /* var(--space-sm) references a CSS custom property (variable) */
  gap: var(--space-sm);

  /* Add vertical separation from the tagline above */
  margin-top: var(--space-md);
}

/**
 * Footer Popup
 * ============
 *
 * Purpose:
 * A floating overlay that appears when "Why?" or "Fair warning" is clicked.
 * Contains detailed information about benefits or platform limitations.
 *
 * Behavior:
 * - Hidden by default (display: none set in HTML)
 * - Becomes visible when JavaScript sets display: block
 * - Floats at the bottom of the screen as a fixed overlay
 * - Doesn't push other content around or change scroll position
 * - Only one popup can be open at a time
 *
 * Design choices:
 * - Fixed positioning keeps it visible and accessible
 * - Appears above all other content with high z-index
 * - Subtle shadow adds depth and separates from page content
 * - Rounded top corners only (bottom is flush with screen edge)
 */
.footer-popup {
  /* Fixed positioning anchors the popup to the viewport (screen) */
  /* It stays in place even when the user scrolls */
  position: fixed;

  /* Position at the bottom of the screen */
  bottom: 0;

  /* Center horizontally: left 50% + transform moves it to true center */
  left: 50%;
  transform: translateX(-50%);

  /* Limit width for readability, but allow it to shrink on mobile */
  /* calc() ensures padding on small screens */
  width: calc(100% - var(--space-lg) * 2);
  max-width: 600px;

  /* High z-index ensures popup appears above all other content */
  /* z-index controls stacking order - higher values are on top */
  z-index: 1000;

  /* Solid opaque background - matches footer for consistency */
  /* Using the same gray as the footer ensures visual cohesion */
  background-color: var(--color-bg-secondary);

  /* Internal spacing around the content */
  padding: var(--space-lg);

  /* Extra padding at top for the close button in the corner */
  padding-top: var(--space-xl);

  /* Round only top corners - bottom is flush with screen edge */
  border-radius: var(--radius-md) var(--radius-md) 0 0;

  /* Subtle shadow adds depth and separates popup from page content */
  /* Box-shadow: x-offset y-offset blur spread color */
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);

  /* Border on top and sides for definition */
  border: 1px solid var(--color-border);
  border-bottom: none;

  /* Left-aligned text is easier to read for longer paragraphs */
  text-align: left;

  /* Smooth slide-up animation when popup appears */
  /* popup-slide-up animates from below the screen to final position */
  /* 0.25s = 250 milliseconds duration */
  /* ease-out = starts fast, slows at end (feels natural) */
  animation: popup-slide-up 0.25s ease-out;
}

/**
 * Slide Up Animation for Footer Popups
 *
 * Animates the popup from below the screen (translateY(100%))
 * to its final position (translateY(0) centered with translateX(-50%)).
 * Combined with opacity for a smooth appearance effect.
 */
@keyframes popup-slide-up {
  from {
    /* Start below the screen and invisible */
    /* translateX(-50%) keeps horizontal centering during animation */
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    /* End at final position, fully visible */
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/**
 * Footer Warning Popup Variant
 * ============================
 *
 * Purpose:
 * Visual variant for warnings about platform limitations.
 * Uses warm amber/orange colors to indicate caution without alarming.
 *
 * Color psychology:
 * - Amber/orange suggests caution (like a yellow traffic light)
 * - Less aggressive than red (which indicates errors/danger)
 * - Warm colors draw attention without causing anxiety
 *
 * CSS specificity note:
 * Using two classes (.footer-popup.footer-warning-popup) makes this rule
 * more specific than .footer-popup alone, ensuring these styles override
 * the base styles when both classes are present on an element.
 */
.footer-popup.footer-warning-popup {
  /* Warm amber background color */
  /* #fff7ed is a very light orange (similar to Tailwind's orange-50) */
  background-color: #fff7ed;

  /* Subtle orange border reinforces the warning theme */
  /* Only on top and sides - bottom is flush with screen edge */
  border-color: #fed7aa;
}

/**
 * Warning Popup Text Styling
 *
 * Makes text inside warning popups use amber colors
 * to match the container's warning theme.
 */
.footer-popup.footer-warning-popup p {
  /* Dark amber/brown text color for readability */
  /* #9a3412 is a dark orange (similar to Tailwind's orange-800) */
  /* Dark text on light background provides good contrast */
  color: #9a3412;

  /* Slightly smaller text for the warning message */
  font-size: var(--font-size-sm);

  /* Remove default paragraph margins for tighter layout */
  margin: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-md);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-text-light);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: rgba(29, 155, 240, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-md);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
}

.form-input::placeholder {
  color: var(--color-text-secondary);
}

.form-input-large {
  font-size: var(--font-size-lg);
  padding: var(--space-lg);
}

.form-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
}

/* Radio buttons */
.radio-group {
  display: flex;
  gap: var(--space-lg);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.radio-text {
  font-size: var(--font-size-md);
}

/* --- Alerts --- */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

.alert-error {
  background-color: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #f0fdf4;
  color: var(--color-success);
  border: 1px solid #bbf7d0;
}

/* --- Tweet Card --- */
.tweet-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: background-color var(--transition-fast);
}

.tweet-card:hover {
  background-color: var(--color-bg-secondary);
}

.tweet-highlight {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(29, 155, 240, 0.1);
}

/* Tweet header (avatar + author) */
.tweet-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.tweet-avatar {
  flex-shrink: 0;
}

.avatar-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.tweet-author {
  min-width: 0; /* Allows text truncation */
}

.author-name {
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.author-username {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.verified-badge {
  color: var(--color-primary);
  font-weight: 700;
}

/* Reply indicator */
.tweet-reply-indicator {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

/* Tweet text */
.tweet-text {
  font-size: var(--font-size-lg);
  line-height: 1.4;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

.tweet-link {
  color: var(--color-primary);
}

.tweet-mention {
  color: var(--color-primary);
}

.tweet-hashtag {
  color: var(--color-primary);
}

/* Tweet media */
.tweet-media {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Grid layout for multiple images */
.tweet-media.media-count-2,
.tweet-media.media-count-3,
.tweet-media.media-count-4 {
  display: grid;
  gap: 2px;
}

.tweet-media.media-count-2 {
  grid-template-columns: 1fr 1fr;
}

.tweet-media.media-count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.tweet-media.media-count-3 .media-item:first-child {
  grid-row: span 2;
}

.tweet-media.media-count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.media-item {
  background-color: var(--color-bg-tertiary);
}

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

.media-video {
  width: 100%;
  max-height: 500px;
  display: block;
}

/* Quoted tweet */
.quoted-tweet {
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background-color: var(--color-bg-secondary);
}

.quoted-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.quoted-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.quoted-username {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.quoted-text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/* Tweet footer */
.tweet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.tweet-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.tweet-metrics {
  display: flex;
  gap: var(--space-lg);
}

.metric {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.metric-icon {
  font-size: var(--font-size-sm);
}

.metric-value {
  font-weight: 500;
}

/* =============================================
   5. PAGE-SPECIFIC STYLES
   ============================================= */

/* --- Login Page --- */
.login-page {
  background-color: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-md);
}

.login-card {
  background-color: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
}

.login-title {
  margin-bottom: var(--space-sm);
}

.login-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* --- Home Page --- */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero-title {
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  /* Use --color-text-secondary which updates in dark mode */
  /* --color-secondary doesn't change in dark mode, so text would be too dark */
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  max-width: 500px;
  margin: 0 auto;
}

.fetch-section {
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.instructions {
  padding: var(--space-lg);
}

.instructions-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-md);
}

.instructions-list {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

.instructions-list li {
  margin-bottom: var(--space-sm);
}

.instructions-note {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  background-color: var(--color-bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

/* Benefits Block: Groups all three benefits under one shared background */
/* This creates visual cohesion and makes it clear these items are related */
.benefits-block {
  background-color: var(--color-bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

/* Individual benefit items within the block */
/* No background since the parent provides it - just spacing between items */
.benefit-item {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  padding: 0;
}

/* Add vertical spacing between benefit items, but not after the last one */
.benefit-item + .benefit-item {
  margin-top: var(--space-md);
}

/* --- Info Links and Popups (Home Page) ---
 *
 * Gentle trigger links that reveal additional information on click.
 * Used to hide verbose content (benefits, warnings) behind subtle links
 * to keep the home page clean and scannable.
 */

/**
 * Info Links Container
 *
 * Horizontally centered row of subtle text links.
 * Contains "Why?" and "Fair warning..." triggers.
 */
.info-links {
  /* Center the links horizontally */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  /* Add some vertical spacing */
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

/**
 * Info Link Button
 *
 * Styled as a subtle, underlined text link.
 * Uses <button> for accessibility but looks like plain text.
 * Appears gentle and non-intrusive.
 */
.info-link {
  /* Reset button styles to look like plain text */
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;

  /* Text styling - subtle and understated */
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;

  /* Smooth hover transition */
  transition: color var(--transition-fast);
}

/* Hover state - slightly more prominent */
.info-link:hover {
  color: var(--color-primary);
  text-decoration-style: solid;
}

/* Focus state for keyboard accessibility */
.info-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/**
 * Separator Dot
 *
 * Small dot between info links for visual separation.
 */
.info-link-separator {
  color: var(--color-border-dark);
  font-size: var(--font-size-sm);
}

/**
 * Info Popup
 *
 * The expandable content area that appears when a link is clicked.
 * Slides in smoothly and has a close button.
 */
.info-popup {
  /* Positioning context for close button */
  position: relative;

  /* Visual styling - soft background with rounded corners */
  background-color: var(--color-bg-tertiary);
  padding: var(--space-lg);
  padding-top: var(--space-xl); /* Extra top padding for close button */
  border-radius: var(--radius-md);
  margin-top: var(--space-md);

  /* Subtle entrance animation */
  animation: popup-fade-in 0.2s ease-out;
}

/* Fade-in animation for popup appearance */
@keyframes popup-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/**
 * Warning Popup Variant
 *
 * Uses a warmer/amber background to indicate caution.
 */
.info-popup.warning-popup {
  /* Warm amber background similar to the old warning style */
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
}

.info-popup.warning-popup p {
  /* Amber text color for warnings */
  color: #9a3412;
  font-size: var(--font-size-sm);
  margin: 0;
}

/**
 * Popup Close Button
 *
 * Small X button in the top-right corner to dismiss the popup.
 * Uses a subtle style that doesn't distract from the content.
 */
.popup-close {
  /* Position in top-right corner */
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);

  /* Reset button styles */
  background: none;
  border: none;
  padding: var(--space-xs);
  margin: 0;
  cursor: pointer;

  /* Visual styling */
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);

  /* Smooth hover transition */
  transition: all var(--transition-fast);
}

/* Hover state - more visible */
.popup-close:hover {
  color: var(--color-text);
  background-color: var(--color-border);
}

/* Focus state for keyboard accessibility */
.popup-close:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* Warning popup close button uses amber colors */
.info-popup.warning-popup .popup-close {
  color: #c2410c;
}

.info-popup.warning-popup .popup-close:hover {
  color: #9a3412;
  background-color: #fed7aa;
}

/* --- Tweet/Thread Page --- */
.back-nav {
  margin-bottom: var(--space-lg);
}

.back-link {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.back-link:hover {
  color: var(--color-primary);
}

.tweet-section {
  margin-bottom: var(--space-lg);
}

.thread-header {
  margin-bottom: var(--space-lg);
}

.thread-title {
  margin-bottom: var(--space-xs);
}

.thread-info {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.thread-section {
  margin-bottom: var(--space-lg);
}

.thread-connector {
  width: 2px;
  height: 24px;
  background-color: var(--color-border-dark);
  margin: 0 auto;
}

.thread-link-container {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.original-link {
  text-align: center;
  padding: var(--space-lg);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.original-link code {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
}

.source-note {
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

/* --- Key Replies Section --- */
/* Styles for the "Key Replies" section shown below threads */
/* These are highlighted responses from other users in the conversation */

.replies-section {
  /* Visual separation from the main thread */
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  /* Top border to visually separate from thread */
  border-top: 1px solid var(--color-border-dark);
}

.replies-header {
  margin-bottom: var(--space-lg);
}

.replies-title {
  /* Slightly smaller than thread title */
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.replies-info {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.reply-card {
  /* Add some space between replies */
  margin-bottom: var(--space-md);
}

/* Subtle visual distinction for reply cards */
.reply-card .tweet-card {
  /* Slightly different background to distinguish from main thread */
  background-color: var(--color-bg-secondary);
  /* Subtle left border to indicate "reply" */
  border-left: 3px solid var(--color-primary);
}

/* --- Error Page --- */
.error-page {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.error-status {
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-border-dark);
  margin-bottom: var(--space-md);
}

.error-title {
  margin-bottom: var(--space-md);
}

.error-message {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.error-details {
  text-align: left;
  background-color: var(--color-bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
}

.error-details summary {
  cursor: pointer;
  font-weight: 600;
}

.error-stack {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: var(--font-size-sm);
  white-space: pre-wrap;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Tablet and smaller */
@media (max-width: 768px) {
  .container {
    padding: var(--space-sm);
  }

  .hero {
    padding: var(--space-xl) 0;
  }

  .hero-title {
    font-size: var(--font-size-xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-md);
  }

  .fetch-section {
    padding: var(--space-lg);
  }

  .tweet-text {
    font-size: var(--font-size-md);
  }

  .radio-group {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .tweet-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .tweet-metrics {
    width: 100%;
    justify-content: space-between;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn {
    width: 100%;
  }
}

/* =============================================
   MULTI-PLATFORM STYLES
   ============================================= */

/**
 * Platform Colors
 *
 * Each social media platform has its own brand color.
 * These are used for badges, accents, and highlights.
 */

/* Platform color variables (extending :root) */
.platform-badge-twitter { --platform-color: #1d9bf0; }
.platform-badge-reddit { --platform-color: #ff4500; }
.platform-badge-tiktok { --platform-color: #000000; }
.platform-badge-instagram { --platform-color: #e4405f; }
.platform-badge-hackernews { --platform-color: #ff6600; }

/* --- Platform Badges --- */
.platform-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.platform-badge-twitter {
  background-color: #1d9bf0;
  color: white;
}

.platform-badge-reddit {
  background-color: #ff4500;
  color: white;
}

.platform-badge-tiktok {
  background-color: #000000;
  color: white;
}

.platform-badge-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.platform-badge-linkedin {
  background-color: #0a66c2;
  color: white;
}

.platform-badge-youtube {
  background-color: #ff0000;
  color: white;
}

.platform-badge-hackernews {
  background-color: #ff6600;
  color: white;
}

/* --- Platform Tags (home page) --- */
/* Marquee-style slider with fade edges for cleaner appearance */

/**
 * Platform Slider Container
 *
 * Creates a masked container that:
 * 1. Clips the overflowing track content
 * 2. Applies gradient fade at left/right edges
 * 3. Prevents interaction with the overflow
 *
 * The fade effect uses CSS mask-image with linear gradients
 * that go from transparent -> opaque -> opaque -> transparent
 */
.platforms-slider {
  /* Container takes full width but clips overflow */
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: var(--space-xl);

  /* Gradient fade on left and right edges using CSS mask */
  /* The mask fades content at 0-10% and 90-100% of width */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

/**
 * Platform Track
 *
 * The inner element that contains all platform tags and animates.
 * Uses keyframe animation to slide continuously from right to left.
 *
 * How the seamless loop works:
 * - The track contains TWO copies of all platform tags
 * - Animation moves the track left by exactly 50% (one full set)
 * - When animation completes (50% offset), it resets to start
 * - Since both halves are identical, the reset is invisible
 */
.platforms-track {
  /* Flexbox to arrange tags in a single row with gaps */
  display: flex;
  flex-wrap: nowrap; /* IMPORTANT: Prevent wrapping to multiple lines */
  gap: var(--space-sm);
  width: max-content; /* Shrink-wrap to content width */
  white-space: nowrap; /* Prevent text wrapping within tags */

  /* Continuous sliding animation */
  animation: slide-platforms 25s linear infinite;
}

/**
 * Keyframe Animation: slide-platforms
 *
 * Moves the track from start position (0%) to halfway (-50%).
 * Since the track has duplicated content, this creates a seamless loop.
 *
 * Speed notes:
 * - 25s duration creates a gentle, non-distracting scroll
 * - linear timing ensures constant speed (no acceleration/deceleration)
 * - infinite makes it loop forever
 */
@keyframes slide-platforms {
  from {
    transform: translateX(0);
  }
  to {
    /* Move left by 50% (the width of one complete set of tags) */
    transform: translateX(-50%);
  }
}

/* Pause animation on hover so users can read the tags */
.platforms-slider:hover .platforms-track {
  animation-play-state: paused;
}

/**
 * Reduced Motion Accessibility
 *
 * Respects user's prefers-reduced-motion setting.
 * If user prefers reduced motion, disable the animation
 * and show a centered, wrapping layout instead.
 */
@media (prefers-reduced-motion: reduce) {
  .platforms-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Hide the duplicate set when not animating */
  .platforms-track .platform-tag:nth-child(n+9) {
    display: none;
  }

  /* Remove the fade mask when not scrolling */
  .platforms-slider {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Keep the original platforms-bar for backwards compatibility */
.platforms-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.platform-tag {
  display: inline-block;
  flex-shrink: 0; /* Prevent tags from shrinking in flex container */
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  color: white;
}

.platform-tag-twitter {
  background-color: #1d9bf0;
}

.platform-tag-reddit {
  background-color: #ff4500;
}

.platform-tag-tiktok {
  background-color: #000000;
}

.platform-tag-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.platform-tag-linkedin {
  background-color: #0a66c2;
}

.platform-tag-youtube {
  background-color: #ff0000;
}

/* Substack uses their signature orange color */
.platform-tag-substack {
  background-color: #ff6719;
}

/* News/Article uses a neutral gray-blue for generic articles */
.platform-tag-article {
  background-color: #4a5568;
}

/* --- Example URLs Section --- */
.examples-section {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
}

.examples-title {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
  text-align: center;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.example-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.example-platform {
  font-size: 0.7rem;
  padding: 2px 6px;
}

.example-url {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- View Type Hint --- */
.view-type-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
}

/* --- Instructions Warning --- */
.instructions-warning {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: #9a3412;
}

/* =============================================
   REDDIT STYLES
   ============================================= */

.reddit-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: background-color var(--transition-fast);
}

.reddit-card:hover {
  background-color: var(--color-bg-secondary);
}

.reddit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.reddit-subreddit {
  margin-left: var(--space-sm);
}

.subreddit-name {
  font-weight: 600;
  color: #ff4500;
}

.reddit-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.reddit-separator {
  color: var(--color-border-dark);
}

/* Reddit Tags */
.reddit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.reddit-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.reddit-tag-nsfw {
  background-color: #dc2626;
  color: white;
}

.reddit-tag-spoiler {
  background-color: #1f2937;
  color: white;
}

.reddit-tag-flair {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
}

/* Reddit Title */
.reddit-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

/* Reddit Text */
.reddit-text {
  font-size: var(--font-size-md);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

.reddit-text p {
  margin-bottom: var(--space-md);
}

.reddit-text p:last-child {
  margin-bottom: 0;
}

/* Reddit Links/Mentions */
.reddit-link {
  color: var(--color-primary);
  cursor: help;
}

.reddit-subreddit-link,
.reddit-user-link {
  color: #ff4500;
  font-weight: 500;
}

.reddit-quote {
  display: block;
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-border-dark);
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Reddit Link Preview */
.reddit-link-preview {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.link-icon {
  font-size: var(--font-size-lg);
}

.link-url {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  word-break: break-all;
}

/* Reddit Media */
.reddit-media {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Reddit Footer */
.reddit-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.reddit-metrics {
  display: flex;
  gap: var(--space-lg);
}

.reddit-upvotes {
  color: #ff4500;
}

.upvote-ratio {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-left: var(--space-xs);
}

/* Reddit Comments */
.comments-section {
  margin-top: var(--space-xl);
}

/*
 * Comments header row - contains the heading and sort dropdown
 * Uses flexbox with space-between to push sort dropdown to the right
 */
.comments-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-lg);
  /* Remove margin/border since parent row handles it now */
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/*
 * Comment sort dropdown container
 * Groups the label and select together
 */
.comment-sort-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.comment-sort-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/*
 * Sort dropdown select element
 * Styled to match the site's design system
 */
.comment-sort-select {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.comment-sort-select:hover {
  border-color: var(--color-primary);
}

.comment-sort-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.reddit-comment {
  padding: var(--space-md);
  border-left: 2px solid var(--color-border);
  background-color: var(--color-bg);
}

.reddit-comment:hover {
  background-color: var(--color-bg-secondary);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
}

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

.op-badge {
  background-color: var(--color-primary);
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
}

.mod-badge {
  background-color: var(--color-success);
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
}

.comment-body {
  font-size: var(--font-size-md);
  line-height: 1.5;
}

.comment-body p {
  margin-bottom: var(--space-sm);
}

.comment-replies {
  margin-top: var(--space-md);
}

/* --- Reddit Comment Collapse Feature ---
 *
 * These styles enable Reddit-style collapsible comments.
 * Users can click the [-] button or the vertical line to collapse.
 *
 * Visual behavior:
 * - Expanded: Shows full comment body and all replies
 * - Collapsed: Hides content, shows child count in header
 */

/* Make comment container position relative for the collapse line */
.reddit-comment {
  position: relative;
}

/**
 * Collapse Button ([-] / [+])
 *
 * A small button at the start of the comment header.
 * Shows minus when expanded, plus when collapsed.
 * Styled to be subtle but visible and easily clickable.
 */
.comment-collapse-btn {
  /* Reset browser button styles */
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  margin-right: var(--space-xs);

  /* Size and shape */
  width: 18px;
  height: 18px;
  border-radius: 2px;

  /* Typography */
  font-size: 14px;
  font-weight: 600;
  font-family: monospace;
  line-height: 1;

  /* Colors */
  color: var(--color-text-secondary);
  background-color: var(--color-bg-tertiary);

  /* Interaction styling */
  cursor: pointer;
  transition: all var(--transition-fast);

  /* Center the icon */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hover state for collapse button */
.comment-collapse-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-border);
}

/* Focus state for keyboard accessibility */
.comment-collapse-btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/**
 * Collapse Line (Clickable vertical line)
 *
 * A thin vertical line on the left side of the comment.
 * Clicking this line collapses/expands the comment thread.
 * This mimics Reddit's behavior for easy thread navigation.
 */
.comment-collapse-line {
  /* Position it to the left of the comment */
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px; /* Clickable area wider than visible line */

  /* The visible line itself (using a pseudo-element via border) */
  border-left: 2px solid transparent;

  /* Make it clickable */
  cursor: pointer;

  /* Transition for smooth hover effect */
  transition: border-color var(--transition-fast);
}

/* Show the line on hover */
.comment-collapse-line:hover {
  border-left-color: var(--color-primary);
}

/* Active/pressed state */
.comment-collapse-line:active {
  border-left-color: var(--color-primary);
  opacity: 0.7;
}

/**
 * Collapsed Info (child count)
 *
 * Shows the number of hidden children when a comment is collapsed.
 * Example: "(5 children)"
 * Hidden by default, shown only when comment is collapsed.
 */
.comment-collapsed-info {
  display: none; /* Hidden by default */
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-style: italic;
  margin-left: var(--space-xs);
}

/**
 * Comment Content Wrapper
 *
 * Contains the comment body and all nested replies.
 * This entire section is hidden when the comment is collapsed.
 */
.comment-content {
  /* Smooth collapse animation */
  transition: opacity var(--transition-fast);
}

/**
 * Collapsed State Styles
 *
 * When .collapsed class is added to .reddit-comment:
 * - Hide the comment body and all replies
 * - Show the child count in the header
 * - Reduce visual prominence of the comment
 */
.reddit-comment.collapsed > .comment-content {
  /* Hide the comment content */
  display: none;
}

.reddit-comment.collapsed > .comment-header .comment-collapsed-info {
  /* Show the child count when collapsed */
  display: inline;
}

.reddit-comment.collapsed {
  /* Reduce padding when collapsed since content is hidden */
  padding-bottom: var(--space-sm);

  /* Slightly fade the collapsed comment */
  opacity: 0.8;
}

.reddit-comment.collapsed:hover {
  /* Full opacity on hover to indicate interactivity */
  opacity: 1;
}

/* Make the collapse line always visible when comment has replies */
.reddit-comment:has(.comment-replies) > .comment-collapse-line {
  border-left-color: var(--color-border);
}

/* =============================================
   TIKTOK STYLES
   ============================================= */

.tiktok-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.tiktok-card:hover {
  background-color: var(--color-bg-secondary);
}

.tiktok-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.tiktok-avatar-placeholder {
  background-color: #000000;
}

/* TikTok Text */
.tiktok-text {
  font-size: var(--font-size-md);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

.tiktok-mention {
  color: #000000;
  font-weight: 500;
}

.tiktok-hashtag {
  color: var(--color-primary);
  font-weight: 500;
}

/* TikTok Video */
.tiktok-video-container {
  position: relative;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #000000;
}

.tiktok-video {
  width: 100%;
  max-height: 600px;
  display: block;
}

/*
 * TikTok Embed Container
 * =====================
 * Styles for TikTok's official embed iframe.
 * Used as fallback when direct video playback fails (403 errors).
 *
 * Why these specific dimensions?
 * -----------------------------
 * TikTok's embed iframe has a standard size that maintains their 9:16
 * vertical video format. These values come from TikTok's own embed code:
 * - Width: 325px (TikTok's default embed width)
 * - Height: 578px (TikTok's default embed height)
 * - Aspect ratio: 325/578 ≈ 0.5623 (close to 9:16 = 0.5625)
 */
.tiktok-embed-container {
  /* Position relative for any overlay elements */
  position: relative;
  /* TikTok videos are vertical (9:16 ratio), limit height for better UX */
  width: 100%;
  /* 325px is TikTok's standard embed width - prevents overly wide embeds */
  max-width: 325px;
  /* Center the embed horizontally within the card */
  margin: 0 auto;
}

.tiktok-embed-iframe {
  /* Fill the container width */
  width: 100%;
  /* 578px is TikTok's standard embed height for 9:16 aspect ratio */
  /* Calculation: 325px width × (16/9) = 578px height */
  height: 578px;
  /* Remove default iframe border */
  border: none;
  /* Match the video container's rounded corners */
  border-radius: var(--radius-md);
}

.tiktok-thumbnail-container {
  position: relative;
}

.tiktok-thumbnail {
  width: 100%;
  display: block;
}

.tiktok-no-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.no-video-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* Video Overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
}

.play-icon {
  font-size: 3rem;
  opacity: 0.9;
}

.video-unavailable {
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
  opacity: 0.8;
}

/* Duration Badge */
.duration-badge {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* TikTok Sound */
.tiktok-sound {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

.sound-title {
  font-weight: 500;
}

.sound-author {
  color: var(--color-text-secondary);
}

/* TikTok Footer */
.tiktok-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.tiktok-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.tiktok-metrics {
  display: flex;
  gap: var(--space-lg);
}

/* =============================================
   INSTAGRAM STYLES
   ============================================= */

.instagram-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.instagram-card:hover {
  background-color: var(--color-bg-secondary);
}

.instagram-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.instagram-author-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: var(--space-sm);
}

.instagram-avatar-placeholder {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* Instagram Media */
.instagram-media {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-bg-tertiary);
}

.instagram-img {
  width: 100%;
  display: block;
}

.instagram-video {
  width: 100%;
  max-height: 600px;
  display: block;
}

/* Carousel */
.carousel-indicator {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-border-dark);
}

.carousel-dot.active {
  background-color: #e4405f;
}

/* Instagram Caption */
.instagram-caption {
  font-size: var(--font-size-md);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.caption-author {
  font-weight: 600;
  margin-right: var(--space-xs);
}

.instagram-mention,
.instagram-hashtag {
  color: #00376b;
  font-weight: 500;
}

/* Instagram Footer */
.instagram-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.instagram-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.instagram-metrics {
  display: flex;
  gap: var(--space-lg);
}

.metrics-unavailable {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Instagram Error Card */
.instagram-error-card {
  text-align: center;
}

.instagram-error-content {
  padding: var(--space-xl);
}

.instagram-error-content .error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.instagram-error-content .error-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

.instagram-error-content .error-message {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.instagram-error-content .error-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.instagram-error-content .error-link code {
  display: block;
  margin-top: var(--space-xs);
  word-break: break-all;
}

/* Platform Notice */
.platform-notice {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  text-align: center;
}

.notice-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* Post Section (shared) */
.post-section {
  margin-bottom: var(--space-lg);
}

.post-highlight {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(29, 155, 240, 0.1);
}

/* =============================================
   LINKEDIN STYLES
   ============================================= */

/**
 * LinkedIn Card
 *
 * Main container for LinkedIn post display.
 * Follows the same pattern as other platform cards.
 */
.linkedin-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.linkedin-card:hover {
  background-color: var(--color-bg-secondary);
}

/* LinkedIn Header */
.linkedin-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* LinkedIn Author Info */
.linkedin-author-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: var(--space-sm);
}

/* LinkedIn Avatar Placeholder - uses LinkedIn blue */
.linkedin-avatar-placeholder {
  background-color: #0a66c2;
}

/* LinkedIn Title (for articles) */
.linkedin-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
  color: var(--color-text);
}

/* LinkedIn Media */
.linkedin-media {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-bg-tertiary);
}

.linkedin-img {
  width: 100%;
  display: block;
}

.linkedin-video {
  width: 100%;
  max-height: 600px;
  display: block;
}

/* LinkedIn Text Content */
.linkedin-text {
  font-size: var(--font-size-md);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

/* LinkedIn Mentions and Hashtags */
.linkedin-mention {
  color: #0a66c2;
  font-weight: 500;
}

.linkedin-hashtag {
  color: #0a66c2;
  font-weight: 500;
}

.linkedin-link {
  color: #0a66c2;
  word-break: break-all;
}

/* LinkedIn Footer */
.linkedin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.linkedin-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.linkedin-metrics {
  display: flex;
  gap: var(--space-lg);
}

/* LinkedIn Error Card */
.linkedin-error-card {
  text-align: center;
}

.linkedin-error-content {
  padding: var(--space-xl);
}

.linkedin-error-content .error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
  color: #0a66c2;
  font-weight: 700;
  font-family: Georgia, serif;
}

.linkedin-error-content .error-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

.linkedin-error-content .error-message {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.linkedin-error-content .error-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.linkedin-error-content .error-link code {
  display: block;
  margin-top: var(--space-xs);
  word-break: break-all;
}

/* =============================================
   YOUTUBE STYLES
   ============================================= */

/**
 * YouTube Card
 *
 * Main container for YouTube video display.
 * Follows the same pattern as other platform cards.
 * Uses YouTube's brand color (red #ff0000) for accents.
 */
.youtube-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.youtube-card:hover {
  background-color: var(--color-bg-secondary);
}

/* YouTube Error Card - for failed video fetches */
.youtube-card-error {
  text-align: center;
}

/* YouTube Header - author info and platform badge */
.youtube-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* YouTube Avatar */
.youtube-avatar {
  flex-shrink: 0;
}

/* YouTube Avatar Placeholder - uses YouTube red */
.youtube-avatar-placeholder {
  background-color: #ff0000;
}

/* YouTube Author Info */
.youtube-author {
  min-width: 0; /* Allows text truncation */
}

/* YouTube Title - video titles are a key feature unlike TikTok */
.youtube-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
  color: var(--color-text);
}

/* YouTube Video Container */
.youtube-video-container {
  position: relative;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #000000;
}

/* YouTube Video Player */
.youtube-video {
  width: 100%;
  max-height: 600px;
  display: block;
}

/**
 * YouTube Embed Container
 *
 * Styles for YouTube's official embed iframe.
 * Used as fallback when direct video playback fails.
 * Maintains 16:9 aspect ratio for proper video display.
 */
.youtube-embed-container {
  position: relative;
  width: 100%;
  /* Use padding-bottom trick for responsive 16:9 aspect ratio */
  /* 56.25% = 9/16 * 100 */
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.youtube-embed-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
}

/* YouTube Thumbnail Container - final fallback */
.youtube-thumbnail-container {
  position: relative;
}

.youtube-thumbnail {
  width: 100%;
  display: block;
}

/* Watch on YouTube link overlay */
.watch-on-youtube {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: white;
  text-decoration: none;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background-color: rgba(255, 0, 0, 0.8);
  transition: background-color var(--transition-fast);
}

.watch-on-youtube:hover {
  background-color: rgba(255, 0, 0, 1);
  color: white;
  text-decoration: none;
}

/* Quality Badge - shows video quality like "720p" */
.quality-badge {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* YouTube Description Section */
.youtube-description {
  margin-bottom: var(--space-md);
}

.youtube-description summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
}

.youtube-description summary:hover {
  color: var(--color-primary);
}

.youtube-text {
  font-size: var(--font-size-md);
  line-height: 1.6;
  padding: var(--space-md);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  word-wrap: break-word;
}

/* YouTube Text Styling - URLs, timestamps, mentions, hashtags */
.youtube-link {
  color: var(--color-primary);
  word-break: break-all;
}

.youtube-timestamp {
  color: var(--color-primary);
  font-weight: 500;
  background-color: var(--color-bg-tertiary);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

.youtube-hashtag {
  color: var(--color-primary);
  font-weight: 500;
}

.youtube-mention {
  color: #ff0000;
  font-weight: 500;
}

/* YouTube Metadata - category and keywords */
.youtube-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.youtube-category {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.youtube-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.youtube-keyword {
  display: inline-block;
  padding: 2px 8px;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.youtube-keyword-more {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* YouTube Footer */
.youtube-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.youtube-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.youtube-metrics {
  display: flex;
  gap: var(--space-lg);
}

/* YouTube Error Content Styles */
.youtube-card-error .error-content {
  padding: var(--space-xl);
}

.youtube-card-error .error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.youtube-card-error .error-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

.youtube-card-error .error-message {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.youtube-card-error .error-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.youtube-card-error .error-url code {
  display: block;
  margin-top: var(--space-xs);
  word-break: break-all;
}

.youtube-card-error .error-suggestion {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
}

/* =============================================
   MULTI-PLATFORM RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .platforms-bar {
    gap: var(--space-xs);
  }

  /* Slider animation runs faster on mobile for better UX */
  .platforms-track {
    animation-duration: 18s;
  }

  .platform-tag {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .reddit-title {
    font-size: var(--font-size-lg);
  }

  .tiktok-video,
  .instagram-video,
  .linkedin-video,
  .youtube-video {
    max-height: 500px;
  }

  .youtube-title {
    font-size: var(--font-size-lg);
  }
}

/* =============================================
   QUEUE STATUS INDICATOR
   ============================================= */

/**
 * Queue Status Display
 *
 * Shows users their position in the scraping queue.
 * Hidden by default, becomes visible when waiting in queue.
 * Uses SSE (Server-Sent Events) for real-time updates.
 */
.queue-status {
  /* Hidden by default */
  display: none;

  /* Styling */
  margin-top: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  text-align: center;

  /* Animation for visibility changes */
  animation: fadeIn 0.3s ease;
}

/* Show queue status when it has the 'active' class */
.queue-status.active {
  display: block;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Queue position number */
.queue-position {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

/* Queue message text */
.queue-message {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* Spinner animation for "processing" state */
.queue-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: var(--space-xs);
  vertical-align: middle;
}

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

/* Processing state (active scrape) */
.queue-status.processing .queue-position {
  color: var(--color-success);
}

@media (max-width: 480px) {
  .reddit-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reddit-footer,
  .tiktok-footer,
  .instagram-footer,
  .linkedin-footer,
  .youtube-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .reddit-metrics,
  .tiktok-metrics,
  .instagram-metrics,
  .linkedin-metrics,
  .youtube-metrics {
    width: 100%;
    justify-content: space-between;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}

/* ===========================================
   HACKER NEWS STYLES
   =========================================== */

/* --- Hacker News Card --- */
.hackernews-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: background-color var(--transition-fast);
}

.hackernews-card:hover {
  background-color: var(--color-bg-secondary);
}

.hackernews-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.hackernews-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.hackernews-author {
  color: #ff6600;
  font-weight: 500;
}

.hackernews-separator {
  color: var(--color-border-dark);
}

/* Hacker News Tags */
.hackernews-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.hackernews-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.hackernews-tag-ask {
  background-color: #ff6600;
  color: white;
}

.hackernews-tag-show {
  background-color: #0ea5e9;
  color: white;
}

.hackernews-tag-tell {
  background-color: #8b5cf6;
  color: white;
}

.hackernews-tag-job {
  background-color: #22c55e;
  color: white;
}

/* Hacker News Title */
.hackernews-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.hackernews-title-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.hackernews-title-link:hover {
  color: #ff6600;
}

/* Link Domain */
.hackernews-link-domain {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.hackernews-link-domain .link-icon {
  font-size: 0.875rem;
}

.hackernews-link-domain .domain-text {
  color: var(--color-text-muted);
}

/* Hacker News Text */
.hackernews-text {
  font-size: var(--font-size-md);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

.hackernews-text p {
  margin-bottom: var(--space-md);
}

.hackernews-text p:last-child {
  margin-bottom: 0;
}

.hackernews-text a {
  color: #ff6600;
  text-decoration: none;
}

.hackernews-text a:hover {
  text-decoration: underline;
}

.hackernews-text code {
  background-color: var(--color-bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
}

.hackernews-text pre {
  background-color: var(--color-bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

.hackernews-text pre code {
  background: none;
  padding: 0;
}

/* Hacker News Footer */
.hackernews-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.hackernews-metrics {
  display: flex;
  gap: var(--space-lg);
}

.hackernews-score .metric-icon {
  color: #ff6600;
}

/* --- Hacker News Comments --- */
.hackernews-comment {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
  border-left: 2px solid var(--color-border);
}

.hackernews-comment:hover {
  border-left-color: #ff6600;
}

/* Reuse the same comment collapse/expand styles as Reddit */
.hackernews-comment .comment-collapse-line {
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 20px;
  cursor: pointer;
  z-index: 1;
}

.hackernews-comment .comment-collapse-line:hover + .comment-header .comment-collapse-btn,
.hackernews-comment .comment-collapse-btn:hover {
  background-color: #ff6600;
  color: white;
}

.hackernews-comment .comment-body {
  font-size: var(--font-size-md);
  line-height: 1.6;
  padding: var(--space-sm) 0;
}

.hackernews-comment .comment-body p {
  margin-bottom: var(--space-sm);
}

.hackernews-comment .comment-body p:last-child {
  margin-bottom: 0;
}

.hackernews-comment .comment-body a {
  color: #ff6600;
  text-decoration: none;
}

.hackernews-comment .comment-body a:hover {
  text-decoration: underline;
}

.hackernews-comment .comment-body code {
  background-color: var(--color-bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
}

.hackernews-comment .comment-body pre {
  background-color: var(--color-bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-sm) 0;
}

.hackernews-comment .comment-body pre code {
  background: none;
  padding: 0;
}

/* HN Comment Author */
.hackernews-comment .comment-author {
  color: #ff6600;
  font-weight: 500;
}

/* Responsive styles for Hacker News */
@media (max-width: 480px) {
  .hackernews-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hackernews-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .hackernews-metrics {
    width: 100%;
    justify-content: space-between;
  }
}
