:root {
  --bg-primary: #000000;
  --bg-secondary: #16181c;
  --bg-hover: #181818;
  --border-color: #2f3336;
  --text-primary: #e7e9ea;
  --text-secondary: #71767b;
  --accent-color: #1d9bf0;
  --accent-hover: #1a8cd8;
  --badge-bg: #202e3a;
  --badge-text: #1d9bf0;
  --card-bg: #000000;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9f9;
  --bg-hover: #eff3f4;
  --border-color: #eff3f4;
  --text-primary: #0f1419;
  --text-secondary: #536471;
  --accent-color: #1d9bf0;
  --accent-hover: #1a8cd8;
  --badge-bg: #e8f5fd;
  --badge-text: #1d9bf0;
  --card-bg: #ffffff;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-layout {
  display: flex;
  width: 100%;
  max-width: 1250px;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  border-right: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  font-size: 28px;
  padding: 12px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 9999px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  background-color: var(--bg-hover);
  font-weight: 700;
}

.theme-toggle-container {
  margin-top: auto;
  padding-bottom: 20px;
}

.theme-toggle-btn {
  width: 100%;
  padding: 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 650px;
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  z-index: 10;
}
[data-theme="light"] .header {
  background-color: rgba(255, 255, 255, 0.75);
}

.header-title h2 {
  font-size: 19px;
  font-weight: 700;
}

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

/* Profile Card */
.profile-card {
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.banner {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg-secondary);
}

.profile-meta {
  padding: 0 16px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: -45px;
  margin-bottom: 12px;
}

.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--bg-primary);
  background-color: var(--bg-secondary);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-details h3 {
  font-size: 20px;
  font-weight: 800;
}

.handle {
  font-size: 14px;
  color: var(--text-secondary);
}

.shadowban-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 600;
}

.bio {
  padding: 0 16px 16px 16px;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Filters */
.filter-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  padding: 10px 40px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-color);
}

.clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

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

.date-filter input {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.options-filter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.btn-secondary {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

/* Tweets Container */
.tweets-container {
  display: flex;
  flex-direction: column;
}

.tweet-card {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  transition: background 0.15s;
}

.tweet-card:hover {
  background-color: var(--bg-hover);
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.tweet-body {
  flex: 1;
}

.tweet-header {
  display: flex;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 4px;
}

.tweet-name {
  font-weight: 700;
  color: var(--text-primary);
}

.tweet-handle, .tweet-time {
  color: var(--text-secondary);
}

.tweet-text {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

/* Media Grid */
.tweet-media-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-radius: 16px;
  overflow: hidden;
  margin-top: 8px;
}

.media-item {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.media-item:hover {
  opacity: 0.9;
}

video.media-item {
  width: 100%;
  border-radius: 12px;
}

/* Tweet Metrics */
.tweet-actions {
  display: flex;
  justify-content: space-between;
  max-width: 400px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.action-btn:hover {
  color: var(--accent-color);
}

/* Right Widgets */
.right-widgets {
  width: 320px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget-box {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px;
}

.widget-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.badge-success {
  color: #00ba7c;
  font-weight: 600;
}

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

.modal.active {
  display: flex;
}

.modal-content-wrapper {
  max-width: 90%;
  max-height: 90%;
}

.modal-content-wrapper img, .modal-content-wrapper video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1000px) {
  .right-widgets {
    display: none;
  }
}

@media (max-width: 700px) {
  .sidebar span {
    display: none;
  }
  .sidebar {
    width: 60px;
    padding: 10px;
  }
}
