/* Giao diện chính */

/* Biến CSS & Màu sắc giao diện */
:root {

  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #fafafa;
  --bg-elevated: #f4f4f4;
  --bg-hover: #efefef;

  --header-bg: rgba(255, 255, 255, 0.82);

  --text-primary: #000000;
  --text-secondary: #737373;
  --text-muted: #8e8e8e;

  --border: #dbdbdb;
  --border-subtle: #efefef;

  --scrollbar-thumb: rgba(0, 0, 0, 0.22);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.38);

  --btn-primary-bg: #000000;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #efefef;
  --btn-secondary-hover: #dbdbdb;
  --btn-secondary-text: #000000;

  --accent-verified: #0095f6;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --header-height: 64px;
  --container-max: 1000px;

  --trans-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --trans-normal: 320ms cubic-bezier(0.16, 1, 0.3, 1);
  --trans-smooth: 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-page: #000000;
  --bg-surface: #000000;
  --bg-subtle: #121212;
  --bg-elevated: #1a1a1a;
  --bg-hover: #262626;

  --header-bg: rgba(0, 0, 0, 0.8);

  --text-primary: #f5f5f5;
  --text-secondary: #a8a8a8;
  --text-muted: #737373;

  --border: #262626;
  --border-subtle: #1c1c1c;

  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.38);

  --btn-primary-bg: #ffffff;
  --btn-primary-text: #000000;
  --btn-secondary-bg: #363636;
  --btn-secondary-hover: #484848;
  --btn-secondary-text: #f5f5f5;

  --accent-verified: #0095f6;
}

/* Thiết lập nền tảng & Reset CSS */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-gutter: stable;
  max-width: 100%;
}

@media (min-width: 769px) {
  html {
    zoom: 0.9;
  }
}

.tab-panel,
.panel-heading {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14.5px;
  overflow-x: clip;
  overflow-y: visible;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--trans-normal), color var(--trans-normal);
}

body.modal-open {
  overflow: hidden !important;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.lucide-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Màn hình chờ (Preloader) */
.preloader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-page);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), visibility 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preloader-monogram {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  animation: preloaderPulse 1.6s infinite ease-in-out;
}

@keyframes preloaderPulse {

  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.preloader-line {
  width: 54px;
  height: 2px;
  background-color: var(--border);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.preloader-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background-color: var(--text-primary);
  animation: preloaderSlide 1.6s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes preloaderSlide {
  0% {
    left: -50%;
  }

  100% {
    left: 100%;
  }
}

/* Thanh điều hướng đầu trang (Header) */
.app-header {
  width: 100%;
  background-color: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  transition: background-color var(--trans-normal), border-color var(--trans-normal);
}

@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .app-header {
    background-color: var(--bg-surface);
  }
}

.header-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  transition: opacity var(--trans-fast);
}

.header-brand:hover {
  opacity: 0.85;
}

.header-brand-name-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 140px;
  white-space: nowrap;
}

.header-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: pre;
}

.header-typewriter-cursor {
  font-weight: 300;
  font-size: 15px;
  margin-left: 2px;
  color: var(--text-primary);
  animation: blinkCursor 0.9s infinite step-start;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.util-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.82;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
}

.util-btn:hover {
  opacity: 1;
  background-color: var(--bg-hover);
}

.util-btn:active {
  transform: scale(0.94);
  opacity: 0.7;
}

.util-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

/* Khung nội dung chính */
.main-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  overflow-y: visible;
  display: flex;
  justify-content: center;
  background-color: transparent;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  z-index: 1;
  transition: background-color var(--trans-normal);
}

.profile-container {
  width: 100%;
  max-width: var(--container-max);
  min-width: 0;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  height: auto;
}

/* Thông tin cá nhân (Profile) */
.profile-header-area {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 34px;
}

.profile-avatar-col {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 14px;
}

