/* ========== Global Styles ========== */
:root {
  --primary-color: #26c6da;
  --success-color: #4aa172;
  --warning-color: #feca57;
  --danger-color: #ff6b6b;
  --bg-dark: #1b1b24;
  --bg-darker: #111;
  --bg-card: #282936;
  --text-primary: #fff;
  --text-secondary: #8a8db6;
  --gradient-top: #313242;
  --gradient-bottom: #1B1B24;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-dark);
  background-image: linear-gradient(to bottom, var(--gradient-top), var(--gradient-bottom));
  color: var(--text-primary);
  min-height: 100vh;
}

/* ========== Navigation ========== */
.nav {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 10px;
  margin: 20px 0 30px 0;
  box-shadow: var(--box-shadow);
}

.nav-item {
  width: 20%;
  text-align: center;
  margin: 0;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 12px 15px !important;
  border-radius: 6px;
  transition: var(--transition);
  display: block;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background: rgba(38, 198, 218, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  color: var(--primary-color) !important;
  background: rgba(38, 198, 218, 0.15);
  font-weight: 600;
}

/* ========== Title Section ========== */
.title {
  margin: 20px 0 30px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.title h1, .title h2 {
  color: var(--text-primary);
  font-size: 1.5em;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.title h2 {
  font-size: 1.2em;
}

.title > span {
  color: var(--text-secondary);
  font-size: 0.9em;
}

#js-refresh {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1em;
}

#updateAt {
  color: var(--primary-color);
  margin-left: auto;
  font-size: 0.85em;
}

@media (max-width: 768px) {
  .title {
    flex-direction: column;
    align-items: flex-start;
  }

  #updateAt {
    margin-left: 0;
  }

  .nav-item {
    width: 50%;
    margin: 5px 0;
  }
}

/* ========== Tables ========== */
.table-container {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  overflow-x: auto;
}

.table {
  margin: 0;
  background: transparent !important;
}

.table thead th {
  background: rgba(38, 198, 218, 0.1);
  color: var(--primary-color);
  font-weight: 600;
  border: none;
  padding: 15px 10px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table tbody tr:hover {
  background: rgba(38, 198, 218, 0.05);
  transform: scale(1.01);
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table td, .table th {
  vertical-align: middle;
  text-align: center;
  padding: 15px 10px;
  font-size: 0.9em;
  border: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table td a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.table td a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ========== Status Colors ========== */
.status-success {
  color: var(--success-color) !important;
}

.status-warning {
  color: var(--warning-color) !important;
}

.status-danger {
  color: var(--danger-color) !important;
}

/* ========== Buttons ========== */
.btn {
  border-radius: 6px;
  font-weight: 500;
  padding: 8px 20px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 0.9em;
}

.btn-info {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-info:hover {
  background: #1fb5c9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(38, 198, 218, 0.3);
}

.btn-info:disabled {
  background: #4a4a5a;
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

#manual-refresh-btn {
  background: var(--primary-color);
  border: none;
  color: var(--bg-dark);
  font-weight: 600;
}

#manual-refresh-btn:hover {
  background: #1fb5c9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(38, 198, 218, 0.3);
}

#manual-refresh-btn:disabled {
  background: #4a4a5a;
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* ========== Statistics Section ========== */
.stats-container {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  margin-top: 30px;
}

.stats-container p {
  margin: 12px 0;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-container span {
  font-weight: 600;
  font-size: 1.1em;
}

/* ========== Footer ========== */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 20px 0;
  color: var(--text-secondary);
  background: var(--bg-darker);
  transition: var(--transition);
  line-height: 1.5;
  user-select: none;
  text-align: center;
  font-size: 0.9em;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.footer:hover {
  opacity: 0.8;
}

/* ========== Content Bottom Spacing ========== */
.bottom {
  margin-bottom: 100px;
  padding-bottom: 20px;
}

/* ========== Pre/Code Elements ========== */
pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--bg-dark);
  padding: 15px;
  border-radius: 6px;
  margin: 0;
  font-size: 0.85em;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table-container, .title, .stats-container {
  animation: fadeIn 0.5s ease-out;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ========== Responsive ========== */
@media (max-width: 576px) {
  .title h1 {
    font-size: 1.2em;
  }

  .table td, .table th {
    font-size: 0.8em;
    padding: 10px 5px;
  }

  .table thead th {
    font-size: 0.75em;
  }
}
