/* ==========================================================================
   SECTION: THÔNG TIN MÁY CHỦ (SERVER INFORMATION) - BĂNG HỎA SONG HÀNH
   ========================================================================== */

/* Google Fonts imported for Serif Fantasy Title and Condensed Table Typography */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Cinzel:wght@700;800;900&display=swap');

:root {
  --si-bg-main: #060b17;
  --si-bg-table: rgba(10, 18, 32, 0.94);
  --si-row-dark: rgba(13, 24, 42, 0.96);
  --si-row-brown: rgba(22, 38, 62, 0.96);
  --si-ice-bright: #38bdf8;
  --si-ice-pale: #7dd3fc;
  --si-fire-bright: #f97316;
  --si-fire-gold: #fbbf24;
  --si-text-main: #ffffff;
  --si-text-sub: #f1f5f9;
  --si-font-title: 'Cinzel', 'Times New Roman', serif;
  --si-font-table: 'Barlow Condensed', 'Livvic', sans-serif;
}

/* SECTION CONTAINER */
.section-server-info {
  width: 100%;
  position: relative;
  background: transparent !important;
  background-image: none !important;
  padding: 40px 0 65px 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Seamless transition at top below video */
.section-server-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: linear-gradient(to bottom, #060b17, transparent);
  pointer-events: none;
  z-index: 2;
}

.section-server-info::after {
  display: none !important;
}

/* CONTENT WRAPPER */
.server-info-inner {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  position: relative;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 3;
}

/* HEADER & TITLE */
.server-info-header {
  text-align: center;
  position: relative;
  z-index: 4;
  margin-bottom: 24px;
}

.server-info-title-text {
  font-family: var(--si-font-title);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  padding: 0;
  text-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.98),
    0 0 20px rgba(56, 189, 248, 0.5),
    0 0 38px rgba(249, 115, 22, 0.35);
}

.server-info-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  max-width: 530px;
}

.divider-img {
  width: 100%;
  max-width: 530px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45));
}

/* ==========================================================================
   BĂNG HỎA CORE METRICS BAR (DASHBOARD CHỈ SỐ MÁY CHỦ)
   ========================================================================== */
.server-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto 34px auto;
  position: relative;
  z-index: 5;
  box-sizing: border-box;
}

.metric-card {
  position: relative;
  background: linear-gradient(135deg, rgba(13, 24, 42, 0.94) 0%, rgba(20, 34, 58, 0.96) 100%);
  border-radius: 12px;
  border: 1.5px solid rgba(125, 211, 252, 0.3);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.8),
    inset 0 0 16px rgba(56, 189, 248, 0.08);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(56, 189, 248, 0.35);
  border-color: rgba(125, 211, 252, 0.7);
}

.metric-card__glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  opacity: 0.4;
}

.metric-card__icon {
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.metric-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-card__label {
  font-family: var(--si-font-table);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #94a3b8;
  text-transform: uppercase;
}

.metric-card__val {
  font-family: var(--si-font-table);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Biến thể Hỏa (Cam / Lửa Đỏ) */
.metric-card--exp,
.metric-card--limit {
  border-color: rgba(249, 115, 22, 0.38);
}
.metric-card--exp:hover,
.metric-card--limit:hover {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(249, 115, 22, 0.35);
}
.metric-card--exp .metric-card__glow,
.metric-card--limit .metric-card__glow {
  background: radial-gradient(circle, #f97316 0%, transparent 70%);
}
.metric-card--exp .metric-card__icon,
.metric-card--limit .metric-card__icon {
  border-color: rgba(249, 115, 22, 0.4);
}
.metric-card--exp .metric-card__val {
  color: #fbbf24;
}
.metric-card--limit .metric-card__val {
  color: #fca5a5;
}

/* Biến thể Băng (Lam Thiên Thanh / Tinh Thể) */
.metric-card--drop,
.metric-card--antihack {
  border-color: rgba(56, 189, 248, 0.38);
}
.metric-card--drop:hover,
.metric-card--antihack:hover {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(56, 189, 248, 0.35);
}
.metric-card--drop .metric-card__glow,
.metric-card--antihack .metric-card__glow {
  background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
}
.metric-card--drop .metric-card__icon,
.metric-card--antihack .metric-card__icon {
  border-color: rgba(56, 189, 248, 0.4);
}
.metric-card--drop .metric-card__val {
  color: #7dd3fc;
}
.metric-card--antihack .metric-card__val {
  color: #bae6fd;
}

/* ==========================================================================
   TABLES LAYOUT
   ========================================================================== */
.server-tables-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 36px;
  position: relative;
  z-index: 4;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* INDIVIDUAL TABLE */
.server-table {
  width: 520px;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* TABLE HEADER BANNER */
.table-header-banner {
  width: 390px;
  height: 50px;
  box-sizing: border-box;
  border-style: solid;
  border-width: 0 48px 0 48px;
  border-image-source: url('../images/ui_frames/frame_title_wing_02.png');
  border-image-slice: 0 48 0 48 fill;
  border-image-repeat: stretch;
  background: url('../images/table-header-bg.png') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  margin-bottom: -24px; /* Overlaps top of card */
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* Bảng thông số máy chủ & hỗ trợ: Giữ nguyên màu vàng kim cổ điển nguyên bản của khung header */
.left-table .table-header-banner,
.right-table .table-header-banner {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.85));
}
.left-table:hover .table-header-banner,
.right-table:hover .table-header-banner {
  transform: translateY(-2px);
  filter: brightness(1.1) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.95));
}

.table-header-title {
  font-family: var(--si-font-table);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.98),
    0 0 10px rgba(255, 255, 255, 0.4);
  margin-top: -2px;
  pointer-events: none;
  white-space: nowrap;
}