.avatar-frame {
  position: relative;
  width: 216px;
  height: 216px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring-outer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.avatar-animated-border {
  width: 100%;
  height: 100%;
  transform-origin: center;
  animation: spinBorder 14s linear infinite;
}

.avatar-animated-border .border-track {
  stroke: var(--border);
  stroke-width: 1px;
  fill: none;
}

.avatar-animated-border .border-spin {
  stroke: var(--text-primary);
  stroke-width: 1.5px;
  stroke-dasharray: 85 520;
  stroke-linecap: round;
  fill: none;
}

@keyframes spinBorder {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.avatar-ring-inner {
  width: 194px;
  height: 194px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
  pointer-events: auto;
}

.avatar-frame {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.avatar-frame:hover .avatar-img {
  transform: scale(1.04);
}

.profile-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.badge-check-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 16px;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
}

.stat-number {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.profile-bio-block {
  margin-bottom: 20px;
  font-size: 14.5px;
  line-height: 1.55;
}

.typewriter-container {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  min-height: 24px;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.typewriter-text {
  white-space: pre;
}

.typewriter-cursor {
  font-weight: 300;
  margin-left: 2px;
  color: var(--text-primary);
  animation: blinkCursor 0.9s infinite step-start;
}

@keyframes blinkCursor {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.bio-text {
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 8px;
}

.bio-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.bio-location .inline-icon {
  width: 15px;
  height: 15px;
}

.profile-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  transition: background-color var(--trans-fast), color var(--trans-fast), opacity var(--trans-fast), transform var(--trans-fast);
  cursor: pointer;
  text-decoration: none;
}

.btn-action-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
}

.btn-action-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-action-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid transparent;
}

.btn-action-secondary:hover {
  background-color: var(--btn-secondary-hover);
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action-icon:hover {
  background-color: var(--btn-secondary-hover);
  color: var(--text-primary);
}

.btn-action-icon .lucide-icon {
  width: 17px;
  height: 17px;
}

/* Thanh điều hướng 6 tab */
.instagram-tab-nav {
  border-top: 1px solid var(--border);
  margin-bottom: 28px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tab-items-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

.tab-btn {
  flex: 1;
  max-width: 160px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color var(--trans-fast);
  position: relative;
}

.tab-btn .tab-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  font-weight: 700;
}

.tab-btn.active .tab-icon {
  stroke-width: 2.3px;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: -2px;
}

.active-tab-line {
  position: absolute;
  top: -1px;
  height: 2px;
  background-color: var(--text-primary);
  transition: left 580ms cubic-bezier(0.16, 1, 0.3, 1), width 580ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
  pointer-events: none;
}

/* Khung chuyển đổi tab */
.tab-content-panels {
  position: relative;
  min-height: 440px;
  overflow: visible;
  width: 100%;
}

.tab-panel {
  display: none;
  opacity: 0;
  width: 100%;
  overflow: visible;
  height: auto;
  max-height: none;
}

.tab-panel.active {
  display: block;
  opacity: 1;
}

.tab-panel.tab-exiting {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
  transition: opacity 550ms cubic-bezier(0.16, 1, 0.3, 1), transform 550ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-panel.tab-exiting.exit-left {
  opacity: 0;
  transform: translateX(-8px);
}

.tab-panel.tab-exiting.exit-right {
  opacity: 0;
  transform: translateX(8px);
}

.tab-panel.tab-entering {
  display: block !important;
  position: relative;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.tab-panel.tab-entering.enter-from-right {
  transform: translateX(8px);
}

.tab-panel.tab-entering.enter-from-left {
  transform: translateX(-8px);
}

.tab-panel.tab-entering.enter-active {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-heading {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.panel-subheading {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 680ms cubic-bezier(0.16, 1, 0.3, 1), transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Tab 01: Giới thiệu */
.about-panel-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
  overflow: visible;
  height: auto;
  max-height: none;
}

.about-story-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  height: auto;
  max-height: none;
}

.story-paragraph {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.story-paragraph strong {
  color: var(--text-primary);
}

.about-details-col {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
  height: auto;
  max-height: none;
}

.details-heading {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-rows-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
  height: auto;
  max-height: none;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  border-bottom: none;
  font-size: 13.5px;
  transition: background-color var(--trans-fast);
}

.detail-row:hover {
  background-color: var(--bg-hover);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.detail-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--trans-fast), color var(--trans-fast);
}

.detail-link:hover,
.detail-link:focus-visible {
  opacity: 0.75;
  text-decoration: none;
}

.details-cta-wrap {
  margin-top: 6px;
}

.btn-outline-full {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.btn-outline-full:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.btn-cv-highlight {
  border-radius: 8px !important;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

:root:not([data-theme="dark"]) .btn-cv-highlight,
[data-theme="light"] .btn-cv-highlight,
body:not(.dark-theme) .btn-cv-highlight {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #000000 !important;
}

:root:not([data-theme="dark"]) .btn-cv-highlight svg,
[data-theme="light"] .btn-cv-highlight svg,
body:not(.dark-theme) .btn-cv-highlight svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

:root:not([data-theme="dark"]) .btn-cv-highlight:hover,
:root:not([data-theme="dark"]) .btn-cv-highlight:focus-visible,
[data-theme="light"] .btn-cv-highlight:hover,
[data-theme="light"] .btn-cv-highlight:focus-visible {
  background-color: #262626 !important;
  border-color: #262626 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .btn-cv-highlight,
.dark-theme .btn-cv-highlight,
body.dark-theme .btn-cv-highlight {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
}

[data-theme="dark"] .btn-cv-highlight svg,
.dark-theme .btn-cv-highlight svg,
body.dark-theme .btn-cv-highlight svg {
  color: #000000 !important;
  stroke: #000000 !important;
}

[data-theme="dark"] .btn-cv-highlight:hover,
[data-theme="dark"] .btn-cv-highlight:focus-visible,
.dark-theme .btn-cv-highlight:hover,
.dark-theme .btn-cv-highlight:focus-visible {
  background-color: #e5e5e5 !important;
  border-color: #e5e5e5 !important;
  color: #000000 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
}

/* Tab 02: Kỹ năng */
.skills-editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.skill-category-block {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.category-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.clean-skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.clean-skill-row {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 2px;
}

.clean-skill-row:last-child {
  border-bottom: none;
}

.clean-skill-row .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.clean-skill-row .scope {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Tab 03: Dự án */
.projects-panel-layout {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.projects-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
}

.filter-pill {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.filter-pill.active {
  background-color: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
  font-weight: 600;
}

.instagram-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.ig-project-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  transition: border-color var(--trans-fast), transform var(--trans-fast), box-shadow var(--trans-fast);
}

.ig-project-card:hover {
  border-color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.ig-project-card.hidden {
  display: none !important;
}

.ig-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-subtle);
  cursor: pointer;
}

.ig-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ig-project-card:hover .ig-card-media img {
  transform: scale(1.04);
}

.ig-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  box-sizing: border-box;
  z-index: 2;
  border-radius: 0 0 12px 12px;
}

@media (hover: hover) and (pointer: fine) {
  .ig-card-overlay {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 450ms cubic-bezier(0.16, 1, 0.3, 1), transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .ig-project-card:hover .ig-card-overlay,
  .ig-project-card:focus-within .ig-card-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.overlay-text {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
}

.overlay-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
  max-width: 100%;
  margin: 0;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
  white-space: normal;
  word-break: break-word;
  text-align: left;
}

.overlay-bottom-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin-top: 2px;
}

.overlay-tags {
  order: 1;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1.5px 5.5px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap !important;
  text-transform: none;
}

.overlay-actions {
  order: 2;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.overlay-btn {
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  text-decoration: none;
  transition: opacity var(--trans-fast), transform var(--trans-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.overlay-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.ig-card-mobile-info {
  display: none;
}

/* Tab 04: Học vấn & Chứng chỉ */
.education-timeline-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.edu-row {
  display: flex;
  gap: 24px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-primary);
  border-radius: 0 10px 10px 0;
  padding: 22px 24px;
  transition: background-color var(--trans-fast);
}

.edu-time {
  flex-shrink: 0;
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-range {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  width: fit-content;
}

[data-theme="dark"] .status-badge {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.status-badge.graduated {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

.edu-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.institution-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.degree-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.edu-detail-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.certificates-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
}

.cert-section-header {
  margin-bottom: 22px;
}

.cert-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cert-subheading {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.cert-carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  padding: 8px 14px;
  overflow: visible;
}

.cert-carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow: visible;
  position: relative;
  padding: 0;
}

.certificates-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px 4px 24px 4px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.certificates-grid::-webkit-scrollbar {
  display: none;
}

.cert-card {
  flex: 0 0 calc((100% - 40px) / 3) !important;
  max-width: calc((100% - 40px) / 3) !important;
  min-width: 0;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
}

.cert-card:hover,
.cert-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--text-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  outline: none;
}

[data-theme="dark"] .cert-card:hover,
[data-theme="dark"] .cert-card:focus-visible,
body.dark-theme .cert-card:hover,
body.dark-theme .cert-card:focus-visible {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.cert-nav-btn {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transform-origin: center center;
  overflow: visible;
  will-change: transform, box-shadow;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease,
    background-color 0.2s ease,
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  outline: none;
}

[data-theme="dark"] .cert-nav-btn,
body.dark-theme .cert-nav-btn {
  background: rgba(30, 30, 32, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.cert-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
  transition: transform 0.2s ease;
}

.cert-nav-prev:hover:not(:disabled) svg {
  transform: translateX(-2px);
}

.cert-nav-next:hover:not(:disabled) svg {
  transform: translateX(2px);
}

.cert-nav-btn:hover:not(:disabled) {
  transform: scale(1.08);
  z-index: 20;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  border-color: var(--text-primary);
}

[data-theme="dark"] .cert-nav-btn:hover:not(:disabled),
body.dark-theme .cert-nav-btn:hover:not(:disabled) {
  background: rgba(45, 45, 50, 0.98);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.75);
}

.cert-nav-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.cert-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.cert-nav-btn:disabled,
.cert-nav-btn.disabled {
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  color: #111111 !important;
}

.cert-nav-btn:disabled svg,
.cert-nav-btn.disabled svg {
  opacity: 1 !important;
  stroke: currentColor !important;
}

[data-theme="dark"] .cert-nav-btn:disabled,
[data-theme="dark"] .cert-nav-btn.disabled,
body.dark-theme .cert-nav-btn:disabled,
body.dark-theme .cert-nav-btn.disabled {
  color: #ffffff !important;
}

.cert-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.cert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  padding: 0;
}

.cert-dot.active {
  width: 22px;
  border-radius: 4px;
  background-color: var(--text-primary);
}

.cert-card-media {
  width: 100%;
  aspect-ratio: 16 / 11;
  background-color: var(--bg-elevated);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.cert-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.cert-card:hover .cert-card-media img {
  transform: scale(1.03);
}

.cert-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cert-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.cert-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cert-issuer {
  font-weight: 500;
}

.cert-year-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  background-color: var(--bg-hover);
  color: var(--text-muted);
}

/* Tab 05: Liên hệ */
.contact-grid-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.contact-channels-box,
.contact-form-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.box-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.channel-items {
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}

.channel-entry {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 2px;
}

.channel-entry:last-child {
  border-bottom: none;
}

.channel-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.channel-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--trans-fast);
}

.channel-val:hover,
.channel-val:focus-visible {
  opacity: 0.75;
  text-decoration: none;
}

.channel-val-static {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.social-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.instagram-contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--trans-fast);
}

.form-input:focus {
  border-color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.btn-submit {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
}

.form-status {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}

.form-status.success {
  display: none !important;
}

.form-status.error {
  display: block;
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Tab 06: Góc âm nhạc */
.music-panel-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.music-panel-header {
  text-align: center;
  margin-bottom: 28px;
}

.music-player-card {
  position: relative;
  overflow: hidden;
  width: 480px;
  max-width: 100%;
  background-color: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: background-color var(--trans-normal), border-color var(--trans-normal);
}

[data-theme="dark"] .music-player-card {
  background-color: #171717;
  border-color: #262626;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Trình phát nhạc & Hiệu ứng */

.player-cover-box {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
}

.player-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-cover-box.is-vinyl {
  width: 66px;
  height: 66px;
  overflow: visible !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.vinyl-disc-plate {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-cover-box.is-vinyl .vinyl-disc-plate {
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  background: radial-gradient(circle, #252528 0%, #151518 45%, #09090b 75%, #18181c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  will-change: transform;
}

.player-cover-box.is-vinyl .vinyl-disc-plate::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-radial-gradient(circle at center,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 3px,
      rgba(255, 255, 255, 0.08) 4px,
      rgba(0, 0, 0, 0.25) 5px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 0 6px rgba(0, 0, 0, 0.75);
  z-index: 1;
}

.player-cover-box.is-vinyl .player-cover-img {
  width: 38px;
  height: 38px;
  border-radius: 50% !important;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.player-cover-box .vinyl-center-pin {
  display: none;
}

.player-cover-box.is-vinyl .vinyl-center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #111111;
  border: 1.5px solid #d4d4d8;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
  z-index: 3;
  display: block;
}

.music-player-card.is-playing .player-cover-box.is-vinyl .vinyl-disc-plate {
  animation: vinylSpin 14s linear infinite;
}

.music-player-card:not(.is-playing) .player-cover-box.is-vinyl .vinyl-disc-plate {
  animation-play-state: paused;
}

@keyframes vinylSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.player-cover-box.is-beat-border {
  border-radius: 12px !important;
  position: relative;
  transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.player-cover-box.is-beat-border .player-cover-img {
  width: 100%;
  height: 100%;
  border-radius: 11px !important;
}

.music-player-card.is-playing .player-cover-box.is-beat-border {
  border-color: rgba(255, 255, 255, calc(0.5 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.5));
  box-shadow:
    0 0 0 calc(1.5px + var(--beat-pulse, var(--clap-pulse, 0)) * 3px) rgba(255, 255, 255, calc(0.6 + var(--beat-pulse, var(--clap-pulse, 0)) * 0.4)),
    0 0 calc(12px + var(--beat-pulse, var(--kick-pulse, 0)) * 26px) rgba(255, 255, 255, calc(0.35 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.45)),
    0 0 calc(24px + var(--beat-pulse, var(--kick-pulse, 0)) * 48px) rgba(255, 255, 255, calc(0.2 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.35)),
    0 0 calc(38px + var(--beat-pulse, var(--kick-pulse, 0)) * 62px) rgba(255, 255, 255, calc(0.1 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.25)),
    0 6px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .music-player-card.is-playing .player-cover-box.is-beat-border {
  border-color: rgba(255, 255, 255, calc(0.5 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.5));
  box-shadow:
    0 0 0 calc(1.5px + var(--beat-pulse, var(--clap-pulse, 0)) * 3px) rgba(25, 25, 30, calc(0.55 + var(--beat-pulse, var(--clap-pulse, 0)) * 0.4)),
    0 0 calc(12px + var(--beat-pulse, var(--kick-pulse, 0)) * 24px) rgba(35, 35, 45, calc(0.3 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.35)),
    0 0 calc(24px + var(--beat-pulse, var(--kick-pulse, 0)) * 44px) rgba(45, 45, 55, calc(0.18 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.25)),
    0 0 calc(38px + var(--beat-pulse, var(--kick-pulse, 0)) * 58px) rgba(50, 50, 60, calc(0.08 + var(--beat-pulse, var(--kick-pulse, 0)) * 0.15)),
    0 6px 20px rgba(0, 0, 0, 0.2);
}

.player-visual-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.music-player-card.is-playing .player-visual-canvas {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .music-player-card.is-playing .player-cover-box.is-vinyl .vinyl-disc-plate {
    animation: none !important;
  }

  .music-player-card.is-playing .player-cover-box.is-beat-border {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
  }
}

.player-top-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.player-meta-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.now-playing-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-track-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-artist {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.player-action-box {
  flex-shrink: 0;
}

.player-circle-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--text-primary);
  color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--trans-fast), opacity var(--trans-fast);
}

.player-circle-play-btn:hover {
  opacity: 0.9;
  transform: scale(1.06);
}

.player-circle-play-btn svg {
  width: 18px;
  height: 18px;
}

.player-circle-play-btn .pause-icon {
  display: none;
}

.player-circle-play-btn.playing .play-icon {
  display: none;
}

.player-circle-play-btn.playing .pause-icon {
  display: block;
}

/* Thanh trượt tiến độ & âm lượng */
.player-progress-section {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.custom-slider {
  position: relative;
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  outline: none;
}

.custom-slider .slider-track-bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2.5px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transition: background-color var(--trans-fast);
}

[data-theme="dark"] .custom-slider .slider-track-bg {
  background-color: rgba(255, 255, 255, 0.16);
}

.custom-slider .slider-track-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 5.5px;
  width: 0%;
  border-radius: 999px;
  background-color: var(--text-primary);
  pointer-events: none;
  transition: background-color var(--trans-fast);
}

.custom-slider .slider-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: transform 120ms ease, background-color var(--trans-fast);
}

.custom-slider:hover .slider-thumb,
.custom-slider.is-dragging .slider-thumb {
  transform: translate(-50%, -50%) scale(1.22);
}

.custom-slider:focus-visible .slider-thumb {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .custom-slider:focus-visible .slider-thumb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.player-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.player-bottom-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-step-btn {
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--trans-fast), transform var(--trans-fast);
}

.player-step-btn svg {
  width: 16px;
  height: 16px;
}

.player-step-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.player-repeat-btn {
  position: relative;
  color: var(--text-secondary);
}

.player-repeat-btn .repeat-icon {
  width: 17px;
  height: 17px;
}

.player-repeat-btn .repeat-active-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background-color: var(--text-primary);
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.player-repeat-btn.active {
  color: var(--text-primary);
}

.player-repeat-btn.active .repeat-active-dot {
  opacity: 1;
}

.player-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.player-volume-btn {
  background: transparent;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--trans-fast), transform var(--trans-fast);
}

.player-volume-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.player-volume-btn .volume-icon {
  width: 16px;
  height: 16px;
}

.player-volume-slider {
  width: 82px;
  flex-shrink: 0;
}

.music-playlist-section {
  width: 480px;
  max-width: 100%;
}

.playlist-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.playlist-header-bar .playlist-heading {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.playlist-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: background-color var(--trans-fast), transform var(--trans-fast), border-color var(--trans-fast);
}

.playlist-toggle-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.playlist-toggle-btn:active {
  transform: scale(0.92);
}

.playlist-toggle-icon {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.playlist-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (min-width: 769px) {
  .playlist-items-list {
    max-height: 258px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }

  .playlist-items-list::-webkit-scrollbar {
    width: 4px;
  }

  .playlist-items-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .playlist-items-list::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
  }

  .playlist-items-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
  }
}

.playlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  cursor: pointer;
  transition: background-color var(--trans-fast), border-color var(--trans-fast), transform var(--trans-fast);
}

.playlist-row:hover {
  background-color: var(--bg-hover);
  border-color: var(--border);
}

.playlist-row.active {
  background-color: var(--bg-elevated);
  border-color: var(--text-primary);
}

.playlist-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.track-number-badge {
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.playlist-row.active .track-num {
  display: none;
}

.playing-bars {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
}

.playlist-row.active .playing-bars {
  display: flex;
}

.playing-bars span {
  width: 3px;
  background-color: var(--text-primary);
  border-radius: 1px;
  animation: soundBars 0.8s infinite ease-in-out alternate;
}

.playing-bars span:nth-child(1) {
  height: 6px;
  animation-delay: 0.1s;
}

.playing-bars span:nth-child(2) {
  height: 12px;
  animation-delay: 0.3s;
}

.playing-bars span:nth-child(3) {
  height: 8px;
  animation-delay: 0.2s;
}

@keyframes soundBars {
  0% {
    height: 3px;
  }

  100% {
    height: 12px;
  }
}

.playlist-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.playlist-track-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-track-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-track-artist {
  font-size: 12px;
  color: var(--text-secondary);
}

.playlist-row-right {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Modal xem chứng chỉ PDF */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3.5vw, 32px) clamp(16px, 4vw, 40px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  overflow-x: hidden;
  overflow-y: auto;
}

.cert-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.cert-modal-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: auto;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  overflow: visible !important;
  padding: 4px;
  isolation: isolate;
}

.cert-modal-card {
  position: relative;
  flex: 0 1 auto;
  width: clamp(340px, 86vw, 920px);
  max-width: min(940px, calc(100vw - 140px));
  height: auto;
  max-height: calc(100vh - 40px);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

.cert-modal-backdrop.open .cert-modal-card {
  transform: scale(1) translateY(0);
}

.cert-modal-nav-btn {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transform-origin: center center;
  overflow: visible;
  will-change: transform, box-shadow;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease,
    background-color 0.2s ease,
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  outline: none;
}

[data-theme="dark"] .cert-modal-nav-btn,
body.dark-theme .cert-modal-nav-btn {
  background: rgba(30, 30, 34, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cert-modal-nav-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.cert-modal-prev:hover:not(:disabled) svg {
  transform: translateX(-2px);
}

.cert-modal-next:hover:not(:disabled) svg {
  transform: translateX(2px);
}

.cert-modal-nav-btn:hover:not(:disabled) {
  transform: scale(1.08);
  z-index: 30;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.18);
  border-color: var(--text-primary);
}

[data-theme="dark"] .cert-modal-nav-btn:hover:not(:disabled),
body.dark-theme .cert-modal-nav-btn:hover:not(:disabled) {
  background: rgba(45, 45, 52, 0.98);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.82), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.cert-modal-nav-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  z-index: 30;
}

.cert-modal-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.cert-modal-nav-btn:disabled,
.cert-modal-nav-btn.disabled {
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  color: #111111 !important;
}

.cert-modal-nav-btn:disabled svg,
.cert-modal-nav-btn.disabled svg {
  opacity: 1 !important;
  stroke: currentColor !important;
}

[data-theme="dark"] .cert-modal-nav-btn:disabled,
[data-theme="dark"] .cert-modal-nav-btn.disabled,
body.dark-theme .cert-modal-nav-btn:disabled,
body.dark-theme .cert-modal-nav-btn.disabled {
  color: #ffffff !important;
}

.cert-modal-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: var(--bg-surface);
  flex-shrink: 0;
  z-index: 2;
}

.cert-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cert-modal-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.cert-modal-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cert-modal-dot {
  color: var(--text-muted);
}

.cert-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cert-open-tab-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.cert-open-tab-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.cert-open-tab-btn svg {
  width: 16px;
  height: 16px;
}

.pdf-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--trans-fast), color var(--trans-fast), opacity var(--trans-fast);
}

.pdf-tool-btn:hover {
  background-color: var(--bg-hover);
}

.pdf-tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pdf-tool-btn svg {
  width: 16px;
  height: 16px;
}

.pdf-close-btn {
  margin-left: 2px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pdf-close-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.cert-modal-viewport {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: clamp(260px, 58vh, 560px);
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
}

.pdf-canvas-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

#pdf-render-canvas {
  display: block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  background-color: #ffffff;
  max-width: 100%;
  height: auto;
}

.pdf-loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background-color: var(--bg-elevated);
  z-index: 5;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.pdf-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spinBorder 0.8s linear infinite;
}

.pdf-error-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background-color: var(--bg-elevated);
  z-index: 5;
  color: var(--text-secondary);
}

.pdf-error-icon {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  stroke-width: 1.8;
  opacity: 0.85;
}

.pdf-error-state p {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.5;
  margin: 0;
}

.pdf-error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pdf-retry-btn {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.pdf-retry-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-primary);
}

.cert-thumb-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  background-color: #ffffff;
  transition: transform 0.35s ease;
}

.cert-card:hover .cert-thumb-canvas {
  transform: scale(1.025);
}

.cert-thumb-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
  border-radius: 4px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Chân trang (Footer) */
.profile-footer {
  margin-top: 40px;
  padding: 20px 0 10px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Trợ lý ảo AI (Gemini) */
.chatbot-wrapper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
}

.chat-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--text-primary);
  color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease,
    box-shadow 0.22s ease;
  position: relative;
  outline: none;
  cursor: pointer;
}

.chat-toggle-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.24);
}

