/* ShwePlay Profile Switcher, Manage Profiles, Account Shell & Device Cards */
.avatar-preset-avatar-1 { background: linear-gradient(135deg, #e50914, #b20710); }
.avatar-preset-avatar-2 { background: linear-gradient(135deg, #0071eb, #00449e); }
.avatar-preset-avatar-3 { background: linear-gradient(135deg, #2bb673, #157347); }
.avatar-preset-avatar-4 { background: linear-gradient(135deg, #8a2be2, #4b0082); }
.avatar-preset-avatar-5 { background: linear-gradient(135deg, #f5a623, #d97706); }
.avatar-preset-avatar-6 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.avatar-preset-avatar-7 { background: linear-gradient(135deg, #f43f5e, #be123c); }
.avatar-preset-avatar-8 { background: linear-gradient(135deg, #ec4899, #be185d); }

.flix-badge-current { font-size: 11px; color: #10b981; font-weight: 700; margin-top: 3px; }
.flix-btn-manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid #2a344a;
  color: #e2e8f0;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.flix-btn-manage:hover { border-color: #ffb800; color: #ffb800; background: rgba(255, 184, 0, 0.1); }

/* Modals: Add / Edit / PIN */
.modal-content.flix-modal-dark, .flix-modal-dark {
  background: #121622 !important;
  border: 1px solid #1e2536 !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85) !important;
  color: #ffffff !important;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}
.flix-modal-dark form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.flix-modal-dark .modal-header, .flix-modal-dark .modal-footer { background: #0b0e14 !important; border-color: #1e2536 !important; flex-shrink: 0; }
.flix-modal-dark .modal-header { padding: 16px 20px !important; align-items: center; }
.flix-modal-dark .modal-title { font-size: 1.15rem !important; font-weight: 800 !important; color: #ffffff !important; margin: 0; }
.flix-modal-dark .close { width: 44px; height: 44px; padding: 0 !important; margin: -6px -8px -6px auto !important; color: #cbd5e1 !important; opacity: 1 !important; display: inline-flex; align-items: center; justify-content: center; }
.flix-modal-dark .modal-body { padding: 18px 20px !important; background: #121622 !important; overflow-y: auto; flex: 1 1 auto; }
.flix-modal-dark .modal-footer { padding: 14px 20px !important; gap: 10px; flex-wrap: wrap; }
.flix-modal-dark .modal-footer .btn, #pinModal .btn, #btnDeleteProfile, .flix-profiles-footer .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

.flix-input, .flix-modal-dark .sp-input, .sp-input {
  background: #0f131d !important;
  border: 1px solid #1e2536 !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-size: 16px !important;
  min-height: 48px;
  padding: 11px 14px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.flix-input:focus, .flix-modal-dark .sp-input:focus { border-color: #ffb800 !important; box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.22) !important; outline: none !important; }
#pinModalInput { font-size: 22px !important; letter-spacing: 8px; text-indent: 8px; }

.flix-avatar-picker {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 12px !important;
  background: #0f131d !important;
  border: 1px solid #1e2536 !important;
  border-radius: 14px !important;
  justify-items: center;
}
.flix-avatar-option { position: relative; cursor: pointer; margin: 0; display: flex; align-items: center; justify-content: center; }
.flix-avatar-option input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flix-avatar-swatch {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 20px !important;
  color: #ffffff !important;
  border: 2.5px solid transparent !important;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.flix-avatar-option input[type="radio"]:checked ~ .flix-avatar-swatch { border-color: #ffb800 !important; transform: scale(1.1); box-shadow: 0 0 14px rgba(255, 184, 0, 0.65); }
.flix-avatar-option:focus-within .flix-avatar-swatch { outline: 2px solid #ffb800; outline-offset: 2px; }

.sp-modal-feature-box { background: #0f131d !important; border: 1px solid #1e2536 !important; border-radius: 14px !important; padding: 14px !important; margin-top: 14px !important; }
.sp-delete-profile-wrap .btn-outline-danger { color: #f87171 !important; border-color: rgba(239, 68, 68, 0.45) !important; background: rgba(239, 68, 68, 0.08) !important; border-radius: 10px !important; font-weight: 700 !important; padding: 8px 16px !important; }

/* Profile Layout Mobile Account Menu & Hero */
.sp-mobile-nav-toggle { display: none; }
.sp-profile-nav-body { display: block; }

/* Edit Profile & Change Password Controls */
.sp-edit-avatar-controls:focus-within .sp-upload-btn-label { outline: 2px solid var(--sp-accent, #f5b301); outline-offset: 3px; }
.sp-upload-btn-label { min-height: 44px; }
.sp-toggle-pwd { width: 44px !important; height: 44px !important; right: 4px !important; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; }

/* Show Overview Fixes & Registered Devices Cards */
.sp-continue-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)) !important; }
.sp-sub-upgrade-info { min-width: 0 !important; }
.sp-btn-switch-mini { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }

.sp-device-list { display: grid; gap: 12px; }
.sp-device-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: rgba(10, 13, 20, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); }
.sp-device-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 200px; }
.sp-device-icon { width: 42px; height: 42px; border-radius: 12px; background: rgba(245, 179, 1, 0.14); color: #f5b301; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.sp-device-meta { min-width: 0; }
.sp-device-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--sp-text, #f8fafc); font-size: 0.92rem; font-weight: 750; overflow-wrap: anywhere; }
.sp-device-current-pill { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.38); color: #10b981; font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.sp-device-sub { color: var(--sp-muted, #94a3b8); font-size: 0.78rem; margin-top: 2px; overflow-wrap: anywhere; }
.sp-device-remove-btn { min-height: 40px; padding: 6px 14px; border-radius: 10px; background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.35); color: #f87171; font-size: 0.8rem; font-weight: 750; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sp-device-empty { padding: 28px 16px; text-align: center; color: var(--sp-muted, #94a3b8); border: 1px dashed rgba(255, 255, 255, 0.12); border-radius: 14px; }

/* Light Mode Contrast */
.light-mode .flix-profiles-title { color: #0f172a !important; }
.light-mode .flix-profiles-subtitle { color: #475569 !important; }
.light-mode .flix-add-wrap { background: #f1f5f9 !important; border-color: #94a3b8 !important; color: #334155 !important; }
.light-mode .flix-btn-manage, .light-mode .sp-btn-outline, .light-mode .flix-manage-pill { background: #ffffff !important; border-color: #cbd5e1 !important; color: #0f172a !important; }
.light-mode .sp-manage-eyebrow, .light-mode .sp-badge-vip, .light-mode .sp-nav-active-badge { background: rgba(245, 158, 11, 0.15) !important; border-color: rgba(217, 119, 6, 0.38) !important; color: #92400e !important; }
.light-mode .sp-badge-free, .light-mode .sp-badge-provider, .light-mode .sp-nav-sub-badge, .light-mode .sp-nav-count-badge { background: #f1f5f9 !important; border-color: rgba(15, 23, 42, 0.14) !important; color: #334155 !important; }
.light-mode .sp-btn-hero-edit, .light-mode .sp-btn-outline-sm, .light-mode .sp-upload-btn-label, .light-mode .sp-btn-switch-mini { background: #f8fafc !important; border-color: rgba(15, 23, 42, 0.16) !important; color: #0f172a !important; }
.light-mode .sp-btn-hero-profiles { background: rgba(245, 158, 11, 0.16) !important; border-color: rgba(217, 119, 6, 0.4) !important; color: #92400e !important; }
.light-mode .sp-profile-sub-hero.is-active-sub, .light-mode .sp-profile-sub-hero.is-free-sub { background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%) !important; border-color: rgba(217, 119, 6, 0.32) !important; }
.light-mode .sp-sub-upgrade-title, .light-mode .sp-sub-benefits-list li, .light-mode .sp-device-title, .light-mode .sp-nav-user-name { color: #0f172a !important; }
.light-mode .sp-sub-upgrade-desc, .light-mode .sp-card-subtitle, .light-mode .sp-device-sub { color: #475569 !important; }
.light-mode .sp-sub-benefits-list li i, .light-mode .sp-sub-kicker { color: #b45309 !important; }
.light-mode .sp-device-card { background: #f8fafc; border-color: rgba(15, 23, 42, 0.1); }
.light-mode .sp-device-remove-btn { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.light-mode .sp-device-empty { border-color: rgba(15, 23, 42, 0.15); color: #475569; }
.light-mode .sp-toggle-pwd { color: #475569 !important; }
.light-mode .sp-toggle-pwd:hover { color: #0f172a !important; }

@media (max-width: 991px) {
  .sp-profile-shell { padding-top: 16px !important; padding-bottom: 48px !important; }
  .container.sp-profile-container { padding-left: 12px !important; padding-right: 12px !important; }
  .sp-profile-sidebar-col { margin-bottom: 0 !important; }
  .sp-profile-nav-card { padding: 8px !important; margin-bottom: 12px !important; border-radius: 16px !important; }
  .sp-mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: rgba(245, 179, 1, 0.12);
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
  }
  .light-mode .sp-mobile-nav-toggle { background: rgba(245, 158, 11, 0.12); color: #0f172a; }
  .sp-mobile-nav-label { display: inline-flex; align-items: center; gap: 8px; color: #ffd65b; }
  .light-mode .sp-mobile-nav-label { color: #92400e; }
  .sp-mobile-nav-current { margin-left: auto; font-size: 0.78rem; font-weight: 700; color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48%; }
  .light-mode .sp-mobile-nav-current { color: #475569; }
  .sp-mobile-nav-caret { transition: transform 0.2s ease; color: #ffd65b; flex-shrink: 0; }
  .light-mode .sp-mobile-nav-caret { color: #92400e; }
  .sp-profile-nav-card.is-expanded .sp-mobile-nav-caret { transform: rotate(180deg); }
  .sp-profile-nav-body { display: none; padding: 10px 4px 4px; }
  .sp-profile-nav-card.is-expanded .sp-profile-nav-body { display: block; }
  .sp-profile-nav-body .sp-nav-user-preview { display: none !important; }
  .sp-profile-nav-link { min-height: 44px; }
  .flix-profiles-wrapper, .sp-manage-profiles-page { padding: 24px 12px 56px !important; margin-top: 0 !important; }
}

@media (max-width: 767.98px) {
  .sp-profile-hero { padding: 20px 16px !important; margin-bottom: 14px !important; border-radius: 20px !important; }
  .sp-profile-hero-content { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 14px !important; }
  .sp-profile-meta { min-width: 0 !important; width: 100% !important; }
  .sp-profile-eyebrow, .sp-profile-badges { justify-content: center !important; }
  .sp-profile-name { overflow-wrap: anywhere !important; word-break: break-word !important; font-size: clamp(1.15rem, 5vw, 1.6rem) !important; }
  .sp-profile-hero-actions { flex-wrap: wrap !important; justify-content: center !important; width: 100% !important; gap: 8px !important; }
  .sp-profile-hero-actions .btn { flex: 1 1 auto; min-height: 42px; justify-content: center; }
  .flix-profiles-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .flix-profiles-footer .ml-3 { margin-left: 0 !important; }
}

@media (max-width: 575px) {
  .sp-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .sp-form-actions .btn { width: 100%; justify-content: center; min-height: 46px; }
  .sp-device-remove-form, .sp-device-remove-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .flix-profiles-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 136px)) !important; justify-content: center !important; gap: 16px !important; margin-bottom: 30px !important; }
  .flix-profile-card, .flix-manage-card { width: 100% !important; }
  .flix-avatar-wrap, .flix-manage-card .flix-avatar-wrap { width: 112px !important; height: 112px !important; }
  .flix-profiles-title { font-size: 1.75rem !important; }
  .flix-profiles-footer .btn { flex: 1 1 100%; }
}
