/* ==== POPUP ==== */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.popup-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}
.popup-content input {
  width: 80px;
  padding: 5px;
  margin-bottom: 10px;
}
.popup-content button {
  margin: 0 5px;
  padding: 5px 10px;
}

/* ==== TABLE ==== */
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  text-align: left;
  font-weight: normal;
}
td {
  border: 1px solid #f1f1f1;
  padding: 10px;
  text-align: left;
}
tr:nth-child(odd) td {
  background-color: #fafdff;
}
/* ==== BODY ==== */
body {
  font-family: "Segoe UI", sans-serif,  "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 14px;
  font-weight: normal;
  background-color: #f0f0f0;
}
.table-container {
  background-color: white;
  padding: 10px;
  border-radius: 4px;
  max-width: none;
  width: 1610px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressBarRightToLeft {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

#toast {
  position: fixed;
  top: 10px;
  right: 10px;
  display: none;
  flex-direction: column;
  background-color: #34db85;
  color: white;
  padding: 10px 12px;
  border-radius: 5px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-width: 200px;
  gap: 8px;
}
#toast.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  animation: slideDown 0.4s ease-out;
}
#toast.error {
  background-color: #ff4646;
}
#toast .content {
  display: flex;
  align-items: center;
  gap: 8px;
}
#toast #icon {
  width: 25px;
  height: 25px;
  border: 1px solid white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  user-select: none;
}
#toast #message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1; 
}
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  transform: scaleX(1);
  transform-origin: left;
}

/* ==== GHI CHÚ ==== */
.ghichu-container {
  display: flex;
  align-items: center;
  gap: 0px;
  padding-top: 10px;
}
.ghichu-display {
  padding: 6px 8px;
  background-color: #f9f9f9;
  border: 1px solid #eaedf1;
  border-radius: 0px;
  width: 170px;
  height: 32px;
  outline: none;
  color: #a9a9a9;
}
.ghichu-input {
  display: none;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 0px;
  width: 170px;
  height: 32px;
  outline: none;
  border-color: #00bfae;
}
.ghichu-icon {
  cursor: pointer;
  color: #868b91;
  margin-left: -20px;
}
.giahannhieu-display {
  padding: 6px 8px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 0px;
  width: 142px;
  height: 32px;
  outline: none;
}
.nhapipallow-display {
  padding: 6px 8px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 0px;
  width: 142px;
  height: 32px;
  outline: none;
}
/* ==== NHẬP SỐ NGÀY ==== */
.nhapsongay-display {
  padding: 6px 8px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 0px;
  width: 142px;
  height: 32px;
  outline: none;
}
/* ==== HTTP/SOCK INPUT ==== */
.http-input,
.sock-input {
  background: transparent;
  border: 1px solid #f1f1f1;
  border-left: none;
  border-bottom: none;
  border-top: none;
  outline: none;
  height: 32px;
  padding: 6px 8px;
  width: 180px;
  text-align: left;
  font-size: 11px;
}
.http-input {
  color: #00bfff;
}
.http-input:focus {
  background-color: #20a53a10;
}
.sock-input {
  color: #fe721c;
}
.sock-input:focus {
  background-color: #20a53a10;
}

.userpass-input {
  background: transparent;
  color: #00bfff;
  border: 0px solid transparent;
  outline: none;
  height: 30px;
  padding: 6px 5px;
  width: 260px;
  text-align: left;
  font-size: 11px;
}
.userpass-input {
  color: #00bfff;
}
.userpass-input:focus {
  border-color: #00bfae;
}
.sockuserpass-input {
  background: transparent;
  color: #fe721c;
  border: 0px solid transparent;
  outline: none;
  height: 30px;
  padding: 6px 5px;
  width: 260px;
  text-align: left;
  font-size: 11px;
}
.sockuserpass-input {
  color: #fe721c;
}
.sockuserpass-input:focus {
  border-color: #00bfae;
}

/* ==== NAME / LOCATION INPUT ==== */
.namegoi-input {
  background: transparent;
  border: 0px solid transparent;
  width: 100px;
  text-align: left;
  font-size: 13px;
  color: #858585;
  margin-top: 4px;
}