.chat-toggle-btn:active {
  transform: scale(0.92) !important;
}

@keyframes chatNoticePulse {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.15) translateY(-3px);
  }

  50% {
    transform: scale(0.95) translateY(0);
  }

  75% {
    transform: scale(1.08) translateY(-1px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

.chat-toggle-btn.has-new-notice {
  animation: chatNoticePulse 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-toggle-btn .chat-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.25s ease;
}

.chat-toggle-btn .close-icon {
  display: none;
  width: 22px;
  height: 22px;
  transition: transform 0.25s ease;
}

.chat-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #22c55e;
  border: 2px solid var(--bg-page);
}

.chatbot-wrapper.active .chat-toggle-btn .chat-icon {
  display: none;
}

.chatbot-wrapper.active .chat-toggle-btn .close-icon {
  display: block;
}

.chat-dialog {
  position: fixed;
  right: 24px;
  bottom: 84px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  border-radius: 14px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 280ms;
  z-index: 999;
}

.chatbot-wrapper.active .chat-dialog {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.dialog-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-subtle);
}

.dialog-bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.bot-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.bot-status {
  font-size: 11.5px;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
}

.dialog-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-surface);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: chatMsgAppear 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  position: relative;
}

@keyframes chatMsgAppear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.bot {
  align-self: flex-start;
  margin-left: 8px;
}

