/* ==========================================================================
   NVBPlay Consent & Cookie Management Platform (CMP) Styles
   Giao diện Card Trực tiếp phong cách Thể thao NVBPlay
   Tuân thủ Nghị định 13/2023/NĐ-CP, NĐ 356/2025/NĐ-CP, NĐ 330/2026/NĐ-CP
   ========================================================================== */

:root {
  --nvb-c-primary: #0284c7;
  --nvb-c-primary-hover: #0369a1;
  --nvb-c-text: #0f172a;
  --nvb-c-muted: #64748b;
  --nvb-c-border: #e2e8f0;
  --nvb-c-bg-card: #ffffff;
  --nvb-c-radius: 16px;
  --nvb-c-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* --- Card Wrapper & Backdrop --- */
.nvb-consent-card-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: nvbFadeIn 0.25s ease-out;
}

.nvb-consent-card-wrapper[style*="display: none"],
.nvb-consent-card-wrapper[style*="display:none"] {
  display: none !important;
}

/* Smooth closing state */
.nvb-consent-card-wrapper.nvb-consent-closing {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.22s ease-out !important;
}

.nvb-consent-card-wrapper.nvb-consent-closing .nvb-consent-card {
  transform: translateY(28px) scale(0.96) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease-out !important;
}

.nvb-consent-card-wrapper.nvb-consent-closing .nvb-consent-backdrop {
  opacity: 0 !important;
  transition: opacity 0.22s ease-out !important;
}

@keyframes nvbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nvb-consent-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
  opacity: 0;
  animation: nvbBackdropIn 0.25s ease-out forwards;
}

@keyframes nvbBackdropIn {
  to { opacity: 1; }
}

/* --- Main Card Widget --- */
.nvb-consent-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--nvb-c-bg-card);
  color: var(--nvb-c-text);
  border-radius: var(--nvb-c-radius);
  box-shadow: var(--nvb-c-shadow);
  border: 1px solid var(--nvb-c-border);
  padding: 24px 22px 20px 22px;
  pointer-events: auto;
  z-index: 10;
  animation: nvbCardSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes nvbCardSlideUp {
  from {
    transform: translateY(24px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* --- Header --- */
.nvb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nvb-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nvb-card-icon {
  font-size: 24px;
  line-height: 1;
}

.nvb-card-header h3 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--nvb-c-text);
  letter-spacing: -0.01em;
}

.nvb-card-close-x {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nvb-card-close-x:hover {
  background: #f1f5f9;
  color: var(--nvb-c-text);
}

/* --- Description --- */
.nvb-card-desc {
  margin: 0 0 16px 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
}

.nvb-card-desc strong {
  color: var(--nvb-c-primary);
  font-weight: 600;
}

/* --- Section Title --- */
.nvb-card-section-title {
  border-top: 1px solid var(--nvb-c-border);
  padding-top: 14px;
  margin-bottom: 12px;
}

.nvb-card-section-title h4 {
  margin: 0 0 4px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--nvb-c-text);
}

.nvb-section-subtext {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--nvb-c-primary);
  line-height: 1.45;
}

/* --- Options & Switches --- */
.nvb-card-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.nvb-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9;
}

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

.nvb-option-info {
  flex: 1;
}

.nvb-option-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.nvb-option-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.nvb-option-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #dcfce7;
  color: #15803d;
  padding: 1px 6px;
  border-radius: 4px;
}

.nvb-option-hint {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

/* --- Custom Toggle Switch --- */
.nvb-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.nvb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.nvb-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.nvb-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nvb-toggle input:checked + .nvb-toggle-slider {
  background-color: var(--nvb-c-primary);
}

.nvb-toggle input:checked + .nvb-toggle-slider:before {
  transform: translateX(20px);
}

.nvb-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.nvb-toggle.is-disabled .nvb-toggle-slider {
  background-color: #10b981;
  cursor: not-allowed;
}

/* --- Footer Link --- */
.nvb-card-footer-note {
  border-top: 1px solid var(--nvb-c-border);
  padding-top: 12px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}

.nvb-card-footer-note a {
  color: var(--nvb-c-primary);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.nvb-card-footer-note a:hover {
  color: var(--nvb-c-primary-hover);
}

/* --- Buttons --- */
.nvb-card-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nvb-btn-card {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  white-space: nowrap;
}

.nvb-btn-reject {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
}

.nvb-btn-reject:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.nvb-btn-confirm {
  background: var(--nvb-c-primary);
  color: #ffffff;
  border: 1.5px solid var(--nvb-c-primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.nvb-btn-confirm:hover {
  background: var(--nvb-c-primary-hover);
  border-color: var(--nvb-c-primary-hover);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

/* --- Floating Badge (Cài đặt Cookie / Quyền riêng tư - Ẩn khi đã chọn) --- */
.nvb-consent-badge {
  display: none !important;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
}

.nvb-consent-badge button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.nvb-consent-badge button:hover {
  background: var(--nvb-c-primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
}

.nvb-badge-icon {
  font-size: 16px;
  line-height: 1;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
  .nvb-consent-card-wrapper {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .nvb-consent-card {
    max-width: 100%;
    padding: 20px 18px 16px 18px;
    max-height: 92vh;
    overflow-y: auto;
  }

  .nvb-card-options {
    max-height: 200px;
  }

  .nvb-card-buttons {
    flex-direction: column;
  }

  .nvb-btn-card {
    width: 100%;
  }

  .nvb-consent-badge {
    bottom: 16px;
    left: 16px;
  }

  .nvb-consent-badge .nvb-badge-text {
    display: none;
  }

  .nvb-consent-badge button {
    padding: 10px;
    border-radius: 50%;
  }
}
