/* ============================================================
   MOTIVATION — secondary FAB, settings dialog, gallery, player
   ============================================================ */

/* ------------------------------------------------------------
   SECONDARY FAB (Motivation settings)
------------------------------------------------------------ */

.fab-secondary {
  right: 24px;
  bottom: 92px;

  width: 46px;
  height: 46px;

  border-radius: 15px;

  background: rgba(25, 22, 17, 0.95);
  border: 1px solid var(--border-strong);

  box-shadow: var(--shadow);
}

.fab-secondary:hover {
  background: var(--surface-hover);
}

.fab-secondary span {
  font-size: 19px;
}

@media (max-width: 600px) {
  .fab-secondary {
    right: 18px;
    bottom: 82px;

    width: 42px;
    height: 42px;
  }
}

/* ------------------------------------------------------------
   TOGGLE SWITCH
------------------------------------------------------------ */

.toggle-switch {
  position: relative;

  display: inline-flex;

  cursor: pointer;
}

.toggle-switch input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;
}

.toggle-track {
  display: block;

  width: 40px;
  height: 23px;

  padding: 3px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.1);

  transition: background var(--transition);
}

.toggle-thumb {
  display: block;

  width: 17px;
  height: 17px;

  border-radius: 50%;

  background: #a89f8e;

  transition:
    transform var(--transition),
    background var(--transition);
}

.toggle-switch input:checked+.toggle-track {
  background: var(--gradient);
}

.toggle-switch input:checked+.toggle-track .toggle-thumb {
  background: white;

  transform: translateX(17px);
}

.toggle-switch.small .toggle-track {
  width: 32px;
  height: 19px;

  padding: 2px;
}

.toggle-switch.small .toggle-thumb {
  width: 15px;
  height: 15px;
}

.toggle-switch.small input:checked+.toggle-track .toggle-thumb {
  transform: translateX(13px);
}

.motivation-toggle-row {
  display: flex;

  align-items: center;
  justify-content: space-between;

  margin-bottom: 16px;

  font-size: 13px;
  font-weight: 700;

  color: var(--text-primary);
}

/* ------------------------------------------------------------
   SETTINGS DIALOG
------------------------------------------------------------ */

.settings-dialog {
  width: min(620px, calc(100vw - 30px));
  max-height: calc(100vh - 40px);

  padding: 0;

  border: 1px solid var(--border-strong);

  border-radius: 20px;

  color: var(--text-primary);

  background: linear-gradient(180deg, #151b2b, #0e1320);

  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.settings-dialog::backdrop {
  background: rgba(2, 4, 10, 0.75);

  backdrop-filter: blur(5px);
}

.settings-dialog-card {
  max-height: calc(100vh - 40px);

  padding: 22px;

  overflow-y: auto;
}

.settings-section-divider {
  height: 1px;

  margin: 22px 0;

  background: var(--border);
}

.settings-section-title {
  margin: 0 0 14px;

  font-size: 13px;
  font-weight: 800;

  letter-spacing: -0.01em;

  color: var(--text-primary);
}

.motivation-upload-progress {
  margin: 10px 0 0;

  font-size: 12px;

  color: var(--text-secondary);
}

/* ------------------------------------------------------------
   GALLERY
------------------------------------------------------------ */

.motivation-gallery {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));

  gap: 12px;
}

.motivation-gallery-empty {
  margin: 6px 0 0;

  font-size: 12px;

  color: var(--text-muted);
}

.motivation-card {
  overflow: hidden;

  border: 1px solid var(--border);

  border-radius: 12px;

  background: var(--surface);

  transition: opacity var(--transition);
}

.motivation-card.inactive {
  opacity: 0.5;
}

.motivation-card-media {
  position: relative;

  aspect-ratio: 4 / 3;

  background: #000;
}

.motivation-card-media img,
.motivation-card-media video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.motivation-card-type {
  position: absolute;

  top: 6px;
  left: 6px;

  padding: 2px 7px;

  border-radius: 999px;

  background: rgba(0, 0, 0, 0.6);

  color: white;

  font-size: 9px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.motivation-card-body {
  padding: 9px 10px 10px;
}

.motivation-card-title {
  margin: 0 0 8px;

  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;

  font-size: 12px;
  font-weight: 700;

  color: var(--text-primary);
}

.motivation-card-actions {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 6px;
}

.motivation-card-actions .icon-button {
  width: 28px;
  height: 28px;

  font-size: 11px;
}

.icon-button.danger:hover {
  color: #f87171;

  border-color: rgba(248, 113, 113, 0.35);

  background: rgba(248, 113, 113, 0.08);
}

/* ------------------------------------------------------------
   FORCED PLAYER
   ------------------------------------------------------------
   Deliberately has NO close affordance until the media has been
   watched — no default dialog close icon, no click-outside, and
   the "cancel" (Esc) event is preventDefault()-ed in JS.
------------------------------------------------------------ */

.motivation-player-dialog {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;

  margin: 0;

  padding: 0;

  border: none;

  background: #000;
}

.motivation-player-dialog::backdrop {
  background: #000;
}

.motivation-player-card {
  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 18px;

  width: 100%;
  height: 100%;

  padding: 32px 20px;
}

.motivation-player-title {
  margin: 0;

  max-width: min(700px, 90vw);

  text-align: center;

  color: white;

  font-size: 20px;
  font-weight: 800;

  letter-spacing: -0.02em;
}

.motivation-player-media {
  display: flex;

  align-items: center;
  justify-content: center;

  flex: 1;
  min-height: 0;

  width: 100%;
}

.motivation-player-video,
.motivation-player-image {
  max-width: min(1100px, 92vw);
  max-height: 72vh;

  border-radius: 14px;

  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);

  object-fit: contain;
}

.motivation-player-footer {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 14px;

  min-height: 44px;
}

.motivation-player-countdown {
  color: rgba(255, 255, 255, 0.65);

  font-size: 13px;
  font-weight: 600;
}

.motivation-player-mute {
  border-color: rgba(255, 255, 255, 0.18);

  background: rgba(255, 255, 255, 0.06);

  color: white;
}

.motivation-player-mute:hover {
  background: rgba(255, 255, 255, 0.12);
}

.motivation-player-close {
  padding: 11px 26px;
}

@media (max-width: 600px) {
  .motivation-player-card {
    padding: 22px 14px;
  }

  .motivation-player-title {
    font-size: 17px;
  }

  .motivation-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