.chat-msg.user {
  align-self: flex-end;
  margin-right: 8px;
}

.chat-msg .msg-bubble {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.chat-msg.bot .msg-bubble {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 14px 14px 14px 3px;
}

.chat-msg.bot .msg-bubble::before {
  content: "";
  position: absolute;
  bottom: 8px;
  left: -7px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--border);
  pointer-events: none;
}

.chat-msg.bot .msg-bubble::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: -5.5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--bg-subtle);
  pointer-events: none;
}

.chat-msg.bot .msg-bubble p {
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.chat-msg.bot .msg-bubble p:last-child {
  margin-bottom: 0;
}

.chat-msg.bot .msg-bubble ul,
.chat-msg.bot .msg-bubble ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.chat-msg.bot .msg-bubble li {
  margin-bottom: 4px;
  line-height: 1.45;
}

.chat-msg.bot .msg-bubble strong {
  font-weight: 700;
  color: var(--text-primary);
}

.chat-msg.bot .msg-bubble a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  word-break: break-all;
  transition: opacity 0.2s ease;
}

.chat-msg.bot .msg-bubble a:hover {
  opacity: 0.8;
}

.chat-msg.bot .msg-bubble code {
  font-family: monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.07);
  padding: 2px 5px;
  border-radius: 4px;
}

