/* ========== STYLES CHO FLOATING HACK/MOD MENU ========== */

/* Nút Icon nổi (Floating Action Button) */
#ttn-fab-btn {
  position: fixed;
  right: 18px;
  top: 140px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1b4b, #4338ca, #3b82f6);
  color: #fff;
  border: 2px solid #60a5fa;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45), 0 0 12px rgba(96, 165, 250, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: grab;
  z-index: 999999;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

#ttn-fab-btn:active {
  cursor: grabbing;
  transform: scale(0.92);
}

#ttn-fab-btn:hover {
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.65), 0 0 20px rgba(96, 165, 250, 0.9);
}

#ttn-fab-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1.5px solid #fff;
}

/* Modal Mod Menu */
#ttn-mod-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#ttn-mod-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.ttn-mod-container {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#ttn-mod-modal.show .ttn-mod-container {
  transform: scale(1);
}

/* Header */
.ttn-mod-header {
  padding: 14px 18px;
  background: linear-gradient(90deg, #1e293b, #0f172a);
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ttn-mod-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  color: #38bdf8;
}

.ttn-mod-close {
  background: #334155;
  border: none;
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.ttn-mod-close:hover {
  background: #ef4444;
  color: #fff;
}

/* Tabs */
.ttn-mod-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: #1e293b;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 1px solid #334155;
}

.ttn-mod-tabs::-webkit-scrollbar {
  display: none;
}

.ttn-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ttn-tab-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.ttn-tab-btn:hover:not(.active) {
  background: #334155;
  color: #cbd5e1;
}

/* Content Body */
.ttn-mod-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ttn-mod-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.ttn-mod-pane.active {
  display: flex;
}

/* Section Box */
.ttn-sec-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ttn-sec-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Toggle Switches */
.ttn-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.ttn-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ttn-toggle-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
}

.ttn-toggle-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.25;
}

.ttn-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.ttn-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ttn-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #475569;
  border-radius: 24px;
  transition: 0.2s;
}

.ttn-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.ttn-switch input:checked + .ttn-slider {
  background-color: #10b981;
}

.ttn-switch input:checked + .ttn-slider:before {
  transform: translateX(20px);
}

/* Action Buttons */
.ttn-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ttn-btn-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ttn-act-btn {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-align: center;
}

.ttn-act-btn:hover {
  background: #475569;
  border-color: #64748b;
  transform: translateY(-1px);
}

.ttn-act-btn:active {
  transform: translateY(1px);
}

.ttn-act-btn.pri {
  background: #3b82f6;
  border-color: #60a5fa;
}

.ttn-act-btn.pri:hover {
  background: #2563eb;
}

.ttn-act-btn.success {
  background: #059669;
  border-color: #34d399;
}

.ttn-act-btn.success:hover {
  background: #047857;
}

.ttn-act-btn.warn {
  background: #d97706;
  border-color: #fbbf24;
}

.ttn-act-btn.danger {
  background: #dc2626;
  border-color: #f87171;
}

.ttn-act-btn.full-w {
  grid-column: 1 / -1;
}

/* Input Fields */
.ttn-input-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ttn-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
}

.ttn-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

/* Footer status bar */
.ttn-mod-footer {
  padding: 10px 16px;
  background: #0b1120;
  border-top: 1px solid #1e293b;
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.ttn-status-tag {
  color: #34d399;
  font-weight: 700;
}

/* TOAST NOTIFICATION CHO MOD MENU (LUÔN NỔI TRÊN CÙNG Z-INDEX CAO NHẤT) */
#ttn-mod-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #f8fafc;
  border: 1.5px solid #38bdf8;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.45);
  z-index: 99999999 !important;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
  max-width: 90vw;
}

#ttn-mod-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#ttn-mod-toast.success {
  border-color: #34d399;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(52, 211, 153, 0.5);
}

#ttn-mod-toast.warn {
  border-color: #fbbf24;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(251, 191, 36, 0.5);
}
