/* GDrive Loop Player ─ player.css */

/* ── Base bar ──────────────────────────────────────────────────────── */
.gdlp-bar {
  position: fixed;
  bottom: 0;
  height: var(--gdlp-h, 60px);
  background: rgba(12, 12, 18, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center; /* Căn giữa trục dọc */
  padding: 0 14px;
  gap: 12px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  box-sizing: border-box;
  flex-wrap: nowrap !important; /* Chống rớt dòng */
}

/* Full-width variant */
.gdlp-full { left: 0; right: 0; width: 100%; }

/* Pill / custom-width variant — căn giữa, bo góc */
.gdlp-pill {
  left: 50%;
  transform: translateX(-50%);
  width: var(--gdlp-w, 480px);
  max-width: calc(100vw - 10px); /* Tự động co lại trên màn hình nhỏ, chừa lề 5px mỗi bên */
  bottom: 5px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Play button ────────────────────────────────────────────────────── */
.gdlp-play {
  flex-shrink: 0;
  width: calc(var(--gdlp-h, 60px) * 0.62);
  height: calc(var(--gdlp-h, 60px) * 0.62);
  min-width: 32px; min-height: 32px;
  border-radius: 50%;
  background: #7c6af7;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 0 16px rgba(124,106,247,0.4);
  padding: 0;
  margin: 0;
}
.gdlp-play:hover  { background: #9d8df8; box-shadow: 0 0 24px rgba(124,106,247,0.6); }
.gdlp-play:active { transform: scale(0.9); }

.gdlp-ico {
  width: calc(var(--gdlp-h, 60px) * 0.25);
  height: calc(var(--gdlp-h, 60px) * 0.25);
  min-width: 12px; min-height: 12px;
  flex-shrink: 0;
  display: block; /* Xoá khoảng trống baseline của thẻ SVG */
}
.ico-pause { display: none; }

/* ── Time labels ────────────────────────────────────────────────────── */
.gdlp-t {
  font-size: clamp(10px, calc(var(--gdlp-h, 60px) * 0.22), 13px);
  color: #8888a0;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1; /* Ép text không có khoảng trống thừa trên dưới */
  display: flex;
  align-items: center;
}
.gdlp-dur { color: #55556a; }

/* ── Seek bar ───────────────────────────────────────────────────────── */
.gdlp-seek {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
  padding: 0 2px;
}

.gdlp-seek-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  position: relative;
  transition: height 0.15s;
  display: flex;
  align-items: center; /* Đảm bảo track luôn nằm giữa */
}
.gdlp-seek:hover .gdlp-seek-track { height: 5px; }

.gdlp-seek-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c6af7, #a78bfa);
  border-radius: 3px;
  position: relative;
  pointer-events: none;
}

/* Thumb dot */
.gdlp-seek-thumb {
  position: absolute;
  right: -6px; top: 50%;
  transform: translateY(-50%) scale(0);
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: transform 0.12s;
  pointer-events: none;
}
.gdlp-seek:hover .gdlp-seek-thumb,
.gdlp-seek.dragging .gdlp-seek-thumb { transform: translateY(-50%) scale(1); }
.gdlp-seek.dragging .gdlp-seek-track { height: 5px; }

/* ── Volume ─────────────────────────────────────────────────────────── */
.gdlp-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 100%;
}

.gdlp-icon-btn {
  background: none;
  border: none;
  color: #8888a0;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex; 
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  flex-shrink: 0;
}
.gdlp-icon-btn:hover { color: #e8e8f0; }
.gdlp-icon-btn svg {
  width: clamp(14px, calc(var(--gdlp-h, 60px) * 0.27), 18px);
  height: clamp(14px, calc(var(--gdlp-h, 60px) * 0.27), 18px);
  display: block;
}

/* ---------------- Volume ---------------- */

.gdlp-vol-wrap{
    display:flex;
    align-items:center;
    gap:6px;
    flex-shrink:0;
}

.gdlp-icon-btn{
    width:22px;
    height:22px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:none;
    background:none;
    color:#9aa0b3;
    cursor:pointer;
}

.gdlp-icon-btn:hover{
    color:#fff;
}

.gdlp-vol-ico{
    width:16px;
    height:16px;
}

.gdlp-vol{
    width:50px;

    appearance:none;
    -webkit-appearance:none;

    height:14px;          /* tăng vùng chứa */
    padding:0;
    margin:0;

    background:transparent;

    display:block;
}

.gdlp-vol::-webkit-slider-runnable-track{
    height:3px;
    background:rgba(255,255,255,.18);
    border-radius:999px;
}


/* Chrome */

.gdlp-vol::-webkit-slider-thumb{
    -webkit-appearance:none;

    width:10px;
    height:10px;
    border-radius:50%;

    background:#fff;
    border:none;

    margin-top:-3.5px;   /* cực kỳ quan trọng */
}

/* Firefox */

.gdlp-vol::-moz-range-thumb{
    width:10px;
    height:10px;
    border:none;
    border-radius:50%;
    background:#fff;
}

.gdlp-vol::-moz-range-track{
    height:3px;
    background:rgba(255,255,255,.18);
    border-radius:999px;
}



/* ── Speed button ───────────────────────────────────────────────────── */
.gdlp-speed-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #8888a0;
  font-size: clamp(10px, calc(var(--gdlp-h, 60px) * 0.2), 12px);
  font-weight: 600;
  padding: 0 8px;
  height: calc(var(--gdlp-h, 60px) * 0.45); /* Cố định chiều cao theo tỷ lệ player */
  min-height: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1; /* Ép text không lệch */
  margin: 0;
}
.gdlp-speed-btn:hover,
.gdlp-speed-btn.active {
  background: rgba(124,106,247,0.2);
  border-color: rgba(124,106,247,0.4);
  color: #a78bfa;
}

/* ── UX Builder / iframe preview mode ──────────────────────────────── */
.gdlp-wrapper { width: 100%; }
.gdlp-bar.gdlp-preview {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  margin: 4px 0 !important;
  flex-wrap: nowrap !important;
}
.gdlp-speed-wrap { position: relative; }

.gdlp-speed-menu {
  position: absolute;
  bottom: 110%; /* Hiện bên trên nút */
  right: 0;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  padding: 4px;
  min-width: 50px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.gdlp-speed-menu.show { display: flex; }

.gdlp-speed-menu div {
  padding: 6px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  color: #8888a0;
  border-radius: 4px;
}

.gdlp-speed-menu div:hover, .gdlp-speed-menu div.active {
  background: rgba(124,106,247,0.2);
  color: #a78bfa;
}
/* ── Download Button ────────────────────────────────────────────────── */
.gdlp-download {
  text-decoration: none !important;
  margin-left: 2px;
}
.gdlp-download:hover {
  text-decoration: none !important;
}
.gdlp-download svg {
  transition: transform 0.15s;
}
.gdlp-download:active svg {
  transform: translateY(2px); /* Hiệu ứng nhấn nhẹ xuống */
}