[data-theme="dark"] .chat-msg.bot .msg-bubble code,
body.dark-theme .chat-msg.bot .msg-bubble code {
  background: rgba(255, 255, 255, 0.12);
}

.chat-msg.user .msg-bubble {
  background-color: var(--text-primary);
  color: var(--bg-page);
  border-radius: 14px 14px 3px 14px;
}

.chat-msg.user .msg-bubble::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: -6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--text-primary);
  pointer-events: none;
}

.msg-time {
  font-size: 10.5px;
  line-height: 1.2;
  margin-top: 5px;
  display: block;
  text-align: right;
  letter-spacing: 0.2px;
}

.msg-time:empty {
  display: none !important;
}

.chat-msg.bot .msg-time {
  color: var(--text-muted);
}

.chat-msg.user .msg-time {
  color: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .chat-msg.user .msg-time,
body.dark-theme .chat-msg.user .msg-time {
  color: rgba(24, 24, 27, 0.62);
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.thinking-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  animation: chatBounce 1.2s infinite ease-in-out;
}

.thinking-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Card phát nhạc trong Chatbot */
.chat-music-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  user-select: none;
}

[data-theme="dark"] .chat-music-card,
body.dark-theme .chat-music-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.chat-music-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.chat-music-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-music-eq {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.chat-music-card.is-playing .chat-music-eq {
  opacity: 1;
}

.chat-music-eq span {
  width: 2.5px;
  height: 14px;
  background-color: #ffffff;
  border-radius: 2px;
  animation: chatEqBounce 1s infinite ease-in-out alternate;
}

.chat-music-eq span:nth-child(1) {
  animation-duration: 0.6s;
  height: 10px;
}

.chat-music-eq span:nth-child(2) {
  animation-duration: 0.85s;
  height: 16px;
}

.chat-music-eq span:nth-child(3) {
  animation-duration: 0.5s;
  height: 12px;
}

@keyframes chatEqBounce {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

.chat-music-info {
  flex: 1;
  min-width: 0;
}

.chat-music-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.chat-music-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.chat-music-status {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

.chat-music-card.is-playing .chat-music-status {
  color: #10b981;
}

.chat-music-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background-color: var(--text-primary);
  color: var(--bg-page);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.chat-music-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.chat-music-btn:active {
  transform: scale(0.97);
}

.chat-music-btn .chat-music-icon {
  width: 12px;
  height: 12px;
  display: block;
}

.chat-music-btn .pause-icon {
  display: none;
}

.chat-music-btn.is-playing .play-icon {
  display: none;
}

.chat-music-btn.is-playing .pause-icon {
  display: block;
}

.scroll-bottom-btn {
  position: absolute;
  bottom: 64px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.scroll-bottom-btn.show {
  display: flex;
}

.dialog-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-subtle);
  position: relative;
}

.dialog-action-btn,
.dialog-send-btn {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--trans-fast);
}

.dialog-action-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.dialog-send-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  margin-left: -2px;
}

