/* ============================================================
   style.css — visual styles
   Colors, sizes and effects are controlled via config.js
   ============================================================ */


/* ============================================================
   CUSTOM FONT
   Place your font file at assets/fonts/fuente.otf
   If the file doesn't exist, the page falls back to sans-serif.
   See assets/fonts/README.md for .ttf / .woff2 instructions.
   ============================================================ */
@font-face {
  font-family: "CustomFont";
  src: url("../assets/fonts/fuente.otf") format("opentype");
  font-display: swap;
}


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

body {
  font-family: "CustomFont", sans-serif;
  background-color: #080808;
  overflow: hidden;
  height: 100vh;
}


/* ============================================================
   ENTRY SCREEN
   Blurred overlay shown before the user clicks to enter.
   JS adds the .hidden class on click to fade it out.
   ============================================================ */
#entry-screen {
  position: fixed;
  inset: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(8, 8, 8, 0.55);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#entry-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#entry-symbol {
  font-size: 50px;
  color: #ffffff;
  text-shadow: 0 0 15px #acc8ff, 0 0 30px #0011ff;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1);    }
  50%       { opacity: 1;   transform: scale(1.15); }
}


/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */
#main-content {
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Full-screen video behind everything */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* Particle canvas — sits above the video, behind the card */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Cursor trail canvas — sits above everything, never blocks clicks */
#cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}


/* ============================================================
   VOLUME BUTTON
   ============================================================ */
#volume-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 5;

  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(172, 200, 255, 0.15);
  background: rgba(172, 200, 255, 0.08);

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #acc8ff;
  transition: background 0.2s ease;
}

#volume-btn:hover {
  background: rgba(172, 200, 255, 0.18);
}


/* ============================================================
   PROFILE CARD
   The card shape (background, corners) is always visible.
   Only its children animate in after the entry click.
   ============================================================ */
#profile-card {
  position: absolute;
  top: 50%;
  left: 50%;

  display: flex;
  flex-direction: column;
  gap: 30px;
  letter-spacing: 1.5px;

  width: min(92%, var(--card-max-width, 380px));
  padding: 26px;

  background: var(--card-background, rgba(200, 27, 27, 0.03));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);

  border: var(--card-border, none);
  border-radius: var(--card-border-radius, 85px);

  transform: translate(-50%, -50%) perspective(var(--card-tilt-perspective, 1000px)) rotateX(0deg) rotateY(0deg);
  transition: transform 700ms cubic-bezier(0.03, 0.98, 0.52, 0.99);
  will-change: transform;
}

/* Card reveal — sections animate in one by one after entry click */
@keyframes unfold {
  from { opacity: 0; transform: translateY(-26px); }
  to   { opacity: 1; transform: translateY(0);     }
}

#profile-card > * { opacity: 0; }

#profile-card.revealed > * {
  animation: unfold 0.7s cubic-bezier(0.2, 0.72, 0.12, 1) both;
}

#profile-card.revealed > *:nth-child(1) { animation-delay: 60ms;  } /* Avatar + Tên */
#profile-card.revealed > *:nth-child(2) { animation-delay: 120ms; } /* Ô Discord chính */
#profile-card.revealed > *:nth-child(3) { animation-delay: 180ms; } /* Ô Nhóm Discord */
#profile-card.revealed > *:nth-child(4) { animation-delay: 240ms; } /* Bộ đếm View */
#profile-card.revealed > *:nth-child(5) { animation-delay: 300ms; } /* Mạng xã hội */

/* ============================================================
   PROFILE MAIN — avatar + name + status
   ============================================================ */
#profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Avatar */
#avatar-wrapper {
  position: relative;
  width: var(--avatar-size, 70px);
  height: var(--avatar-size, 70px);
  flex-shrink: 0;
}

#avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(249, 184, 184, 0.3);
}

/* Discord-style animated decoration ring — larger than the avatar */
#avatar-decoration {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  object-fit: contain;
  pointer-events: none;
}

/* Name row — name span + badges side by side */
#profile-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #acc8ff;
  font-size: 22px;
  font-weight: 600;
  text-shadow: var(--username-glow, none);
  flex-wrap: wrap;
}

#name-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Name wrapper — auto-sized so it doesn't interfere with badges */
.name-wrapper {
  position: relative;
  width: auto;
  height: auto;
  display: flex;
  justify-content: flex-start;
  overflow: visible;
}

/* Name span — SVG interference filter applied directly here */
#name-text {
  display: inline-block;
  width: 86px;
  height: 32px;
  line-height: 32px;
  white-space: nowrap;
  overflow: visible;
  color: #acc8ff;
  font-size: 30px;
  font-weight: 600;
  text-shadow: var(--username-glow, none);
  filter: url(#name-filter);
}

/* Name tooltip — appears above on hover */
.name-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(172, 200, 255, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #acc8ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 99;
}

.name-wrapper:hover .name-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Badges */
#badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5.5px;
  padding: 6px 10px;
  border-radius: 25px;
  background: var(--badge-container-bg, rgba(172, 200, 255, 0.08));
  border: var(--badge-container-border, 2px solid rgba(172, 200, 255, 0.04));
}

.badge-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.badge-item img {
  width: var(--badge-size, 22px);
  height: var(--badge-size, 22px);
  object-fit: contain;
  display: block;
  transition: transform 0.15s ease;
}

.badge-item:hover img { transform: scale(1.2); }

/* Badge tooltip */
.badge-item .badge-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(172, 200, 255, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #acc8ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 99;
}

