:root {
  --bg-body: #0a0c14;
  --bg-card: #121624;
  --bg-sidebar: #0d111c;
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --primary: #218bff;
  --primary-hover: #3898ff;
  --accent-blue: #004d99;

  --success: #238636;
  --warning: #d29922;
  --danger: #da3633;

  --border-color: #30363d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);

  --radius: 8px;
  --font-family: "Inter", sans-serif;

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
}

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

body {
  background-color: var(--bg-body);
  font-family: var(--font-family);
  color: var(--text-main);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

ul {
  list-style: none;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .logo-area {
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.logo-area {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.nav-menu li {
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(33, 139, 255, 0.1);
  color: var(--primary);
}

.nav-item i {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.sidebar-toggle {
  position: absolute;
  top: 24px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  border: 3px solid var(--bg-sidebar);
  z-index: 101;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  gap: 8px;
  transition: all 0.2s;
  font-size: 14px;
}
.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.filter-bar {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-select {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.filter-select:focus {
  border-color: var(--primary);
}

.d-flex {
  display: flex;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-10 {
  gap: 10px;
}
.gap-20 {
  gap: 20px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-4 {
  margin-bottom: 16px;
}
.text-muted {
  color: var(--text-muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: default;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pos {
  background: rgba(35, 134, 54, 0.15);
  color: #3fb950;
}
.badge-neu {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}
.badge-neg {
  background: rgba(218, 54, 51, 0.15);
  color: #f85149;
}
.badge-slang {
  background: rgba(255, 107, 0, 0.15);
  color: #ff6b00;
}

@media (max-width: 1024px) {
  .x-layout,
  .hero-section,
  .charts-grid {
    grid-template-columns: 1fr !important;
  }
  .sidebar-right {
    order: -1;
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100% !important;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
  }

  .sidebar.collapsed {
    height: 60px;
    overflow: hidden;
  }

  .sidebar-toggle {
    display: none;
  }

  .logo-area {
    margin-bottom: 0;
  }

  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
  }

  .nav-menu li {
    margin-bottom: 0;
  }

  .nav-text {
    font-size: 12px;
  }

  .nav-item {
    padding: 8px 12px;
  }

  .main-content {
    padding: 20px 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-header {
    display: none;
  }

  .comment-row {
    padding: 15px;
  }

  .comment-row > div {
    flex-direction: column;
    gap: 12px;
  }

  .col-user,
  .col-comment,
  .col-sentiment,
  .col-score {
    width: 100% !important;
    text-align: left !important;
  }

  .ai-explanation {
    margin-left: 0;
    margin-top: 15px;
  }

  .pagination-wrapper {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .hero-section {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .sentiment-boxes {
    flex-direction: column;
  }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.post-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.post-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.post-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-main);
  line-height: 1.4;
}

.post-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sentiment-bar {
  height: 4px;
  background: #2d333b;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  margin-top: 8px;
}

.seg-pos {
  background: var(--success);
}

.seg-neu {
  background: var(--warning);
}

.seg-neg {
  background: var(--danger);
}

/* insta detay */

.detail-container {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.post-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-preview-img {
  width: 100%;
  display: block;
}

.post-preview-body {
  padding: 20px;
}

.aggregate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.sentiment-boxes {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.sen-box {
  flex: 1;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid transparent;
}

.sen-box.pos {
  background: rgba(35, 134, 54, 0.1);
  border-color: rgba(35, 134, 54, 0.2);
  color: #3fb950;
}

.sen-box.neu {
  background: rgba(210, 153, 34, 0.1);
  border-color: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.sen-box.neg {
  background: rgba(218, 54, 51, 0.1);
  border-color: rgba(218, 54, 51, 0.2);
  color: #f85149;
}

.sen-score {
  font-size: 22px;
  font-weight: 700;
  display: block;
}

.sen-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.comments-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
}

.col-user {
  width: 180px;
}

.col-comment {
  flex: 1;
  margin-right: 20px;
}

.col-sentiment {
  width: 140px;
}

.col-score {
  width: 80px;
  text-align: right;
}

.comment-row {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.ai-explanation {
  background: rgba(33, 139, 255, 0.05);
  border-left: 3px solid var(--primary);
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  margin-left: 42px;
  display: flex;
  gap: 10px;
}

/* raporlar */

.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  position: relative;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.report-section {
  display: none;
}

.report-section.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius);
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.stat-trend-up {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.stat-trend-down {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius);
  height: 350px;
}

.content-thumb {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
}

.content-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.2s;
  border: 1px solid transparent;
}

.content-row:hover {
  background: rgba(33, 139, 255, 0.05);
  border-color: var(--border-color);
}

.x-layout {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

.tweet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.tweet-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.tweet-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #333;
}

.tweet-meta {
  flex: 1;
}

.tweet-name {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tweet-content {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 16px;
}

.tweet-actions {
  display: flex;
  gap: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.status-alert {
  background: rgba(218, 54, 51, 0.1);
  border-left: 3px solid var(--danger);
  padding: 16px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.trend-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.detail-container {
  max-width: 1200px;
  margin: 0 auto;
}

.tweet-focus-card {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  color: #fff;
  margin-bottom: 32px;
}

.focus-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.focus-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.focus-text {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.focus-meta {
  color: #8b949e;
  font-size: 14px;
  border-bottom: 1px solid #30363d;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.focus-stats {
  display: flex;
  gap: 24px;
  color: #8b949e;
  font-size: 14px;
}

.stat-b {
  color: #fff;
  font-weight: 700;
}

.x-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.x-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.syncWrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
