/* notasX — Twitter clásico (pre-Elon) */

:root {
  --blue: #1DA1F2;
  --blue-hover: #1a91da;
  --dark: #14171A;
  --gray: #657786;
  --light-gray: #AAB8C2;
  --extra-light: #E1E8ED;
  --bg: #F5F8FA;
  --white: #FFFFFF;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  border-left: 1px solid var(--extra-light);
  border-right: 1px solid var(--extra-light);
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  z-index: 10;
  border-bottom: 1px solid var(--extra-light);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}

.bird-icon {
  fill: var(--blue);
  flex-shrink: 0;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
}

.tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(29, 161, 242, 0.06);
  color: var(--dark);
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 16px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 999px;
  border: 1px solid var(--extra-light);
  transition: border-color 0.2s, background 0.2s;
}

.search-bar:focus-within {
  border-color: var(--blue);
  background: var(--white);
}

.search-bar svg {
  fill: var(--gray);
  flex-shrink: 0;
}

.search-bar:focus-within svg {
  fill: var(--blue);
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--dark);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--light-gray);
}

/* Timeline */
#timeline {
  display: flex;
  flex-direction: column;
}

/* Tweet */
.tweet {
  padding: 12px 16px;
  border-bottom: 1px solid var(--extra-light);
  transition: background 0.15s;
  cursor: default;
}

.tweet:hover {
  background: rgba(0, 0, 0, 0.015);
}

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

.tweet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.tweet-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark);
  white-space: nowrap;
}

.tweet-handle {
  font-size: 0.85rem;
  color: var(--gray);
  white-space: nowrap;
}

.tweet-dot {
  color: var(--gray);
  font-size: 0.85rem;
}

.tweet-date {
  font-size: 0.85rem;
  color: var(--gray);
  white-space: nowrap;
}

.tweet-time {
  font-size: 0.85rem;
  color: var(--light-gray);
  white-space: nowrap;
  margin-left: auto;
}

/* RT label */
.rt-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  padding-top: 6px;
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 600;
}

.rt-label svg {
  fill: var(--gray);
  width: 14px;
  height: 14px;
}

/* Reply label */
.reply-label {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 4px;
}

.reply-label a {
  color: var(--blue);
  text-decoration: none;
}

.reply-label a:hover {
  text-decoration: underline;
}

/* Tweet body */
.tweet-text {
  font-size: 0.95rem;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tweet-likes {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--gray);
}

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

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

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

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

/* Media */
.tweet-media {
  margin-top: 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--extra-light);
}

.tweet-media.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.tweet-media.grid-3,
.tweet-media.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 2px;
}

.tweet-media img,
.tweet-media video {
  width: 100%;
  display: block;
  cursor: pointer;
  object-fit: cover;
  max-height: 300px;
  transition: opacity 0.15s;
}

.tweet-media img:hover,
.tweet-media video:hover {
  opacity: 0.92;
}

/* Load more */
.load-more {
  display: block;
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--extra-light);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--blue);
  cursor: pointer;
  transition: background 0.15s;
}

.load-more:hover {
  background: rgba(29, 161, 242, 0.06);
}

/* Loading */
.loading {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray);
  font-size: 0.9rem;
}

/* Media modal */
.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-modal-close {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.media-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.media-modal-content {
  max-width: 90vw;
  max-height: 90vh;
}

.media-modal-content img,
.media-modal-content video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

/* Stats bar */
.stats-bar {
  padding: 8px 16px;
  border-bottom: 1px solid var(--extra-light);
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--gray);
  background: var(--white);
}

.stats-bar span strong {
  color: var(--dark);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    border: none;
  }
}

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

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

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

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

/* Year separator */
.year-separator {
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray);
  background: var(--bg);
  border-bottom: 1px solid var(--extra-light);
  position: sticky;
  top: 100px;
  z-index: 5;
}

/* Theme toggle */
.theme-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: rgba(29, 161, 242, 0.1);
}

.theme-toggle svg {
  fill: var(--blue);
  width: 20px;
  height: 20px;
}

/* Dark theme — Twitter "Dim" (pre-Elon dark mode) */
html[data-theme="dark"] {
  --blue: #1DA1F2;
  --blue-hover: #1a91da;
  --dark: #D9D9D9;
  --gray: #8899A6;
  --light-gray: #657786;
  --extra-light: #38444D;
  --bg: #15202B;
  --white: #192734;
}

[data-theme="dark"] header {
  background: rgba(25, 39, 52, 0.97);
}

[data-theme="dark"] .tweet:hover {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .tab:hover {
  background: rgba(29, 161, 242, 0.08);
}

[data-theme="dark"] .load-more:hover {
  background: rgba(29, 161, 242, 0.08);
}

[data-theme="dark"] .search-bar:focus-within {
  background: var(--white);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(29, 161, 242, 0.15);
}
