/* ============================================================
   style.css  —  Social Media DB Viewer
   Simple, plain, student-level CSS. No animations. No libraries.
   ============================================================ */

/* --- Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #222;
  min-height: 100vh;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background-color: #1e2a45;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 54px;
  gap: 30px;
}

.nav-brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

/* Default tab button */
.tab-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Active tab — white background, navy text */
.tab-btn.active {
  background-color: #ffffff;
  color: #1e2a45;
  font-weight: bold;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding: 24px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Tab sections — hidden by default */
.tab-section {
  display: none;
}

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

.section-title {
  font-size: 20px;
  margin-bottom: 16px;
  color: #1e2a45;
  border-bottom: 2px solid #1e2a45;
  padding-bottom: 6px;
}

/* ============================================================
   CARDS GRID  (used by Feed and Groups)
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Individual card */
.card {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Feed card specifics */
.card .card-username {
  font-weight: bold;
  font-size: 15px;
  color: #1e2a45;
  margin-bottom: 6px;
}

.card .card-content {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.5;
}

.card .card-date {
  font-size: 12px;
  color: #777;
  margin-bottom: 10px;
}

.card .card-visibility {
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
  text-transform: capitalize;
}

/* Likes / Comments bar at bottom of feed card */
.card .card-footer {
  display: flex;
  gap: 18px;
  border-top: 1px solid #eee;
  padding-top: 8px;
  font-size: 13px;
  color: #555;
}

/* Group card specifics */
.card .group-name {
  font-weight: bold;
  font-size: 15px;
  color: #1e2a45;
  margin-bottom: 6px;
}

.card .group-desc {
  font-size: 13px;
  color: #444;
  margin-bottom: 10px;
  line-height: 1.5;
}

.card .group-members {
  font-size: 13px;
  color: #555;
}

/* ============================================================
   TABLE  (used by Users tab and Stats sub-tables)
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 14px;
}

thead tr {
  background-color: #e8e8e8;
}

th {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #c5c5c5;
  font-weight: bold;
  color: #1e2a45;
}

td {
  padding: 9px 12px;
  border: 1px solid #d5d5d5;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* ============================================================
   HASHTAGS
   ============================================================ */
.hashtags-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

/* Blue badge / chip */
.hashtag-badge {
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hashtag-badge .badge-count {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 12px;
}

/* ============================================================
   STATS TAB — stat boxes
   ============================================================ */

/* Row of big stat boxes */
.stat-boxes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

/* Individual stat box */
.stat-box {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  min-width: 130px;
  text-align: center;
  flex: 1 1 130px;
  max-width: 200px;
}

/* Big number — numeric stats */
.stat-box .stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #1e2a45;
  line-height: 1.1;
  word-break: break-word;
}

/* Date values get smaller font so the timestamp doesn't overflow */
.stat-box.stat-box--date .stat-number {
  font-size: 15px;
  font-weight: bold;
  color: #1e2a45;
}

.stat-box .stat-label {
  font-size: 12px;
  color: #777;
  margin-top: 5px;
}

/* ============================================================
   CHARTS SECTION
   ============================================================ */
.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 26px;
}

/* Wide chart spans both columns */
.chart-block--wide {
  grid-column: 1 / -1;
}

/* Individual chart card */
.chart-block {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.chart-title {
  font-size: 14px;
  font-weight: bold;
  color: #1e2a45;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

/* Canvas fills its container width */
.chart-block canvas {
  display: block;
  width: 100% !important;
}

/* ============================================================
   STATS SQL TABLES (below charts)
   ============================================================ */
.stats-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.stats-table-block {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stats-table-block h3 {
  font-size: 13px;
  color: #1e2a45;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

/* Responsive: stack on small screens */
@media (max-width: 680px) {
  .stats-tables,
  .charts-section {
    grid-template-columns: 1fr;
  }

  .chart-block--wide {
    grid-column: auto;
  }

  .stat-boxes-row {
    justify-content: center;
  }
}
