/* =========================================================
   UCP Responsive Menu + Layout
   - Replace classic tabs with a dropdown menu
   - Use desktop-friendly two-column layout
   - Improve navigation list hit targets
   ========================================================= */

.ucp-mdx {
  display: block;
  margin: 10px 0 12px;
  position: relative;
}

html.ucp-mdx-lock,
html.ucp-mdx-lock body { overflow: hidden !important; }

html.ucp-mdx-ready #tabs,
html.ucp-mdx-ready #navigation {
  display: none !important;
}

.ucp-mdx__overlay[hidden] { display: none !important; }

.ucp-mdx__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(248,195,1,.35);
  background: linear-gradient(180deg, #403403, #000000 30px, #000000);
  color: inherit;
  cursor: pointer;
  text-transform: uppercase;
  outline: none;
  justify-content: space-between;
}
.ucp-mdx__trigger:hover {
  outline: none;
}
.ucp-mdx__trigger:focus,
.ucp-mdx__trigger:active {
  outline: none;
}

.ucp-mdx__burger {
  width: 18px; height: 2px; background: currentColor; position: relative; border-radius: 2px;
}
.ucp-mdx__burger::before,
.ucp-mdx__burger::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
}
.ucp-mdx__burger::before { top: -6px; }
.ucp-mdx__burger::after  { top:  6px; }

.ucp-mdx__triggerText { font-size: 12px; font-weight: 800; }
.ucp-mdx__triggerDrop {
  font-size: 16px;
  font-weight: 800;
}

.ucp-mdx__overlay {
  position: absolute;
  background: transparent;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 10px;
  min-width: 220px;
  left: 0;
}

.ucp-mdx__sheet {
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  border: 1px solid rgba(248,195,1,.35);
  background: rgba(15, 15, 15, .94);
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.65), 0 0 10px rgba(248,195,1,.15);
  transform-origin: top center;
  animation: rollDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ucp-mdx__sheet::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: #cca000;
  border-radius: 10px;
  box-shadow:
    0 0 5px #cca000,
    0 0 15px #cca000,
    0 0 30px #cca000,
    0 0 50px #cca000;
  filter: brightness(1.5) blur(0.5px);
  pointer-events: none;
}
@keyframes rollDown {
  from { opacity: 0; filter: blur(5px); transform: translateY(-10px) scaleY(0); }
  to   { opacity: 1; filter: blur(0);  transform: translateY(0) scaleY(1); }
}
@keyframes rollSide {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translateX(-20px) scaleX(0);
    transform-origin: left;
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scaleX(1);
    transform-origin: left;
  }
}

.ucp-mdx-layout {
  display: flex;
  gap: 1%;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.ucp-mdx-layout .cp-mini {
  flex: 0 0 29%;
  max-width: 29%;
  box-sizing: border-box;
}

.ucp-mdx-layout #cp-main {
  flex: 0 0 70%;
  max-width: 70%;
  min-width: 0;
  box-sizing: border-box;
}

.ucp-mdx__item--sub {
  margin-left: 18px;
  width: calc(100% - 18px);
  background: rgba(255,255,255,.03);
  border-color: rgba(248,195,1,.14);
}

.ucp-mdx__item--sub i {
  opacity: .9;
}

.ucp-mdx__header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(248,195,1,.20);
}

.ucp-mdx__title {
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ucp-mdx__back {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}
.ucp-mdx__back:focus,
.ucp-mdx__back:active {
  outline: none;
}

.ucp-mdx__back {
  margin-left: auto;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(135deg);
  opacity: .7;
}

.ucp-mdx__close {
  justify-self: end;
  width: 40px; height: 40px;
  font-size: 22px; line-height: 1;
  display: none !important;
}

.ucp-mdx__body {
  padding: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(86vh - 60px);
}

.ucp-mdx__screen {
  display: none;
  animation: rollSide 0.2s ease-out forwards;
}
.ucp-mdx__screen.is-active { display: block; }

.ucp-mdx__hr {
  height: 1px;
  background: rgba(248,195,1,.18);
  margin: 10px 2px;
}

.ucp-mdx__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(248,195,1,.22);
  background: rgba(248,195,1,.06);
  color: inherit;
  text-decoration: none;
}

.ucp-mdx__profileName {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ucp-mdx__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(248,195,1,.18);
  background: rgba(255,255,255,.04);
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
  min-height: 44px;
  cursor: pointer;
  margin-bottom: 2px;
}

.ucp-mdx__item:hover,
.ucp-mdx__item:focus {
  border-color: rgba(248,195,1,.35);
  background: rgba(248,195,1,.08);
  text-decoration: none;
}

.ucp-mdx__item span { font-weight: 800; }

.ucp-mdx__chev {
  margin-left: auto;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .7;
}
.triangle-down {
  display: inline-block;
  width: 0;
  height: 0;
  /* Độ rộng của đáy tam giác */
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  /* Độ cao của tam giác - chỉnh số này nhỏ lại nếu muốn tam giác bẹt hơn */
  border-top: 4px solid currentColor;
  vertical-align: middle;
  margin-left: 5px;
}

/* Thêm viền và bo góc cho cp-main */
#cp-main.cp-main.ucp-main.panel-container {
  border: 1px solid rgba(243, 187, 20, 0.5);
  border-radius: 5px;
  padding: 10px;
  background-color: #000;
  background: linear-gradient(180deg, #403403, #000000 50px, #000000);
}

