/* FeedTimeline.css */

.feed-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

/* Compact view styles */
.feed-timeline.compact-view {
  gap: 0;
}

.compact-records-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.compact-records-table th {
  background-color: var(--navbar-bg);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--card-border);
}

.compact-records-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-records-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .compact-records-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.compact-records-table .collection-col {
  width: 15%;
  max-width: 120px;
}

.compact-records-table .time-col {
  width: 15%;
  max-width: 120px;
}

.compact-records-table .type-col {
  width: 15%;
  max-width: 120px;
}

.compact-records-table .content-col {
  width: 45%;
}

.compact-records-table .actions-col {
  width: 10%;
  max-width: 80px;
  text-align: right;
}

.compact-collection {
  font-weight: 600;
  font-size: 0.8rem;
}

.compact-time {
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.8;
}

.compact-type {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.compact-content {
  cursor: pointer;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
  background-color: var(--background);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
  transition: background-color 0.2s, color 0.2s;
}

.compact-content:hover {
  background-color: var(--button-bg);
  color: white;
}

.compact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.compact-view-json {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.compact-view-json:hover {
  opacity: 1;
}

.compact-view-json::before {
  content: "{…}";
  font-family: monospace;
  font-size: 10px;
  color: var(--text);
}

.compact-bsky-link {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.compact-bsky-link:hover {
  opacity: 1;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: bold;
  color: white;
}

.reply-badge {
  background-color: #0288d1;
}

.quote-badge {
  background-color: #7e57c2;
}

/* Row coloring */
.bsky-row {
  border-left: 3px solid rgba(0, 133, 255, 0.5);
}

.atproto-row {
  border-left: 3px solid rgba(0, 51, 102, 0.5);
}

.record-link-compact {
  color: var(--button-bg);
  text-decoration: underline;
  cursor: pointer;
}
  
  .feed-item {
    background: var(--navbar-bg);
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 5px solid var(--card-border);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .feed-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
  }
  
  .feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
  }
  
  .collection-type {
    display: flex;
    align-items: center;
  }
  
  .collection-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--button-bg);
  }
  
  /* Different styling for Bluesky vs ATProto collections */
  .bsky-collection {
    color: #0085ff; /* Lighter blue for Bluesky */
  }
  
  .atproto-collection {
    color: #003366; /* Darker blue for ATProto */
  }
  
  /* Different border styling for items */
  .bsky-item {
    border-color: rgba(0, 133, 255, 0.5); /* Lighter blue for Bluesky */
  }
  
  .atproto-item {
    border-color: rgba(0, 51, 102, 0.5); /* Darker blue for ATProto */
  }
  
  .collection-full {
    margin-left: 8px;
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.7;
  }
  
  .record-rkey {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.8;
    background-color: var(--background);
    padding: 3px 8px;
    border-radius: 4px;
  }
  
  .feed-item-content {
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
  }
  
  .record-type,
  .record-subject,
  .record-text,
  .record-content {
    margin: 8px 0;
    font-size: 0.95rem;
    color: var(--text);
    word-break: break-word;
  }
  
  .type-label,
  .subject-label,
  .text-label,
  .content-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 5px;
  }
  
  .feed-item-footer {
    display: flex;
    justify-content: flex-end;
  }
  
  .record-timestamp {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.7;
    font-style: italic;
  }
  
  /* Modal styles */
  .record-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: backdropFadeIn 0.2s ease-out;
  }
  
  @keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .record-modal {
    background-color: var(--navbar-bg);
    border-radius: 16px;
    border: 3px solid var(--card-border);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    animation: modalFadeIn 0.3s ease-out;
  }
  
  @keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .record-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background-color: var(--navbar-bg);
    z-index: 5;
    padding-top: 5px;
  }
  
  .record-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--button-bg);
    margin: 0;
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .record-modal-close {
    width: 36px;
    height: 36px;
    background-color: var(--background);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    opacity: 0.8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
  }
  
  .record-modal-close:hover {
    opacity: 1;
    background-color: rgba(var(--button-bg-rgb), 0.15);
    color: var(--button-bg);
    transform: rotate(90deg);
  }
  
  .record-modal-content {
    margin-bottom: 20px;
  }
  
  .record-modal-loading {
    text-align: center;
    padding: 40px 30px;
    color: var(--text);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-weight: 500;
  }
  
  .loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(var(--button-bg-rgb), 0.2);
    border-top-color: var(--button-bg);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
  }
  
  @keyframes spinner {
    to { transform: rotate(360deg); }
  }
  
  .record-modal-error {
    color: #e74c3c;
    padding: 15px;
    border-radius: 8px;
    background-color: rgba(231, 76, 60, 0.1);
    margin-bottom: 20px;
    font-size: 0.95rem;
    border: 1px solid rgba(231, 76, 60, 0.3);
  }
  
  .record-modal-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
    margin-top: 15px;
  }
  
  .record-link {
    color: var(--button-bg);
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dashed;
    padding-bottom: 1px;
    transition: all 0.2s;
  }
  
  .record-link:hover {
    border-bottom: 1px solid;
    opacity: 0.85;
  }
  
  .record-key-link {
    cursor: pointer;
    color: var(--button-bg);
    text-decoration: none;
    border-bottom: 1px dashed;
    padding-bottom: 1px;
    transition: border-bottom 0.2s;
  }
  
  .record-key-link:hover {
    border-bottom: 1px solid;
  }
  
  .bsky-link {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    margin-right: 12px;
    color: var(--button-bg);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    padding: 4px 10px;
    border-radius: 6px;
    background-color: rgba(var(--button-bg-rgb), 0.08);
  }
  
  .bsky-link:hover {
    background-color: rgba(var(--button-bg-rgb), 0.15);
    transform: translateY(-1px);
  }
  
  .bsky-link:active {
    transform: translateY(0);
  }
  
  .bsky-link svg {
    margin-right: 6px;
  }
  
  .bsky-link-text {
    font-weight: 500;
  }
  
  .bsky-link-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .post-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .post-type-reply {
    background-color: rgba(79, 195, 247, 0.15);
    color: #0288d1;
  }
  
  .post-type-quote {
    background-color: rgba(126, 87, 194, 0.15);
    color: #7e57c2;
  }
  
  .dark-mode .post-type-reply {
    background-color: rgba(79, 195, 247, 0.3);
    color: #81d4fa;
  }
  
  .dark-mode .post-type-quote {
    background-color: rgba(126, 87, 194, 0.3);
    color: #b39ddb;
  }
  
  .record-json-container {
    background-color: var(--background);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .dark-mode .record-json-container {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .record-json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background-color: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    color: var(--button-bg);
  }
  
  .dark-mode .record-json-header {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  .copy-json-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s ease;
    font-weight: 500;
  }
  
  .copy-json-button:hover {
    background-color: var(--button-bg);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  
  .copy-json-button:active {
    transform: translateY(0);
  }
  
  .copy-json-button.copied {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
  }
  
  .copy-json-button.copied::after {
    content: "✓";
    margin-left: 5px;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .record-json {
    padding: 18px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 350px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
    scrollbar-width: thin;
  }
  
  .record-json::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  .record-json::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }
  
  .record-json::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
  
  .dark-mode .record-json::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .dark-mode .record-json::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  .record-uri {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    background-color: var(--background);
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
  }
  
  /* Dark mode overrides */
  .dark-mode .feed-item {
    background: #2c2c2c;
    border: 5px solid #444;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6);
  }
  
  .dark-mode .bsky-collection {
    color: #4da8ff; /* Lighter blue for Bluesky in dark mode */
  }
  
  .dark-mode .atproto-collection {
    color: #6699cc; /* Slightly lighter blue for ATProto in dark mode */
  }
  
  .dark-mode .bsky-item {
    border-color: rgba(77, 168, 255, 0.5); /* Lighter blue for Bluesky in dark mode */
  }
  
  .dark-mode .atproto-item {
    border-color: rgba(102, 153, 204, 0.5); /* Darker blue for ATProto in dark mode */
  }
  
  .dark-mode .feed-item-header,
  .dark-mode .feed-item-content {
    border-color: #555;
  }
  
  /* Dark mode compact view styles */
  .dark-mode .compact-records-table {
    border-color: #444;
  }
  
  .dark-mode .compact-records-table th {
    background-color: #333;
    border-color: #444;
  }
  
  .dark-mode .compact-records-table td {
    border-color: #444;
  }
  
  .dark-mode .bsky-row {
    border-left-color: rgba(77, 168, 255, 0.5);
  }
  
  .dark-mode .atproto-row {
    border-left-color: rgba(102, 153, 204, 0.5);
  }
  
  .dark-mode .compact-view-json::before {
    color: #ddd;
  }
  
  /* Responsive styles */
  @media (max-width: 600px) {
    .feed-item-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
    
    .record-rkey {
      align-self: flex-start;
    }
    
    .feed-item-content {
      font-size: 0.9rem;
    }
    
    /* Compact view responsive adjustments */
    .compact-records-table {
      display: block;
      width: 100%;
    }
    
    .compact-records-table thead {
      display: none; /* Hide table headers on mobile */
    }
    
    .compact-records-table tbody {
      display: block;
      width: 100%;
    }
    
    .compact-records-table tr {
      display: flex;
      flex-direction: column;
      padding: 10px;
      border-bottom: 1px solid var(--card-border);
      position: relative;
    }
    
    .compact-records-table td {
      display: block;
      width: 100%;
      max-width: none;
      border: none;
      padding: 3px 0;
      position: relative;
    }
    
    /* Add labels on mobile */
    .compact-records-table td.collection-col::before {
      content: "Collection: ";
      font-weight: 600;
      opacity: 0.6;
    }
    
    .compact-records-table td.time-col::before {
      content: "Time: ";
      font-weight: 600;
      opacity: 0.6;
    }
    
    .compact-records-table td.type-col::before {
      content: "Type: ";
      font-weight: 600;
      opacity: 0.6;
    }
    
    .compact-records-table td.content-col::before {
      content: "Content: ";
      font-weight: 600;
      opacity: 0.6;
    }
    
    .compact-records-table td.actions-col {
      position: absolute;
      right: 10px;
      top: 10px;
      width: auto;
      padding: 0;
    }
    
    .compact-content {
      white-space: normal;
      word-break: break-all;
      display: inline-block;
      margin-top: 2px;
    }
    
    .compact-records-table td.content-col::before {
      content: "TID: ";
      font-weight: 600;
      opacity: 0.6;
    }
  }