/*
 * X/Twitter Post Scraper Styles
 */

:root {
  --primary-color: #1d9bf0;
  --primary-hover: #1a8cd8;
  --bg-color: #15202b;
  --card-bg: #192734;
  --text-color: #e7e9ea;
  --text-secondary: #8899a6;
  --border-color: #38444d;
  --success-color: #00ba7c;
  --error-color: #f4212e;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding-top: 20px;
}

.header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-error {
  background-color: rgba(244, 33, 46, 0.15);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

.alert-success {
  background-color: rgba(0, 186, 124, 0.15);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

/* Form */
.scrape-form {
  margin-bottom: 30px;
}

.form-group {
  display: flex;
  gap: 10px;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.url-input:focus {
  border-color: var(--primary-color);
}

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

.submit-btn {
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

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

/* Recent Posts */
.recent-posts {
  margin-top: 40px;
}

.recent-posts h2 {
  font-size: 1.25rem;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.posts-list {
  list-style: none;
}

.post-item {
  border-bottom: 1px solid var(--border-color);
}

.post-item:last-child {
  border-bottom: none;
}

.post-link {
  display: block;
  padding: 15px 0;
  text-decoration: none;
  color: var(--text-color);
  transition: background-color 0.2s;
}

.post-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.post-author {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}

.post-text {
  font-size: 0.95rem;
}

/* Navigation */
.nav {
  margin-bottom: 20px;
}

.back-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Post Card */
.post-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

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

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-name {
  font-weight: 700;
  font-size: 1rem;
  color: white;
  text-decoration: none;
}

.author-name:hover {
  text-decoration: underline;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.verification-badge.government {
  color: #829aab;
}

.verification-badge.organization {
  color: #d4af37;
}

.author-username {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}

.author-username:hover {
  text-decoration: underline;
}

/* Post Content */
.post-content {
  margin-bottom: 16px;
}

.post-text {
  font-size: 1.1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-text p {
  margin-bottom: 0.5em;
}

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

/* Edit Indicator */
.edit-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.edit-badge {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.edit-time {
  color: var(--text-secondary);
}

.edit-count {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Media */
.post-media {
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.media-item {
  border-radius: 12px;
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: auto;
  display: block;
}

.post-video {
  width: 100%;
  max-height: 500px;
  background-color: black;
}

/* Post Footer */
.post-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.post-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-icon {
  font-size: 1.1rem;
}

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

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.post-links {
  margin-top: 12px;
}

.original-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.original-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .form-group {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
  }

  .post-stats {
    flex-wrap: wrap;
    gap: 16px;
  }
}