.badge-item:hover .badge-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Status text — typewriter effect (cursor "|" added via ::after) */
#profile-status {
  margin-top: 4px;
  min-height: 18px;
  color: rgba(172, 200, 255, 0.7);
  font-weight: 570;
  font-size: 17px;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

#profile-status::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  color: rgba(172, 200, 255, 0.8);
  animation: blink-cursor 0.8s infinite;
}


/* ============================================================
   DISCORD PRESENCE BOX
   ============================================================ */
#discord-presence {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--discord-box-background, rgba(255, 255, 255, 0.05));
  border: var(--discord-box-border, none);
  border-radius: var(--discord-box-radius, 30px);
  min-width: 0; /* Cho phép co giãn linh hoạt theo card */
}

/* Avatar with status icon overlay */
#discord-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

#discord-avatar {
  width: var(--discord-avatar-size, 36px);
  height: var(--discord-avatar-size, 36px);
  border-radius: 50%;
  object-fit: cover;
  border: var(--discord-avatar-border, 2px solid rgba(249, 184, 184, 0.2));
  display: block;
}

/* Status icon (online / idle / dnd / offline) — bottom-right corner */
#discord-status-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 17px;
  height: 17px;
  object-fit: cover;
}

#discord-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;          /* Chiếm hết khoảng trống còn lại bên phải avatar */
  min-width: 0;      /* BẮT BUỘC: Cho phép phần tử con kích hoạt text-overflow */
  overflow: visible;
}

#discord-username {
  color: #acc8ff;
  font-weight: 550;
  font-size: 18.5px;
}

#discord-activity {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Tự động cắt và thay bằng dấu ... */
  max-width: 100%;
}


/* ============================================================
   SOCIAL LINKS
   ============================================================ */
#social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  min-height: 28px;
}

#social-links a {
  display: flex;
  color: inherit;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#social-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* drop-shadow follows the icon's real silhouette (transparent background) */
.social-icon {
  display: block;
  width: var(--icon-size, 32px);
  height: var(--icon-size, 32px);
  object-fit: contain;
  border-radius: var(--icon-border-radius, 0);
  filter: drop-shadow(var(--icon-glow-color) 1px 0 7px);
  transition: transform 0.2s ease;
}

.social-icon:hover { transform: scale(1.15); }

/* ============================================================
   DISCORD CUSTOM (GIỐNG ẢNH MẪU)
   ============================================================ */
#discord-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible !important;
}

/* Chữ DISCORD mờ ở trên cùng */
#discord-label {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

#discord-username {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

#discord-activity {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* Tắt khung nền của Badges và căn lề trái */
#discord-info #badges {
  background: transparent !important;
  border: none !important;
  padding: 6px 0 0 0 !important; /* Cách dòng trạng thái một chút */
  justify-content: flex-start;
  gap: 6px;
}

/* Kích thước huy hiệu */
#discord-info .badge-item img {
  width: 18px; 
  height: 18px;
  object-fit: contain;
}

/* Định vị khung ảnh Avatar Decoration */
#discord-avatar-wrapper {
  position: relative;
}

#discord-decoration {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

#discord-status-icon {
  z-index: 2;
}

/* ============================================================
   DISCORD SERVERS
   ============================================================ */
#discord-servers-container {
  width: 100%;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--discord-box-background, rgba(255, 255, 255, 0.05));
  border: var(--discord-box-border, 1px solid rgba(255, 255, 255, 0.05));
  border-radius: 14px;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.server-icon-wrapper {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.server-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.server-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.server-role {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-stats {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.server-join-btn {
  flex-shrink: 0;
  background: #23a559;
  color: white;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  transition: background 0.2s;
}

.server-join-btn:hover {
  background: #1d8b4b;
}

/* ============================================================
   VISITOR VIEWS COUNTER (Ở GIỮA)
   ============================================================ */
#profile-views {
  display: flex;
  align-self: center; /* Tự động căn giữa theo chiều ngang */
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  margin-top: -8px; /* Kéo gần lại với ô nhóm GTA */
  margin-bottom: -10px; /* Kéo gần lại với icon mạng xã hội */
}

#profile-views svg {
  width: 15px;
  height: 15px;
  stroke: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   ĐỒNG BỘ HIỆU ỨNG VÀ HIỂN THỊ CÁC KHỐI
   ============================================================ */

/* Đồng bộ thời gian chuyển động cho các khối */
#profile-card.revealed > * {
  animation: unfold 0.4s cubic-bezier(0.2, 0.72, 0.12, 1) both !important;
}

/* Thứ tự rơi liên tiếp, nhanh và không trễ */
#profile-card.revealed > *:nth-child(1) { animation-delay: 60ms !important;  } /* Avatar + Tên */
#profile-card.revealed > *:nth-child(2) { animation-delay: 120ms !important; } /* Discord Presence */
#profile-card.revealed > *:nth-child(3) { animation-delay: 180ms !important; } /* Khung Server GTA */
#profile-card.revealed > *:nth-child(4) { animation-delay: 240ms !important; } /* Bộ đếm view */
#profile-card.revealed > *:nth-child(5) { animation-delay: 300ms !important; } /* Social Icons */

/* Định dạng con mắt nằm giữa GTA Star và Social Links */
#profile-views {
  display: flex !important;
  align-self: center !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 5px 14px !important;
  border-radius: 20px !important;
  pointer-events: none !important;
  position: static !important;
  margin: -10px auto -12px auto !important;
}

#profile-views svg {
  width: 15px !important;
  height: 15px !important;
  stroke: rgba(255, 255, 255, 0.8) !important;
}