.namelocation-input {
  background: transparent;
  border: 0px solid transparent;
  width: 129px;
  padding-top: 11px;
  text-align: left;
  font-size: 12px;
  color: #858585;
}
/* ==== API KEY + TIME ==== */
.sock-container {
  display: flex;
  padding-left: 0px;
  padding-top: 10px;
}
.layipmoi-container {
  display: flex;
  padding-left: 6px;
  padding-top: 10px;
}
.api-key-container {
  display: flex;
  width: 250px;
  
}
.api-key {
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  text-align: left;
}
.time-het-container {
  display: flex;
  width: 150px;
  padding-top: 10px;
}
.time-het {
  background: transparent;
  color: #00bfff;
  border: 0px solid transparent;
  outline: none;
  text-align: left;
  font-size: 12px;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}
/* ==== BUTTONS ==== */
.layipmoi-button-hover-effect,
.layipxoay-button-hover-effect,
.doiipxoay-button-hover-effect,
.giahan-button-hover-effect,
.username-button-hover-effect,
.xacnhan-button-hover-effect,
.xoa-button-hover-effect,
.nhaptimeauto-button-hover-effect,
.url-button-hover-effect,
.huy-button-hover-effect {
  border: none;
  border-radius: 0px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  color: white;
}
.layipmoi-button-hover-effect {
  background-color: #39ed90;
  width: 160px;
  height: 32px;
}
.layipmoi-button-hover-effect:hover {
  background-color: #35cf80;
}
.layipmoi-button-hover-effect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.layipxoay-button-hover-effect {
  background-color: orange;
  width: 130px;
  height: 32px;
  color: white;
}
.layipxoay-button-hover-effect:hover {
  background-color: #ff7f00;
}
.layipxoay-button-hover-effect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.doiipxoay-button-hover-effect {
  background-color: #39ed90;
  width: 50px;
  height: 32px;
  color: white;
}
.doiipxoay-button-hover-effect:hover {
  background-color: #35cf80;
}
.doiipxoay-button-hover-effect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.giahan-container {
  display: flex;
  justify-content: flex-end;
  padding-top: 11px;
}
.giahan-button-hover-effect {
  background-color: #87c940;
  width: 90px;
  height: 32px;
  color: white;
}
.giahan-button-hover-effect:hover {
  background-color: #a2c744;
  color: white;
}
.username-button-hover-effect {
  background-color: white;
  width: auto;
  height: 32px;
  color: #858585;
  padding-left: 15px;
  padding-right: 15px;
  border: 1px solid #f1f1f1;
}
.username-button-hover-effect:hover {
  background-color: #a2c744;
}
.nhaptimeauto-button-hover-effect {
  background-color: transparent;
  width: 50px;
  height: 32px;
  border: 1px solid #ccc;
  color: #858585;
}
.nhaptimeauto-button-hover-effect:hover {
  background-color: #a2c744;
  color: white;
}
.url-button-hover-effect {
  background-color: #00bfff;
  width: 130px;
  height: 32px;
  border: 1px solid #eaedf1;
  color: #fff;
}
.url-button-hover-effect:hover {
  background-color: #a2c744;
  color: white;
}
.xacnhan-button-hover-effect {
  background-color: #20A53A;
  width: 85px;
  height: 30px;
  border-radius: 3px
}
.xacnhan-button-hover-effect:hover {
  background-color: #0c7a43;
}
.xoa-container {
  display: flex;
  justify-content: flex-end;
}
.xoa-button-hover-effect {
  background-color: #fb4747;
  width: 90px;
  height: 32px;
  color: white;
}
.xoa-button-hover-effect:hover {
  background-color: #f70000;
  color: white;
}
.huy-button-hover-effect {
  background-color: #cbcbcb;
  width: 80px;
  height: 30px;
  border-radius: 3px
}
.huy-button-hover-effect:hover {
  background-color: #c9302c;
}
.product img {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.product img.loaded {
  opacity: 1;
}

/* ==== HEADER ==== */
.header {
  position: fixed;
  top: 0;
  left: 0px;
  right: 0;
  height: 65px;
  background-color: white;
  color: #858585;
  padding: 15px 10px;
  z-index: 100;
  border-bottom: 1px solid #e2e8f0;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
select option[disabled][selected] {
  display: none;
}
.user-menu {
  position: relative;
  display: inline-block;
  cursor: pointer;
  padding-top: 5px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.avatar:hover {
  box-shadow: 0 0 5px #888;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 60px;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 1000;
  padding: 8px 0;
}
.dropdown-menu a {
  display: block;
  width: 100%;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}
.dropdown-menu a:hover {
  background: #f2f2f2;
}
.pagination {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .page-item {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
  }
  .page-item:hover {
    background-color: #695CFE;
    color: white;
    border-color: #007bff;
  }
  .page-item.active {
    background-color: #695CFE;
    color: white;
    border-color: #007bff;
    pointer-events: none;
  }
  .ip-wrapper {
  position: relative;
  display: inline-block;
  
}

.ip-label {
  position: absolute;
  top: -10px;
  left: 5px;
  font-size: 12px;
  color: #858585;
  z-index: 1;
}
/* .ip-label trong hàng tr lẻ */
tr:nth-child(odd) .ip-label {
  background-color: #fafdff;
}

/* .ip-label trong hàng tr chẵn */
tr:nth-child(even) .ip-label {
  background-color: white;
}

.proxy_new-input {
  background-color: white;
  border: none;
  padding: 6px 10px;
  color: #858585;
  width: 130px;
  height: 30px;
  text-align: left;
  cursor: text
}

.tooltip-result {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 7px 5px;
  border-radius: 0px;
  font-size: 13px;
  z-index: 1000;
  white-space: nowrap;
  transform: translateY(-78%);
  opacity: 0;
  transition: opacity 0.3s;
  width: 130px;   
  height: 30px;
}
.tooltip-result.show { opacity: 1; }
.tooltip-result.live { background: #28a745; }
.tooltip-result.die  { background: #dc3545; }


/* ==== SIDEBAR ==== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  /* Light theme colors */
  --color-text-primary: #1F2936;
  --color-text-placeholder: #798EAE;
  --color-bg-primary: #f9fafb;
  --color-bg-secondary: #fafafa;
  --color-bg-sidebar: #FFFFFF;
  --color-border-hr: #E2E8F0;
  --color-hover-primary: #695CFE;
  --color-hover-secondary: #e2e2fb;
  --color-shadow: rgba(0, 0, 0, 0.05);
}

body.dark-theme {
  /* Dark theme colors */
  --color-text-primary: #F1F5F9;
  --color-text-placeholder: #A6B7D2;
  --color-bg-primary: #111827;
  --color-bg-secondary: #3D4859;
  --color-bg-sidebar: #1f2937;
  --color-border-hr: #3B475C;
  --color-hover-secondary: #48566a;
  --color-shadow: rgba(0, 0, 0, 0.3);
}


.sidebar {
  position: sticky;
  top: 0;
  width: 270px;
  height: 100vh;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border-hr);
  box-shadow: 0 3px 9px var(--color-shadow);
  transition: width 0.4s ease;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 90px;
}

.sidebar .sidebar-header {
  padding: 20px 18px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-hr);
}

.sidebar-header .header-logo {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}
.header-sodu {
  width: 100px;
  color: red;
  font-size: 16px;
  min-width: 170px;
}
.header-sodu a {
  text-decoration: none;
  color: inherit; 
  cursor: pointer;
}

.header-left {
  display: flex;
  align-items: center; 
  gap: 6px;
  justify-content: flex-start; 
}

.sidebar.collapsed .header-sodu {
  opacity: 0;
  min-width: 200px;
  pointer-events: none;
}

.site-nav .sidebar-toggle,
.sidebar-header .sidebar-toggle {
  height: 40px;
  width: 40px;
  border: none;
  cursor: pointer;
  display: flex;
  position: absolute;
  right: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--color-text-primary);
  background: #d3e3fd;
  transition: 0.4s ease;
}

.site-nav .sidebar-toggle:hover,
.sidebar-header .sidebar-toggle:hover {
  background: var(--color-hover-secondary);
  
}

.sidebar.collapsed .sidebar-header .sidebar-toggle {
  transform: translateX(-2px);
  height: 48px;
  width: 50px;
}

.sidebar-header .sidebar-toggle span {
  font-size: 1.75rem;
  transition: transform 0.4s ease;
}

.sidebar.collapsed .sidebar-toggle span {
  transform: rotate(180deg);
}

.sidebar .sidebar-content {
  flex: 1;
  padding: 20px 18px;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-text-placeholder) transparent;
}

.sidebar.collapsed .sidebar-content {
  scrollbar-width: none;
}

.sidebar-content .search-form {
  border-radius: 8px;
  min-height: 48px;
  margin: 5px 0 20px;
  align-items: center;
  display: flex;
  padding: 0 15px;
  white-space: nowrap;
  background: var(--color-bg-secondary);
  transition: 0.4s ease;
}

.sidebar.collapsed .search-form:hover {
  cursor: pointer;
}

.sidebar-content .search-form:focus-within,
.sidebar.collapsed .search-form:hover {
  background: var(--color-hover-secondary);
}

.sidebar-content .search-form span {
  color: var(--color-text-placeholder);
}

.search-form input {
  background: none;
  outline: none;
  border: none;
  width: 100%;
  margin-left: 15px;
  font-size: 1rem;
  color: var(--color-text-primary);
}

.search-form input::placeholder {
  color: var(--color-text-placeholder);
}

.sidebar-content .menu-list {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-direction: column;
}

.menu-list .menu-link {
  display: flex;
  gap: 12px;
  white-space: nowrap;
  border-radius: 8px;
  padding: 12px 15px;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: 0.3s ease;
}

.menu-link .menu-label {
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .menu-link .menu-label {
  opacity: 0;
  pointer-events: none;
}

.menu-list .menu-link:is(:hover, .active) {
  color: #fff;
  background: var(--color-hover-primary);
}

.sidebar .sidebar-footer {
  padding: 20px 18px;
  white-space: nowrap;
  border-top: 1px solid var(--color-border-hr);
}

.sidebar-footer .theme-toggle {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border: none;
  padding: 0 15px;
  white-space: nowrap;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  transition: 0.3s ease;
}

.sidebar-footer .theme-toggle:hover {
  background: var(--color-hover-secondary);
}

.theme-toggle .theme-label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle .theme-label .theme-text {
  font-size: 1rem;
  transition: opacity 0.4s 0.2s ease;
}

.sidebar.collapsed .theme-toggle :where(.theme-text, .theme-toggle-track) {
  opacity: 0;
  width: 0;
  transition: all 0.2s ease;
}

.theme-toggle .theme-toggle-track {
  height: 24px;
  width: 48px;
  border-radius: 999px;
  margin-left: auto;
  background: #c3d1ec;
  position: relative;
  transition: opacity 0.4s 0.2s ease, background-color 0.3s ease;
}

body.dark-theme .theme-toggle-track {
  background: #695CFE;
}

.theme-toggle-track .theme-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

body.dark-theme .theme-toggle-indicator {
  transform: translateX(24px);
}

.site-nav {
  top: 0px;
  padding: 0px 20px;
  position: sticky;
  display: block;
  z-index: 1000;
  width: 50px;
  background: white;
}
.container {
  display: flex;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    transition: 0.4s ease;
  }
 .container .main-content {
    margin-top: 76px;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
  }

/* Responsive media query code for small screens */
@media (max-width: 768px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    transition: 0.4s ease;
  }

  body:has(.sidebar:not(.collapsed))::before {
    opacity: 1;
    pointer-events: auto;
  }

  body:has(.sidebar:not(.collapsed)) {
    overflow: hidden;
  }
.site-nav {
  top: 0px;
  padding: 15px 30px;
  position: sticky;
  display: block;
  z-index: 1000;
  width: 50px;
  background: transparent;
}
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 2000;
    width: 270px;
    transition: left 0.4s ease;
  }
  .header-left {
   display: flex;
   align-items: center; 
   gap: 6px;
   justify-content: flex-start; 
   width: 100px;
  }

  .sidebar.collapsed {
    left: -270px;
    width: 270px;
  }

  .container .main-content {
    margin-top: 45px;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
  }

  .username-button-hover-effect {
  display: none !important;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .select2-isp + .select2-container {
  width: 126px !important;
  margin-top: 11px;
}


