/* ============================================
   Vintage Twitter (~2012-2015) Timeline
   ============================================ */

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

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #e8ebed;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #2b7bb9;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: #1a5b8c;
}

/* ---- Top Navigation ---- */
#top-nav {
  background: #55acee;
  background: linear-gradient(to bottom, #62b2ee, #4da3e8);
  border-bottom: 1px solid #3d90d0;
  height: 46px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.nav-inner {
  max-width: 1190px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}

.nav-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.bird-logo {
  cursor: pointer;
  opacity: 0.95;
  transition: opacity 0.15s;
}
.bird-logo:hover {
  opacity: 1;
}

.nav-search {
  flex: 1;
  max-width: 260px;
  margin: 0 auto;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 6px 32px 6px 12px;
  border: 1px solid #3d90d0;
  border-radius: 14px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}
.nav-search input::placeholder {
  color: rgba(255,255,255,0.7);
}
.nav-search input:focus {
  background: #fff;
  color: #333;
  border-color: #fff;
}
.nav-search input:focus::placeholder {
  color: #999;
}

#search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-right {
  flex: 0 0 auto;
  width: 26px;
}

/* ---- Main Layout ---- */
#main-container {
  max-width: 1190px;
  margin: 62px auto 0;
  display: flex;
  gap: 16px;
  padding: 0 16px;
}

#sidebar-left {
  flex: 0 0 290px;
  min-width: 0;
}

#timeline-col {
  flex: 1;
  min-width: 0;
  max-width: 590px;
}

#sidebar-right {
  flex: 0 0 290px;
  min-width: 0;
}

/* ---- Profile Card ---- */
.profile-card {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.profile-banner {
  height: 95px;
  background: #55acee;
  background: linear-gradient(135deg, #55acee 0%, #3d8ed0 50%, #2b6faa 100%);
}

.profile-info {
  padding: 0 16px 12px;
  position: relative;
}

.profile-avatar {
  margin-top: -36px;
  margin-bottom: 8px;
}

.egg-avatar svg {
  border: 3px solid #fff;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.profile-avatar-img {
  width: 72px;
  height: 72px;
  border: 3px solid #fff;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  object-fit: cover;
}

.profile-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.profile-handle {
  color: #8899a6;
  font-size: 13px;
}

.profile-bio {
  margin-top: 8px;
  color: #555;
  font-size: 13px;
  line-height: 1.4;
}

.profile-stats {
  display: flex;
  border-top: 1px solid #e1e8ed;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  cursor: default;
  border-right: 1px solid #e1e8ed;
  transition: background 0.15s;
}
.stat:last-child {
  border-right: none;
}
.stat:hover {
  background: #f5f8fa;
}

.stat-count {
  display: block;
  font-weight: bold;
  color: #55acee;
  font-size: 16px;
}

.stat-label {
  display: block;
  color: #8899a6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ---- Sidebar Boxes ---- */
.sidebar-box {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.sidebar-box h3 {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e8ed;
}

.sidebar-text {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

/* Year filter */
#year-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#year-list li {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  background: #f5f8fa;
  color: #555;
  border: 1px solid #e1e8ed;
  transition: all 0.15s;
}
#year-list li:hover {
  background: #e8f4fd;
  border-color: #bdd8ec;
  color: #2b7bb9;
}
#year-list li.active {
  background: #55acee;
  color: #fff;
  border-color: #55acee;
}

/* Sort/filter */
#sort-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e1e8ed;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  background: #fff;
  margin-bottom: 10px;
  outline: none;
}
#sort-select:focus {
  border-color: #55acee;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  padding: 4px 0;
  cursor: pointer;
}
.filter-label input[type="checkbox"] {
  accent-color: #55acee;
}

/* Top tweets in sidebar */
.sidebar-top-tweet {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.sidebar-top-tweet:last-child {
  border-bottom: none;
}
.sidebar-top-tweet:hover {
  background: #f5f8fa;
  margin: 0 -16px;
  padding: 8px 16px;
}
.sidebar-top-tweet .top-tweet-text {
  font-size: 12px;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-top-tweet .top-tweet-stats {
  font-size: 11px;
  color: #8899a6;
  margin-top: 3px;
}

/* ---- Timeline ---- */
#timeline-header {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 6px 6px 0 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #55acee;
}

#timeline-header h2 {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

#results-count {
  font-size: 12px;
  color: #8899a6;
}

/* ---- Tweet Card ---- */
.tweet {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-top: none;
  padding: 12px 16px;
  transition: background 0.1s;
  position: relative;
}
.tweet:hover {
  background: #f5f8fa;
}

.tweet-inner {
  display: flex;
  gap: 10px;
}

.tweet-avatar {
  flex: 0 0 48px;
}

.tweet-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #c0deed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tweet-avatar-img svg {
  width: 48px;
  height: 48px;
}

.tweet-body {
  flex: 1;
  min-width: 0;
}