/* TABLE CARD CONTAINER */
.table-card {
  width: 100%;
  background: var(--si-bg-table);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.92);
  padding: 34px 0 10px 0;
  box-sizing: border-box;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.left-table .table-card {
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 
    0 14px 40px rgba(0, 0, 0, 0.92),
    inset 0 0 25px rgba(56, 189, 248, 0.1);
}

.right-table .table-card {
  border: 1.5px solid rgba(249, 115, 22, 0.35);
  box-shadow: 
    0 14px 40px rgba(0, 0, 0, 0.92),
    inset 0 0 25px rgba(249, 115, 22, 0.1);
}

.table-body {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* TABLE ROWS - HIGH CONTRAST */
.table-row {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 18px;
  font-family: var(--si-font-table);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.98);
  transition: background-color 0.2s ease, color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-row.row-dark {
  background-color: var(--si-row-dark);
}

.table-row.row-brown {
  background-color: var(--si-row-brown);
}

.left-table .table-row:hover {
  background-color: rgba(56, 189, 248, 0.28);
  color: #ffffff;
}

.right-table .table-row:hover {
  background-color: rgba(249, 115, 22, 0.28);
  color: #ffffff;
}

/* ==========================================================================
   NHÂN VẬT THÔNG TIN MÁY CHỦ (KHÓA CỨNG VỊ TRÍ & CHIỀU CAO THEO BẢNG)
   - Chiều cao ảnh khóa cứng bằng đỉnh và đáy của bảng thông tin.
   - Luôn cách bảng thông tin một khoảng nhỏ cố định 20px dù zoom to hay nhỏ.
   - Hòa trộn mượt mà với nền tối Băng Hỏa.
   ========================================================================== */
.section-server-info .bg-char-wrapper {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  will-change: transform, opacity;
  transition: opacity 0.5s ease;
}

/* Vị trí bên phải: Luôn cách mép phải bảng thông tin một khoảng 20px dù zoom bất kỳ */
.section-server-info .bg-char-wrapper.bg-char--right {
  left: calc(100% + 20px);
  right: auto;
  top: 0;
  bottom: 0;
  height: 100%;
  transform: none !important;
  filter: none;
}

/* Vị trí bên trái: Luôn cách mép trái bảng thông tin một khoảng 20px dù zoom bất kỳ */
.section-server-info .bg-char-wrapper.bg-char--left {
  right: calc(100% + 20px);
  left: auto;
  top: 0;
  bottom: 0;
  height: 100%;
  transform: none !important;
  filter: none;
}

/* Vị trí ở giữa: Nằm ngay sau lưng 2 bảng */
.section-server-info .bg-char-wrapper.bg-char--center {
  left: 50%;
  right: auto;
  top: 0;
  bottom: 0;
  height: 100%;
  transform: translateX(-50%) !important;
  filter: none;
}

/* Không đổi vị trí khi kích hoạt inview */
.section-server-info .bg-char-wrapper.is-inview.bg-char--right {
  transform: none !important;
  filter: none !important;
}
.section-server-info .bg-char-wrapper.is-inview.bg-char--left {
  transform: none !important;
  filter: none !important;
}
.section-server-info .bg-char-wrapper.is-inview.bg-char--center {
  transform: translateX(-50%) !important;
  filter: none !important;
}

/* ẢNH NHÂN VẬT: Chiều cao chuẩn bằng đỉnh và đáy của bảng thông tin (100% height của .server-tables-grid) */
.section-server-info .bg-char-img {
  height: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  max-width: none !important;
  object-fit: contain;
  display: block;
}

/* HÀO QUANG KHÔNG GIAN BẢNG MÁY CHỦ: Tỏa sáng hòa quyện với phong cách Băng Hỏa */
.section-server-info .bg-char-glow {
  position: absolute;
  inset: -12%;
  background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.4) 0%, rgba(56, 189, 248, 0.22) 45%, transparent 72%);
  filter: blur(36px);
  pointer-events: none;
  z-index: -1;
}

