/* X.com Dark Theme */
:root {
  /* Color Scheme - X.com Dark */
  --bg-color: #000000;
  --bg-secondary: #16181c;
  --text-color: #e7e9ea;
  --text-secondary: #71767b;
  --text-muted: #565a5f;
  
  /* Primary Colors */
  --primary-color: #1d9bf0;
  --primary-hover: #1a8cd8;
  --primary-light: rgba(29, 155, 240, 0.1);
  --primary-pressed: #1570a6;
  
  /* UI Elements */
  --border-color: #2f3336;
  --border-hover: #3e4a52;
  --card-bg: #000000;
  --card-hover: #080808;
  --input-bg: #000000;
  --input-focus: #000000;
  --hover-bg: rgba(231, 233, 234, 0.03);
  --hover-bg-secondary: rgba(113, 118, 123, 0.1);
  
  /* Feedback Colors */
  --success-color: #00ba7c;
  --error-color: #f4212e;
  --warning-color: #ffd400;
  
  /* Shadows & Effects */
  --shadow: 0 0 0 1px var(--border-color);
  --shadow-hover: 0 0 0 1px var(--border-hover);
  --transition: all 0.2s ease;
  
  /* Layout */
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --border-radius-circle: 50%;
  --spacing-unit: 1rem;
  --header-height: 53px;
  --max-width: 600px;
  --max-width-expanded: 1200px;
  
  /* Typography - Using Inter as a close alternative to TwitterChirp */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 15px;
  --line-height-base: 1.3125;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: var(--line-height-base);
  margin: 0;
  padding: 0;
  font-size: var(--font-size-base);
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 900;
}

h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

h1 {
  font-size: 2rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

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

a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Layout - X.com style */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0;
  flex: 1;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}



/* Input Container */
.input-container {
  margin-bottom: 2rem;
  position: relative;
}

/* X.com Input Group Style */
.input-group {
  display: flex;
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  align-items: stretch;
  margin: 0;
  transition: border-color 0.2s;
}
.input-group:focus-within {
  border-color: var(--primary-color);
}
#tweet-url {
  flex: 1 1 0%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-color);
  font-size: 17px;
  padding: 0 20px;
  height: 56px;
  line-height: 56px;
  border-radius: 0;
  font-family: inherit;
  font-weight: 400;
}
#tweet-url::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}
#get-media {
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 0 32px;
  height: 56px;
  line-height: 56px;
  border-radius: 0 9999px 9999px 0;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}
#get-media:hover:not(:disabled) {
  background: var(--primary-hover);
}
#get-media:active:not(:disabled) {
  background: var(--primary-pressed);
}
#get-media:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
    border-radius: 16px;
  }
  #tweet-url {
    height: 52px;
    line-height: 52px;
    font-size: 16px;
    padding: 0 16px;
  }
  #get-media {
    border-radius: 0 0 16px 16px;
    height: 52px;
    line-height: 52px;
    min-width: 100%;
    width: 100%;
  }
}

.error-message {
  display: none;
  align-items: center;
  padding: 16px;
  margin: 16px 0;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  gap: 12px;
  transition: all 0.3s ease;
}

.error-message i {
  font-size: 20px;
  flex-shrink: 0;
}

.error-message.error {
  background-color: rgba(244, 33, 46, 0.1);
  color: #f4212e;
  border-left: 4px solid #f4212e;
}

.error-message.warning {
  background-color: rgba(255, 173, 31, 0.1);
  color: #ffad1f;
  border-left: 4px solid #ffad1f;
}

.error-message.info {
  background-color: rgba(29, 155, 240, 0.1);
  color: #1d9bf0;
  border-left: 4px solid #1d9bf0;
}

.error-message.success {
  background-color: rgba(0, 186, 124, 0.1);
  color: #00ba7c;
  border-left: 4px solid #00ba7c;
}

/* Input Section */
.input-container {
  margin-bottom: 0;
  position: relative;
}

/* Buttons */
.btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(29, 161, 242, 0.2);
  position: relative;
  overflow: hidden;
  min-width: 120px;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(40, 40);
    opacity: 0;
  }
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 5px rgba(29, 161, 242, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  min-width: auto;
}