.dialog-action-btn:hover,
.dialog-send-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

.dialog-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
}

.dialog-input:focus {
  border-color: var(--text-primary);
}

.image-preview-panel {
  padding: 8px 12px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.preview-panel-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-panel-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-page);
}

.preview-panel-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-panel-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-panel-size {
  font-size: 11px;
  color: var(--text-tertiary);
}

.preview-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.preview-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.preview-btn-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-sent-image {
  max-width: 220px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background-color: var(--bg-surface);
  margin-bottom: 6px;
}

.chat-msg.user .msg-bubble p {
  margin: 0;
  word-break: break-word;
}

.location-link {
  color: inherit;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.location-link:hover,
.location-link:focus-visible {
  opacity: 0.75;
  text-decoration: none !important;
  border-bottom: none !important;
}

.form-input.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.site-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 18, 18, 0.92);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .site-toast,
body.dark-theme .site-toast {
  background: rgba(245, 245, 245, 0.95);
  color: #111111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

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

/* Giao diện đáp ứng (Responsive) */
@media (max-width: 900px) {
  .profile-header-area {
    gap: 36px;
  }

  .avatar-frame {
    width: 158px;
    height: 158px;
  }

  .avatar-ring-inner {
    width: 140px;
    height: 140px;
  }

  .about-panel-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .skills-editorial-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid-wrap {
    grid-template-columns: 1fr;
  }

  .instagram-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cert-carousel-wrapper {
    gap: 12px;
    padding: 8px 12px;
  }

  .cert-card {
    flex: 0 0 calc((100% - 16px) / 2) !important;
    max-width: calc((100% - 16px) / 2) !important;
  }

  .certificates-grid {
    gap: 16px !important;
  }

  .cert-nav-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 16px;
    height: 56px;
  }

  .header-brand-name-wrap {
    min-width: 120px;
  }

  .header-brand-text {
    font-size: 14.5px;
  }

  .util-btn {
    width: 34px;
    height: 34px;
    font-size: 11.5px;
  }

  .profile-container {
    padding: 24px 16px 40px;
  }

  .profile-header-area {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-bottom: 24px;
  }

  .profile-avatar-col {
    padding-left: 0;
    margin: 0 auto;
  }

  .avatar-frame {
    width: 168px;
    height: 168px;
  }

  .avatar-ring-inner {
    width: 150px;
    height: 150px;
  }

  .profile-info-col {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .profile-user-row {
    justify-content: center;
    margin-bottom: 8px;
    gap: 6px;
  }

  .profile-name {
    font-size: 22px;
  }

  .badge-check-icon {
    width: 19px;
    height: 19px;
  }

  .profile-stats-row {
    justify-content: center;
    gap: 28px;
    margin-bottom: 14px;
    width: 100%;
  }

  .stat-item {
    font-size: 13px;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
  }

  .stat-number {
    font-size: 15px;
    font-weight: 700;
  }

  .stat-label {
    font-size: 12px;
  }

  .profile-bio-block {
    margin-bottom: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .typewriter-container {
    justify-content: center;
    font-size: 14px;
    min-height: 22px;
    margin-bottom: 8px;
  }

  .bio-text {
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 440px;
    margin: 0 auto 8px;
    text-align: center;
  }

  .bio-location {
    justify-content: center;
    font-size: 12.5px;
  }

  .profile-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 270px;
    margin: 0 auto;
    flex-wrap: nowrap;
  }

  .profile-actions-row .btn-action-icon {
    display: none !important;
  }

  .profile-actions-row #header-contact-btn,
  .profile-actions-row .btn-action-secondary {
    flex: 1 1 115px;
    height: 38px;
    min-height: 38px;
    min-width: 100px;
    max-width: 130px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    box-sizing: border-box;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .btn {
    font-size: 12.5px;
    padding: 6px 14px;
  }

  .instagram-tab-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
    box-sizing: border-box;
    border-top: 1px solid var(--border) !important;
  }

  .instagram-tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-items-wrapper {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    width: auto;
    min-width: max-content;
    padding: 0 16px;
    gap: 4px;
    position: relative;
  }

  .active-tab-line {
    position: absolute;
    top: -1px !important;
    height: 2px !important;
    background-color: var(--text-primary);
    z-index: 3;
    pointer-events: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: auto;
    height: 46px;
    font-size: 12px;
    gap: 7px;
    padding: 8px 14px;
    white-space: nowrap;
  }

  .tab-btn .tab-icon {
    width: 17px;
    height: 17px;
  }

  .tab-panel {
    text-align: left;
    padding-bottom: 84px;
  }

  .about-story-col {
    text-align: left;
  }

  .story-paragraph {
    text-align: left;
  }

  .instagram-projects-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  .ig-project-card {
    position: relative !important;
    width: 100% !important;
    height: 380px !important;
    aspect-ratio: auto !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    border: 1px solid var(--border) !important;
    background-color: var(--bg-subtle) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: block !important;
  }

  .ig-card-media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background-color: var(--bg-subtle) !important;
    display: block !important;
  }

  .ig-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    transform: none !important;
  }

  .ig-project-card:hover .ig-card-media img {
    transform: none !important;
  }

  .ig-card-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 8px !important;
    padding: 18px 20px !important;
    background: rgba(0, 0, 0, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 0 0 18px 18px !important;
    z-index: 2 !important;

    opacity: 0 !important;
    transform: translateY(12px) !important;
    pointer-events: none !important;
    transition: opacity 550ms cubic-bezier(0.16, 1, 0.3, 1), transform 550ms cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity, transform;
  }

  .ig-project-card.in-view .ig-card-overlay,
  .ig-project-card:focus-within .ig-card-overlay,
  .mobile-scroll-active .ig-project-card.in-view .ig-card-overlay,
  .mobile-scroll-active .ig-project-card:focus-within .ig-card-overlay {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .overlay-desc {
    order: 1 !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .overlay-title {
    order: 2 !important;
    font-family: var(--font-display) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
    margin: 1px 0 2px 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: left !important;
  }

  .overlay-bottom-bar {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-top: 2px !important;
  }

  .overlay-tags {
    order: 1 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    margin: 0 !important;
  }

  .tag-pill {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.10) !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
  }

  .tag-pill::after {
    display: none !important;
  }

  .overlay-actions {
    order: 2 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .overlay-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 9px 16px !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    text-decoration: none !important;
    transition: opacity var(--trans-fast), transform var(--trans-fast) !important;
  }

  .overlay-btn:active {
    opacity: 0.85 !important;
    transform: scale(0.98) !important;
  }

  .ig-card-mobile-info {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-scroll-active .ig-project-card .ig-card-overlay {
      transition: opacity 150ms ease !important;
      transform: none !important;
    }

    .mobile-scroll-active .ig-project-card.in-view .ig-card-overlay {
      transform: none !important;
    }
  }

  .cert-carousel-wrapper {
    gap: 8px;
    padding: 6px 10px;
  }

  .cert-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .certificates-grid {
    gap: 14px !important;
  }

  .cert-nav-btn {
    width: 36px;
    height: 36px;
  }

  .cert-nav-btn svg {
    width: 18px;
    height: 18px;
  }

  .music-player-card {
    padding: 16px 18px;
  }

  .player-top-row {
    gap: 12px;
  }

  .player-cover-box {
    width: 44px;
    height: 44px;
  }

  .player-cover-box.is-vinyl {
    width: 50px;
    height: 50px;
  }

  .player-cover-box.is-vinyl .player-cover-img {
    width: 29px;
    height: 29px;
  }

  .player-track-title {
    font-size: 15px;
  }

  .player-volume-wrap {
    justify-content: flex-end;
    gap: 8px;
  }

  .player-volume-slider {
    display: none !important;
  }

  .player-volume-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .edu-row {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  .edu-time {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .form-row-duo {
    grid-template-columns: 1fr;
  }

  .cert-modal-backdrop {
    padding: max(12px, env(safe-area-inset-top, 12px)) max(10px, env(safe-area-inset-right, 10px)) max(12px, env(safe-area-inset-bottom, 12px)) max(10px, env(safe-area-inset-left, 10px));
    align-items: center;
    justify-content: center;
  }

  .cert-modal-container {
    gap: 12px;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .cert-modal-card {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    max-width: 100%;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    margin: 0;
    overflow: hidden;
  }

  .cert-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 10px;
  }

  .cert-modal-meta {
    flex: 1;
    min-width: 0;
  }

  .cert-modal-title {
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }

  .cert-modal-sub {
    font-size: 11.5px;
  }

  .cert-modal-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .cert-open-tab-btn {
    width: 32px;
    height: 32px;
    padding: 0;
  }

  .cert-modal-toolbar .pdf-close-btn {
    width: 32px;
    height: 32px;
    margin: 0;
  }

  .cert-modal-viewport {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: clamp(220px, 48vh, 380px) !important;
    aspect-ratio: 1.414 / 1;
    padding: 8px 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .pdf-canvas-container {
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  #pdf-render-canvas {
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  }

  .cert-modal-nav-btn {
    width: 40px;
    height: 40px;
  }

  .cert-modal-nav-btn svg {
    width: 18px;
    height: 18px;
  }

  @media (max-width: 640px) {
    .cert-modal-backdrop {
      padding: max(10px, env(safe-area-inset-top, 10px)) max(8px, env(safe-area-inset-right, 8px)) max(10px, env(safe-area-inset-bottom, 10px)) max(8px, env(safe-area-inset-left, 8px));
    }

    .cert-modal-container {
      display: grid !important;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: auto auto;
      gap: 12px 14px !important;
      width: 100% !important;
      max-width: calc(100vw - 16px) !important;
      justify-items: center;
      align-items: center;
    }

    .cert-modal-card {
      grid-column: 1 / -1;
      grid-row: 1;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
    }

    .cert-modal-prev {
      grid-column: 1;
      grid-row: 2;
      justify-self: end;
      margin-right: 10px;
    }

    .cert-modal-next {
      grid-column: 2;
      grid-row: 2;
      justify-self: start;
      margin-left: 10px;
    }

    .cert-modal-nav-btn {
      width: 44px !important;
      height: 44px !important;
    }

    .cert-modal-nav-btn svg {
      width: 20px !important;
      height: 20px !important;
    }

    .cert-modal-header {
      padding: 10px 12px;
    }

    .cert-modal-viewport {
      padding: 6px 6px !important;
    }
  }

  .cert-carousel-wrapper {
    gap: 6px;
    padding: 6px 8px;
  }

  .cert-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .certificates-grid {
    gap: 12px !important;
  }

  .cert-nav-btn {
    width: 34px;
    height: 34px;
  }

  .cert-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .chatbot-wrapper {
    right: max(14px, env(safe-area-inset-right, 14px));
    bottom: max(14px, env(safe-area-inset-bottom, 14px));
  }

  .chat-dialog {
    right: max(10px, env(safe-area-inset-right, 10px));
    bottom: calc(max(14px, env(safe-area-inset-bottom, 14px)) + 58px);
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: 480px;
    max-height: calc(100dvh - 84px);
    max-height: calc(100vh - 84px);
    border-radius: 12px;
  }

  .playlist-header-bar {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .playlist-toggle-btn {
    display: inline-flex;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    color: var(--text-primary);
  }

  .playlist-toggle-btn:hover {
    background: transparent !important;
    border: none !important;
  }

  .playlist-toggle-icon {
    width: 20px;
    height: 20px;
    transform: rotate(180deg);
    transition: transform 400ms cubic-bezier(0.25, 1, 0.5, 1);
  }

  .music-playlist-section.is-collapsed .playlist-toggle-icon {
    transform: rotate(0deg);
  }

  .playlist-items-list {
    gap: 0;
    overflow: visible;
  }

  .playlist-row {
    margin-bottom: 6px;
    overflow: hidden;
    box-sizing: border-box;
    transition: max-height 400ms cubic-bezier(0.25, 1, 0.5, 1),
      opacity 360ms ease,
      padding 400ms cubic-bezier(0.25, 1, 0.5, 1),
      margin-bottom 400ms cubic-bezier(0.25, 1, 0.5, 1),
      border-color 360ms ease,
      background-color var(--trans-fast);
    max-height: 80px;
    opacity: 1;
  }

  .playlist-row:last-child {
    margin-bottom: 0;
  }

  .music-playlist-section.is-collapsed .playlist-row:not(.active) {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    border-color: transparent !important;
    pointer-events: none !important;
    visibility: hidden;
  }

  .music-playlist-section.is-collapsed .playlist-row.active {
    margin-bottom: 0 !important;
    max-height: 80px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  .music-playlist-section.is-switching-track .playlist-row {
    transition: none !important;
  }

  @media (prefers-reduced-motion: reduce) {

    .playlist-row,
    .playlist-toggle-icon {
      transition: none !important;
    }
  }
}

/* Thanh cuộn giao diện */
@media (hover: hover) and (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }

  *::-webkit-scrollbar {
    width: 7px;
    height: 7px;
  }

  *::-webkit-scrollbar-track {
    background: transparent;
  }

  *::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color var(--trans-fast);
  }

  *::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
  }
}

/* Trợ năng */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .avatar-animated-border {
    animation: none !important;
  }

  .avatar-animated-border .border-spin {
    stroke-dasharray: 60 480;
  }

  .typewriter-cursor,
  .header-typewriter-cursor {
    display: none !important;
  }

  .tab-panel.tab-exiting,
  .tab-panel.tab-entering,
  .tab-panel.tab-entering.enter-active {
    transition: none !important;
    transform: none !important;
  }

  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .bg-canvas {
    display: none !important;
  }

  .player-visual-canvas {
    opacity: 0.3 !important;
  }

  .chat-dialog,
  .chat-msg,
  .chat-toggle-btn,
  .chat-toggle-btn.has-new-notice {
    transform: none !important;
    animation: none !important;
  }

  .thinking-dots .dot {
    animation: none !important;
    opacity: 0.6;
  }
}