/* =========================================================
   GLOBAL THEME - White & Blue, animated
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --primary: #1565ff;
  --primary-dark: #0b3fb8;
  --primary-light: #eaf1ff;
  --accent: #00c2ff;
  --bg: #f4f8ff;
  --white: #ffffff;
  --text: #17203a;
  --text-muted: #6b7891;
  --border: #e3ecfb;
  --success: #17c964;
  --danger: #ff4d5e;
  --warning: #ffb020;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(21, 101, 255, 0.08);
  --shadow-lg: 0 20px 60px rgba(21, 101, 255, 0.15);
}

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

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
::-webkit-scrollbar-track { background: var(--primary-light); }

/* ---------------- Animated background blobs ---------------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 12s ease-in-out infinite;
}
.blob.b1 { width: 420px; height: 420px; background: var(--primary); top: -120px; left: -100px; }
.blob.b2 { width: 380px; height: 380px; background: var(--accent); bottom: -140px; right: -100px; animation-delay: 3s; }
.blob.b3 { width: 300px; height: 300px; background: #7ea8ff; top: 40%; left: 60%; animation-delay: 6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  50% { transform: translateY(-40px) translateX(30px) scale(1.08); }
}

/* ---------------- Fade / slide in ---------------- */
.fade-up {
  animation: fadeUp 0.7s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Safety net: if the animation never fires/finishes for any reason
   (slow CSS load, browser quirk, JS re-render clearing the class timing,
   reduced-motion settings, etc.), content must still be visible instead
   of stuck at opacity:0. */
@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; opacity: 1; transform: none; }
}
.fade-up.d1 { animation-delay: .1s; }
.fade-up.d2 { animation-delay: .2s; }
.fade-up.d3 { animation-delay: .3s; }
.fade-up.d4 { animation-delay: .4s; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(21, 101, 255, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(21, 101, 255, 0.4); }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------------- Card ---------------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 26px;
}

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fbfdff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  transition: border 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(21, 101, 255, 0.12);
}
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccd8ee; transition: .3s; border-radius: 34px;
}
.slider-toggle::before {
  position: absolute; content: ""; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
input:checked + .slider-toggle { background: var(--primary); }
input:checked + .slider-toggle::before { transform: translateX(22px); }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(23,201,100,.12); color: var(--success); }
.badge-danger { background: rgba(255,77,94,.12); color: var(--danger); }
.badge-warning { background: rgba(255,176,32,.15); color: #b17800; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
  text-align: left; padding: 14px 16px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border);
}
table.data-table td {
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
table.data-table tr:hover td { background: var(--primary-light); }

/* ---------------- Alerts ---------------- */
.alert { padding: 14px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; }
.alert-success { background: rgba(23,201,100,.1); color: #0d8b47; border: 1px solid rgba(23,201,100,.3); }
.alert-danger { background: rgba(255,77,94,.1); color: #c8303e; border: 1px solid rgba(255,77,94,.3); }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(21,101,255,.2); }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 20, 50, 0.5);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 999;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff; border-radius: 18px; padding: 28px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .25s ease;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { cursor: pointer; font-size: 22px; color: var(--text-muted); border: none; background: none; }

/* ---------------- Scroll reveal for logs ---------------- */
.pulse-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--success);
  display: inline-block; margin-right: 6px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(23,201,100,.5); }
  70% { box-shadow: 0 0 0 8px rgba(23,201,100,0); }
  100% { box-shadow: 0 0 0 0 rgba(23,201,100,0); }
}

/* ---------------------------------------------------------
   Global micro-interactions (extra polish)
--------------------------------------------------------- */
a, button, .btn, .stat-card, .rc-card, .feature-card, input, select, textarea,
.sidebar nav a, .support-fab-btn, .support-fab-item {
  transition: all .25s ease;
}

.navbar .brand img { transition: transform .35s ease; }
.navbar .brand:hover img { transform: rotate(-8deg) scale(1.06); }

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(21,101,255,.12);
  transform: translateY(-1px);
}

.btn-outline, .rc-action-btn {
  transition: all .25s ease;
}
.btn-outline:hover, .rc-action-btn:hover { transform: translateY(-2px); }

img { transition: opacity .3s ease; }

/* Subtle entrance for cards not already using fade-up */
.card { animation: cardIn .5s ease; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Support FAB (Facebook / WhatsApp / Messenger / Telegram)
--------------------------------------------------------- */
.support-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.support-fab-btn {
  width: 58px; height: 58px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 10px 28px rgba(21,101,255,.4);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: fabPulse 2.4s ease-in-out infinite;
}
.support-fab-btn:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 16px 36px rgba(21,101,255,.5); }
.support-fab-btn:active { transform: scale(.94); }

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(21,101,255,.4), 0 0 0 0 rgba(21,101,255,.35); }
  50% { box-shadow: 0 10px 28px rgba(21,101,255,.4), 0 0 0 12px rgba(21,101,255,0); }
}

.support-fab-icon {
  position: absolute; display: flex; align-items: center; justify-content: center;
  transition: opacity .25s ease, transform .3s ease;
}
.support-fab-icon-open { opacity: 1; transform: rotate(0deg) scale(1); }
.support-fab-icon-close { opacity: 0; transform: rotate(-45deg) scale(.6); }
.support-fab.active .support-fab-icon-open { opacity: 0; transform: rotate(45deg) scale(.6); }
.support-fab.active .support-fab-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

.support-fab-menu {
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.support-fab-item {
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(14px) scale(.9);
  pointer-events: none;
}
.support-fab.active .support-fab-item {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.support-fab-item-label {
  background: var(--text); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateX(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.support-fab-item:hover .support-fab-item-label { opacity: 1; transform: translateX(0); }
.support-fab-item-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.support-fab-item-icon img { width: 22px; height: 22px; }
.support-fab-item:hover .support-fab-item-icon { transform: translateY(-3px) scale(1.08); }

@media (max-width: 600px) {
  .support-fab { right: 16px; bottom: 16px; }
  .support-fab-item-label { display: none; }
}