.tweet-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.tweet-name {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.tweet-handle {
  color: #8899a6;
  font-size: 13px;
}

.tweet-time {
  color: #8899a6;
  font-size: 13px;
  margin-left: auto;
  white-space: nowrap;
}

.tweet-reply-context {
  font-size: 12px;
  color: #8899a6;
  margin-bottom: 4px;
}
.tweet-reply-context svg {
  vertical-align: -2px;
  margin-right: 3px;
}

.tweet-text {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tweet-text .mention {
  color: #2b7bb9;
}
.tweet-text .hashtag {
  color: #2b7bb9;
}
.tweet-text .url-link {
  color: #2b7bb9;
}

/* Tweet media */
.tweet-media {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e1e8ed;
}

.tweet-media img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
}
.tweet-media img:hover {
  opacity: 0.92;
}

.tweet-media-grid {
  display: grid;
  gap: 2px;
}
.tweet-media-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}
.tweet-media-grid.grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.tweet-media-grid.grid-3 img:first-child {
  grid-row: 1 / 3;
}
.tweet-media-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
}
.tweet-media-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/12;
}

.tweet-media video {
  width: 100%;
  display: block;
  border-radius: 10px;
  max-height: 400px;
}

/* Tweet actions */
.tweet-actions {
  display: flex;
  gap: 0;
  margin-top: 8px;
  padding-top: 4px;
}

.tweet-action {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8899a6;
  font-size: 12px;
  padding: 4px 0;
  min-width: 80px;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}
.tweet-action:hover {
  text-decoration: none;
}

.tweet-action svg {
  width: 16px;
  height: 16px;
  fill: #8899a6;
  transition: fill 0.15s;
}

.tweet-action.action-reply:hover {
  color: #55acee;
}
.tweet-action.action-reply:hover svg {
  fill: #55acee;
}

.tweet-action.action-rt:hover {
  color: #19cf86;
}
.tweet-action.action-rt:hover svg {
  fill: #19cf86;
}

.tweet-action.action-fav:hover {
  color: #ffac33;
}
.tweet-action.action-fav:hover svg {
  fill: #ffac33;
}

.tweet-action .count {
  font-size: 12px;
}

/* Thread indicator */
.thread-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #55acee;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 14px;
  background: #e8f4fd;
  border: 1px solid #bdd8ec;
  margin-top: 8px;
  transition: background 0.15s;
}
.thread-indicator:hover {
  background: #d0e8f7;
}
.thread-indicator svg {
  width: 14px;
  height: 14px;
  fill: #55acee;
}

/* Thread connector line */
.tweet.in-thread::before {
  content: '';
  position: absolute;
  left: 39px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e1e8ed;
}

/* ---- Loading ---- */
#loading-spinner {
  text-align: center;
  padding: 30px;
  color: #8899a6;
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e1e8ed;
  border-top-color: #55acee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}

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

#end-of-timeline {
  text-align: center;
  padding: 30px;
  color: #8899a6;
  font-size: 13px;
  border: 1px solid #e1e8ed;
  border-top: none;
  background: #fff;
  border-radius: 0 0 6px 6px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  overflow-y: auto;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 600px;
  width: 95%;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  color: #8899a6;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
}
.modal-close:hover {
  color: #333;
}

.modal-title {
  padding: 14px 16px;
  font-size: 16px;
  border-bottom: 1px solid #e1e8ed;
}

.modal-content .tweet {
  border: none;
  border-bottom: 1px solid #e1e8ed;
}
.modal-content .tweet:last-child {
  border-bottom: none;
}

/* Thread connector in modal */
.modal-content .tweet.thread-connected {
  position: relative;
}
.modal-content .tweet.thread-connected::after {
  content: '';
  position: absolute;
  left: 39px;
  bottom: -1px;
  height: 14px;
  width: 2px;
  background: #ccd6dd;
}
.modal-content .tweet:last-child::after {
  display: none;
}

/* ---- Footer ---- */
.footer-box {
  border: none;
  background: transparent;
  padding: 8px 0;
}

.footer-links {
  font-size: 11px;
  color: #8899a6;
  line-height: 1.8;
}

/* ---- Image lightbox ---- */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  #sidebar-right {
    display: none;
  }
}

@media (max-width: 800px) {
  #sidebar-left {
    display: none;
  }
  #main-container {
    padding: 0 8px;
  }
  #timeline-col {
    max-width: 100%;
  }
  /* Show compact controls at top of timeline on mobile */
  .mobile-controls {
    display: flex !important;
  }
}

.mobile-controls {
  display: none;
  background: #fff;
  border: 1px solid #e1e8ed;
  border-top: none;
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mobile-controls select,
.mobile-controls label {
  font-size: 12px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #e8ebed;
}
::-webkit-scrollbar-thumb {
  background: #ccd6dd;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #99aab5;
}

/* ---- Search active state ---- */
.search-active #timeline-header h2::after {
  content: ' — Search Results';
  font-weight: normal;
  font-size: 14px;
  color: #8899a6;
}

/* Highlight search matches */
mark {
  background: #fff3b0;
  padding: 0 1px;
  border-radius: 2px;
}