.character-warrior-wrapper,
.character-warrior-img,
.character-glow,
.server-info-particles {
  display: none !important;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Large Desktop (1440px+) */
@media screen and (min-width: 1441px) {
  .server-tables-grid {
    gap: 36px;
  }
}

/* Desktop (1200px - 1440px) */
@media screen and (max-width: 1440px) and (min-width: 1200px) {
  .server-tables-grid {
    gap: 24px;
  }
  .server-table {
    width: 480px;
  }
  .table-row {
    font-size: 16.5px;
    padding: 6px 14px;
  }
}

/* Khi có nhân vật hiển thị ở Desktop (>= 1200px), cân đối trục giữa hoàn hảo */
@media screen and (min-width: 1200px) {
  .section-server-info:has(.bg-char--right) .server-tables-grid,
  .section-server-info.has-char-right .server-tables-grid {
    transform: translateX(-140px);
  }

  .section-server-info:has(.bg-char--left) .server-tables-grid,
  .section-server-info.has-char-left .server-tables-grid {
    transform: translateX(140px);
  }

  .section-server-info:has(.bg-char--center) .server-tables-grid,
  .section-server-info.has-char-center .server-tables-grid {
    transform: none;
  }
}

/* Tablet (768px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 768px) {
  .section-server-info {
    padding: 35px 0 55px 0;
  }
  .server-info-title-text {
    font-size: 32px;
  }
  .server-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
    margin-bottom: 28px;
  }
  .server-info-divider {
    max-width: 440px;
  }
  .server-tables-grid {
    transform: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    gap: 20px;
    justify-content: center;
  }
  .server-table {
    width: calc(50% - 12px);
    max-width: 480px;
  }
  .table-header-banner {
    width: 340px;
    height: 46px;
    margin-bottom: -20px;
    border-width: 0 44px 0 44px;
    border-image-slice: 0 44 0 44 fill;
  }
  .table-header-title {
    font-size: 20px;
    letter-spacing: 1.2px;
  }
  .table-row {
    font-size: 15.5px;
    min-height: 38px;
    padding: 5px 10px;
  }
  .section-server-info .bg-char-wrapper {
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    height: 80% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 0.16 !important;
    z-index: 1 !important;
  }
  .section-server-info .bg-char-wrapper.is-inview.bg-char--right,
  .section-server-info .bg-char-wrapper.is-inview.bg-char--left,
  .section-server-info .bg-char-wrapper.is-inview.bg-char--center {
    transform: translate(-50%, -50%) !important;
    opacity: 0.16 !important;
  }
}

/* Mobile (< 768px) */
@media screen and (max-width: 767px) {
  .section-server-info {
    padding: 25px 10px 45px 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .server-info-inner {
    padding: 0 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .server-info-title-text {
    font-size: 22px;
    letter-spacing: 1px;
    padding: 0 4px;
    word-break: break-word;
  }
  .server-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
    width: 100%;
  }
  .metric-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .metric-card__icon {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .metric-card__label {
    font-size: 10.5px;
  }
  .metric-card__val {
    font-size: 16px;
  }
  .server-info-divider {
    max-width: 290px;
    margin-bottom: 25px;
  }
  .server-tables-grid {
    flex-direction: column;
    align-items: center;
    margin-right: 0;
    gap: 30px;
    width: 100%;
  }
  .server-table {
    width: 100%;
    max-width: 355px;
  }
  .table-header-banner {
    width: min(310px, 94%);
    height: 42px;
    margin-bottom: -19px;
    border-width: 0 38px 0 38px;
    border-image-slice: 0 38 0 38 fill;
  }
  .table-header-title {
    font-size: 16.5px;
    letter-spacing: 0.8px;
  }
  .table-card {
    padding-top: 26px;
    border-radius: 14px;
    width: 100%;
  }
  .table-row {
    font-size: 13.5px;
    min-height: 38px;
    padding: 5px 8px;
    line-height: 1.35;
    word-break: break-word;
  }
  .section-server-info .bg-char-wrapper {
    left: 50% !important;
    right: auto !important;
    top: 45% !important;
    bottom: auto !important;
    height: 70% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 0.12 !important;
    z-index: 1 !important;
  }
  .section-server-info .bg-char-wrapper.is-inview.bg-char--right,
  .section-server-info .bg-char-wrapper.is-inview.bg-char--left,
  .section-server-info .bg-char-wrapper.is-inview.bg-char--center {
    transform: translate(-50%, -50%) !important;
    opacity: 0.12 !important;
  }
  .server-info-particles {
    display: none;
  }
}

/* ACCESSIBILITY: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .server-info-header,
  .server-tables-grid,
  .character-warrior-wrapper,
  .particle,
  .table-header-banner,
  .table-row,
  .metric-card {
    animation: none !important;
    transition: none !important;
  }
}
