/* Matrix Admin — Custom Styles */

:root {
  --sidebar-width: 0px;
  --accent: #5865f2;
}

body {
  background-color: #0d1117;
  color: #c9d1d9;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.navbar {
  background-color: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
}

.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: .3px;
}

.nav-link {
  color: #8b949e !important;
  font-size: .875rem;
  padding: .5rem .9rem !important;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.nav-link:hover,
.nav-link.active {
  color: #e6edf3 !important;
  background: #21262d;
}

main.container-fluid {
  max-width: 1400px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Cards */
.card {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
}

.card-header {
  background-color: #1c2128;
  border-bottom: 1px solid #30363d;
  font-weight: 600;
  font-size: .875rem;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #1c2128;
  --bs-table-hover-bg: #21262d;
  --bs-table-border-color: #30363d;
  font-size: .875rem;
  color: #c9d1d9;
}

.table thead th {
  background-color: #1c2128;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
}

.table td, .table th {
  vertical-align: middle;
  padding: .6rem .9rem;
}

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #30363d;
}

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865f2, #9146ff);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Stat cards */
.stat-card {
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: .75rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Forms */
.form-control, .form-select {
  background-color: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}

.form-control:focus, .form-select:focus {
  background-color: #0d1117;
  border-color: #58a6ff;
  color: #c9d1d9;
  box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, .15);
}

.form-control::placeholder { color: #484f58; }

/* Buttons */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { background-color: #4752c4; border-color: #4752c4; }

/* Pagination */
.page-item .page-link {
  background-color: #161b22;
  border-color: #30363d;
  color: #8b949e;
}
.page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Search bar */
.search-bar {
  max-width: 340px;
}

/* Badges */
.badge { font-weight: 500; font-size: .72rem; }

/* Toast position fix */
.toast-container { z-index: 9999; }

/* Empty state */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #484f58;
}

.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }

/* Power level slider */
input[type=range] {
  accent-color: var(--accent);
}

/* Room type badge */
.room-type-space { color: #a371f7; }
.room-type-room  { color: #58a6ff; }

/* Server status dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background-color: #3fb950;
  box-shadow: 0 0 0 0 rgba(63, 185, 80, .5);
  animation: pulse-online 2s infinite;
}

.status-dot.offline {
  background-color: #f85149;
}

@keyframes pulse-online {
  0%   { box-shadow: 0 0 0 0   rgba(63, 185, 80, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(63, 185, 80, 0);  }
  100% { box-shadow: 0 0 0 0   rgba(63, 185, 80, 0);  }
}

/* Responsive table wrapper */
.table-responsive { border-radius: 8px; overflow: hidden; }

/* Inline action buttons */
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .85rem;
}

/* Room messages */
.message-file-link,
.message-attachment {
  color: #58a6ff;
  text-decoration: none;
}

.message-file-link:hover,
.message-attachment:hover {
  color: #79c0ff;
  text-decoration: underline;
}

.message-attachment-image {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  max-width: 100%;
}

.message-attachment-image img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #30363d;
  border-radius: 6px;
  background-color: #0d1117;
  flex-shrink: 0;
}

.message-media-control {
  display: block;
  width: min(100%, 420px);
  max-height: 240px;
}

@media (max-width: 768px) {
  main.container-fluid { padding: 1rem .75rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .message-attachment-image img {
    width: 56px;
    height: 56px;
  }
}