/* X.com Media Container */
.media-container {
  background: transparent;
  border: none;
  overflow: visible;
  margin: 0;
}

.media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.media-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
}

.media-header h2 i {
  color: var(--text-color);
  font-size: 20px;
}

#download-all {
  background: var(--primary-color);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 9999px;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  cursor: pointer;
}

#download-all i {
  font-size: 16px;
}

#download-all:not(:disabled):hover {
  background: var(--primary-hover);
}

#download-all:not(:disabled):active {
  background: var(--primary-pressed);
}

#download-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* X.com Media Grid - Dynamic Layout */
.media-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin: 0;
  list-style: none;
}

/* Default grid for narrow layout */
.media-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Expanded grid when main content is wider */
.main-content.has-media .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Grid adjustments based on media count */
.media-grid[data-count="1"] {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

.media-grid[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.media-grid[data-count="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.media-grid[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
}

.media-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 200px;
}

/* Dynamic aspect ratios based on media count */
.media-grid[data-count="1"] .media-item {
  aspect-ratio: 16 / 9;
  max-height: 400px;
}

.media-grid[data-count="2"] .media-item,
.media-grid[data-count="3"] .media-item,
.media-grid[data-count="4"] .media-item {
  aspect-ratio: 1 / 1;
}

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

.media-item:hover .media-actions {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .media-grid,
  .media-grid[data-count="2"],
  .media-grid[data-count="3"],
  .media-grid[data-count="4"] {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .media-grid[data-count="1"] {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .media-grid,
  .media-grid[data-count="1"],
  .media-grid[data-count="2"],
  .media-grid[data-count="3"],
  .media-grid[data-count="4"] {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
}

.media-preview {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
}

.media-placeholder .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(29, 155, 240, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
  background-color: var(--bg-color);
}

.media-item:hover img,
.media-item:hover video {
  transform: scale(1.02);
}

.media-item .media-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 24px 12px 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 3;
}

.media-item:hover .media-actions {
  opacity: 1;
  transform: translateY(0);
}

.media-actions button {
  background: var(--primary-color);
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.media-actions button i {
  font-size: 14px;
}

.media-actions button:hover {
  background: var(--primary-hover);
}

.media-actions button:active {
  background: var(--primary-pressed);
}

.media-actions button.secondary {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.media-actions button.secondary:hover {
  background: var(--hover-bg-secondary);
}

/* Media info overlay */
.media-info {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-weight: 600;
}

.media-item:hover .media-info {
  opacity: 1;
}

.media-info i {
  font-size: 10px;
}

/* Media type indicator */
.media-type {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 10px;
}

/* Media resolution */
.media-resolution {
  font-size: 10px;
  opacity: 0.8;
}

/* Video duration */
.media-duration {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .media-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .media-item {
    border-radius: 12px;
  }
}

/* Loading states */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error states */
.error {
  background: rgba(244, 33, 46, 0.1);
  color: var(--error-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px;
  border: 1px solid rgba(244, 33, 46, 0.2);
}

/* Success states */
.success {
  background: rgba(0, 186, 124, 0.1);
  color: var(--success-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px;
  border: 1px solid rgba(0, 186, 124, 0.2);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* X.com Responsive Styles */
@media (max-width: 600px) {
  .container {
    border-left: none;
    border-right: none;
  }
  
  .media-preview.video,
  .media-preview.image {
    border-radius: 16px;
  }
  
  .media-thumbnail,
  .media-video {
    border-radius: 16px;
  }
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* X.com Footer Styles - Clean & Dynamic */
.footer {
  width: 100%;
  background: transparent;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0 16px;
  transition: max-width 0.3s ease;
}

/* Expand footer when media is present */
.footer-content.has-media {
  max-width: var(--max-width-expanded);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.footer-link {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.footer-link:hover, .footer-link:focus {
  color: var(--primary-color);
  background: var(--hover-bg);
  text-decoration: none;
}

.footer-link i {
  font-size: 12px;
  opacity: 0.8;
}

.footer-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
}

.footer-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-feature {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-feature i {
  font-size: 11px;
  color: var(--success-color);
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--hover-bg);
  padding: 4px 8px;
  border-radius: 12px;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .footer-content {
    padding: 0 16px;
    border-left: none;
    border-right: none;
  }
  
  .footer-links {
    gap: 4px;
  }
  
  .footer-features {
    flex-direction: column;
    gap: 8px;
  }
  
  .footer {
    padding: 20px 0;
  }
}

/* X.com Header Styles */
.main-header {
  width: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1002;
  transition: background 0.2s;
}
.main-header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  min-height: 53px;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  transition: max-width 0.3s ease;
}

/* Expand header when media is present */
.main-header-content.has-media {
  max-width: var(--max-width-expanded);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
  padding: 12px 0;
}
.logo:hover, .logo:focus {
  color: var(--text-color);
  text-decoration: none;
}
.logo-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-weight: 400;
}
.logo-text {
  color: var(--text-color);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
@media (max-width: 600px) {
  .main-header-content {
    padding: 0 16px;
    border-left: none;
    border-right: none;
  }
  .logo-text {
    display: none;
  }
  .logo-icon {
    font-size: 28px;
  }
}

/* X.com Main Content & Hero Styles - Dynamic Width */
.main-content {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
 
  transition: max-width 0.3s ease;
}

/* Expand layout when media is present */
.main-content.has-media {
  max-width: var(--max-width-expanded);
}
.hero {
  width: 100%;
  padding: 32px 16px 16px 16px;
  border-bottom: 1px solid var(--border-color);
}
.hero-content {
  text-align: center;
  width: 100%;
}
.hero-title {
  font-size: 31px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: -0.5px;
}
.hero-title i {
  font-size: 31px;
  color: var(--primary-color);
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0;
  line-height: 20px;
}
.card {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
.input-card {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
@media (max-width: 600px) {
  .main-content {
    border-left: none;
    border-right: none;
  }
  .hero {
    padding: 24px 16px 12px 16px;
  }
  .hero-title {
    font-size: 28px;
  }
  .hero-title i {
    font-size: 28px;
  }
  .hero-subtitle {
    font-size: 15px;
  }
}

html, body {
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body {
  flex: 1 0 auto;
}
.app-container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.footer {
  flex-shrink: 0;
}

/* Fix Font Awesome spinner in Get Media button */
.btn .fa-spinner {
  font-size: 1.1em;
  margin-left: 0.5em;
  vertical-align: middle;
  color: inherit;
  display: inline-block;
}
/* Prevent border spinner from affecting button spinner */
.btn .spinner {
  border: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 0 0.5em !important;
  animation: fa-spin 1s infinite linear;
}
@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(359deg); }
}



/* Section Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0;
  width: 100%;
}

/* X.com Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(91, 112, 131, 0.4);
  z-index: 2000;
  display: block;
  transition: opacity 0.2s;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  z-index: 2100;
  min-width: 320px;
  max-width: 600px;
  width: 80vw;
  max-height: 90vh;
  padding: 0;
  display: block;
  animation: modal-fade-in 0.2s ease;
}
@keyframes modal-fade-in {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.modal-content {
  padding: 32px 24px 24px 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.modal-close:hover, .modal-close:focus {
  background: var(--hover-bg);
  outline: none;
}
.modal h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-color);
}
.modal-body {
  margin-top: 0;
  font-size: 15px;
  color: var(--text-color);
  line-height: 20px;
}
.modal-body p {
  margin-bottom: 16px;
  color: var(--text-color);
}
@media (max-width: 600px) {
  .modal {
    min-width: 0;
    width: 95vw;
    padding: 0;
  }
  .modal-content {
    padding: 24px 16px 16px 16px;
  }
}
/* Addit
ional X.com-style enhancements */
.logo:hover .logo-icon {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* Smooth transitions for all interactive elements */
button, input, .media-item, .footer-link, .modal-close {
  transition: all 0.2s ease;
}

/* Loading animation improvements */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.media-placeholder {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Focus styles for better accessibility */
.input-group:focus-within {
  box-shadow: 0 0 0 2px var(--primary-color);
}

button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Improved scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 6px;
}

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

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

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

/* Selection styling */
::selection {
  background: var(--primary-color);
  color: #ffffff;
}

/* Improved button states */
#get-media:focus-visible {
  box-shadow: 0 0 0 2px var(--primary-color);
}

/* Better mobile touch targets */
@media (max-width: 600px) {
  button, .footer-link {
    min-height: 44px;
    min-width: 44px;
  }
}/* S
mooth layout transitions */
.main-content,
.main-header-content,
.footer-content {
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Media container fade-in animation */
.media-container {
  animation: fadeInUp 0.4s ease-out;
}

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

/* Media items staggered animation */
.media-item {
  animation: fadeInScale 0.3s ease-out;
  animation-fill-mode: both;
}

.media-item:nth-child(1) { animation-delay: 0.1s; }
.media-item:nth-child(2) { animation-delay: 0.15s; }
.media-item:nth-child(3) { animation-delay: 0.2s; }
.media-item:nth-child(4) { animation-delay: 0.25s; }
.media-item:nth-child(n+5) { animation-delay: 0.3s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Improved loading state for media items */
.media-item.loading {
  background: var(--hover-bg);
}

.media-item.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Better responsive behavior for very large screens */
@media (min-width: 1400px) {
  .main-content.has-media {
    max-width: 1400px;
  }
  
  .main-header-content.has-media,
  .footer-content.has-media {
    max-width: 1400px;
  }
  
  .main-content.has-media .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tweet Info Card
   ═══════════════════════════════════════════════════════════════════════════ */

.tweet-info-card {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  animation: fadeInUp 0.3s ease-out;
}

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

.tweet-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.tweet-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  flex-shrink: 0;
}

.tweet-author {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.tweet-author-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-color);
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tweet-author-handle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 20px;
}

.tweet-platform-badge {
  color: var(--text-color);
  flex-shrink: 0;
  opacity: 0.5;
}

.tweet-text {
  font-size: 15px;
  line-height: 20px;
  color: var(--text-color);
  margin-bottom: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tweet-text a {
  color: var(--primary-color);
  text-decoration: none;
}

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

.tweet-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.tweet-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tweet-stats {
  display: flex;
  gap: 16px;
}

.tweet-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tweet-stat .fa-heart {
  color: #f91880;
}

.tweet-stat .fa-retweet {
  color: var(--success-color);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Quality Selector
   ═══════════════════════════════════════════════════════════════════════════ */

.quality-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 6px 28px 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.quality-select:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.quality-select:focus-visible {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.3);
}

.quality-select option {
  background: #16181c;
  color: #e7e9ea;
  padding: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Media Badge (Quality Overlay)
   ═══════════════════════════════════════════════════════════════════════════ */

.media-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Skeleton / Loading Pulse
   ═══════════════════════════════════════════════════════════════════════════ */

.skeleton-pulse {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Toast Notification
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-notification {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-color);
  color: var(--bg-color);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Progress Modal
   ═══════════════════════════════════════════════════════════════════════════ */

.progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.progress-modal .progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.progress-modal .progress-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  min-width: 320px;
  animation: modal-fade-in 0.2s ease;
}

.progress-modal .progress-icon {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.progress-modal .progress-message {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-color);
}

.progress-modal .progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-modal .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #1a8cd8);
  border-radius: 3px;
  width: 0%;
  animation: progressAnim 3s ease-in-out infinite;
}

@keyframes progressAnim {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 95%; }
}

.progress-modal .progress-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Input Hint
   ═══════════════════════════════════════════════════════════════════════════ */

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Donate Button
   ═══════════════════════════════════════════════════════════════════════════ */

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #f91880;
  background: rgba(249, 24, 128, 0.1);
  border: 1px solid rgba(249, 24, 128, 0.2);
  text-decoration: none;
  transition: all 0.2s;
}

.donate-btn:hover {
  background: rgba(249, 24, 128, 0.2);
  text-decoration: none;
  color: #f91880;
}

.donate-btn i {
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive Tweaks for New Components
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .tweet-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .media-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .quality-select {
    font-size: 11px;
    padding: 5px 24px 5px 10px;
  }

  .toast-notification {
    width: calc(100% - 32px);
    text-align: center;
  }

  .progress-modal .progress-content {
    min-width: 0;
    width: 90vw;
    padding: 24px 16px;
  }
}

/* Media actions always visible on touch devices */
@media (hover: none) {
  .media-item .media-actions {
    opacity: 1;
    transform: translateY(0);
  }
  
  .media-item .media-info {
    opacity: 1;
  }
}