[data-ucp-mdx-user] {
  display: none;
}

@media only screen and (max-width: 768px), only screen and (max-device-width: 768px) {
  .ucp-mdx__overlay {
    justify-content: center;
  }

  .ucp-mdx__sheet {
    max-width: 560px;
    max-height: 86vh;
  }

  .ucp-mdx__body {
    max-height: calc(86vh - 60px);
  }

  .ucp-mdx-layout {
    flex-direction: column;
  }

  .ucp-mdx-layout #cp-main {
    order: 1;
    max-width: 100%;
    width: 100%;
    flex: 0 0 100%;
  }

  .ucp-mdx-layout .cp-mini {
    order: 2;
    max-width: 100%;
    flex: 1 1 auto;
    width: 100%;
  }
  .cp-mini {
    margin: 10px 0;  
  }
}

@media only screen and (min-width: 769px) {
  .ucp-mdx-layout .cp-mini {
    order: 2;
  }

  .ucp-mdx-layout #cp-main {
    order: 1;
  }
  .cp-mini {
    margin: 0 0 10px 0;  
  }
#cp-main.cp-main {
  width: calc(100% - 20px) !important;
}
}

/* Destop and Mobile */

    /* Căn chữ đều (justify) cho thẻ p */
    #cp-main .panel .inner p {
        text-align: justify;
        line-height: 1.5; 
    }
    
	/* mỗi friend nằm 1 hàng: avatar - tên - dot */
	.cp-mini dl.mini dd.friend-online,
	.cp-mini dl.mini dd.friend-offline {
		position: relative;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 34px 10px 0; /* chừa chỗ cho dot bên phải */
	}

	/* bỏ hr ngăn cách */
	.cp-mini dl.mini dd hr { display: none; }

	/* avatar */
	.cp-mini .ucp-friend-avatar {
		flex: 0 0 32px;
		line-height: 0;
		border: 1px solid rgba(243, 187, 20, 0.3);
	}
	.cp-mini .ucp-friend-avatar img {
		width: 20px;
		height: 20px;
		max-height: 20px;
		object-fit: cover;
		object-position: center;
		border-radius: 50%;
		display: block;
	}

	/* tên to hơn */
	.cp-mini dl.mini dd.friend-online a.username,
	.cp-mini dl.mini dd.friend-offline a.username,
	.cp-mini dl.mini dd.friend-online a.username-coloured,
	.cp-mini dl.mini dd.friend-offline a.username-coloured {
		font-weight: 600;
	}
	.cp-mini dl.mini .vp-verified-badge {
		display: none;
	}

	/* dot trạng thái */
	.cp-mini .ucp-friend-dot {
		position: absolute;
		right: 1px;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		border: 2px solid #fff;
	}
	.cp-mini .ucp-friend-dot.is-online {
		background: #40c200;
		animation: flashonoff 5s ease infinite;
		-webkit-animation: flashonoff 5s ease infinite;
	}
	.cp-mini .ucp-friend-dot.is-offline {
		background: #bbb;
	}
    .cp-mini .ucp-friend-avatar {
		flex: 0 0 20px;
		width: 20px;
		height: 20px;
		max-height: 20px;
		border-radius: 50%;
		overflow: hidden;
		line-height: 0;
		border: 1px solid rgba(243, 187, 20, 0.3);

	/* Placeholder avatar */
		background: url("./images/no_avatar.jpg") center / cover no-repeat;
	}

	.cp-mini .ucp-friend-avatar img {
		width: 20px;
		height: 20px;
		max-height: 20px;
		object-fit: cover;
		object-position: center;
		border-radius: 50%;
		display: block;
	}
	
	@keyframes flashonoff {
		0%, 50%, 100% { opacity: 1; }
		25%, 75% { opacity: 0; }
	}
	@-webkit-keyframes flashonoff {
		0%, 50%, 100% { opacity: 1; }
		25%, 75% { opacity: 0; }
	}
	
/* Friend list */
    .cp-mini {
        padding: 0 !important; 
        max-height: none;     
        overflow: visible;
        background: #000;
    }

    .cp-mini .inner {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid rgba(243, 187, 20, 0.5);
        border-radius: 7px;
        padding: 10px; 
    }

    dl.mini {
        max-height: 200px;         
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch;
        padding-right: 6px; 
    }

    dl.mini dt {
        font-weight: bold;
        text-transform: uppercase; 
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px dashed rgba(243, 187, 20, 0.25); 
        display: block; 
        position: sticky; 
        top: 0; 
        background: #000; 
        z-index: 1;
    }

    dl.mini dd {
        padding: 8px 0;
        margin: 0;
        display: flex;
        align-items: center;
        position: relative;
    }
    
/* Scrollbar Color */

  /* Chrome / Edge / Safari / Android WebView */
    dl.mini {
        scrollbar-width: thin;
        scrollbar-color: rgba(243, 187, 20, 0.25) transparent;
    }
    dl.mini::-webkit-scrollbar {
        width: 6px;
    }

    dl.mini::-webkit-scrollbar-track {
        background: transparent;
    }

    dl.mini::-webkit-scrollbar-thumb {
        background: rgba(243, 187, 20, 0.25);
        border-radius: 8px;
        border: 2px solid transparent; /* tạo cảm giác thumb gọn */
        background-clip: content-box;
    }

    dl.mini::-webkit-scrollbar-thumb:hover {
        background: rgba(243, 187, 20, 0.25);
    }