/* ===== UNIFORM BUTTON HOVER (archive category-filter style) ===== */
/* Mobile fix: gate ALL button hover behind a real-mouse check. On touch
   screens a tapped element stays ":hover"-ed until you tap elsewhere, so the
   button stays lit/lifted. Restricting hover to (hover:hover)+(pointer:fine)
   stops buttons staying lit after a tap; the :active / .pressed tap feedback
   (which clears correctly) is intentionally left outside this query. */
@media (hover: hover) and (pointer: fine) {
button:not(:disabled):hover,
input[type='submit']:not(:disabled):hover,
input[type='reset']:not(:disabled):hover,
input[type='button']:not(:disabled):hover,
.button:hover,
.archiveFilterBtn:hover,
.archive-page-btn:hover,
.ip-btn:hover,
.qr-btn:hover,
.cp-btn:hover,
.cp-copy-btn:hover,
.uc-calc-btn:hover,
.adm-modal-close:hover,
.adm-cat-opt span:hover {
  transform: translateY(-1px) !important;
  background-image: none !important;
  background-color: #4a84ff !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 2px #4a84ff, 0 0.65em 1.5em rgba(74,132,255,0.25);
  transition: background-color 0.2s ease-in-out, background-image 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
/* ===== RED BUTTONS: hover kırmızı kalır (mavi bindirme yok) ===== */
button.adm-btn-danger:not(:disabled):hover,
button.adm-btn-danger:hover,
.adm-btn-danger:hover,
.adm-confirm-actions .adm-btn-danger:hover,
.adm-actions .adm-btn-danger:hover,
.adm-btn-danger.hover {
  background-image: none !important;
  background-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 2px #dc2626, 0 0.65em 1.5em rgba(231,76,60,0.25) !important;
  transform: translateY(-1px) !important;
  transition: background-color 0.2s ease-in-out, background-image 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
} /* end @media (hover:hover) &#8212; hover fills are mouse-only */
/* ===== UNIFORM BUTTON ACTIVE (tıklandığında mavi iç - beyaz yazı) ===== */
button:not(:disabled):active,
input[type='submit']:not(:disabled):active,
input[type='reset']:not(:disabled):active,
input[type='button']:not(:disabled):active,
.button:active,
.archiveFilterBtn:active,
.archiveFilterBtn.selected:active,
.archive-page-btn:active,
.ip-btn:active,
.qr-btn:active,
.cp-btn:active,
.cp-copy-btn:active,
.uc-calc-btn:active,
.adm-modal-close:active,
.adm-cat-opt span:active {
  background-image: none !important;
  background: #2563eb !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
}

/* Kırmızı/tetikleyici butonlar için aktif halde kırmızı vurgu.
   button:not(:disabled):active'in mavi bindirmesini yenmesi için
   button + :not(:disabled) ile özgüllük yükseltildi. */
button.adm-btn-danger:not(:disabled):active,
.adm-btn-danger:active,
.adm-confirm-actions .adm-btn-danger:active {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 2px #dc2626 !important;
  transform: translateY(0) !important;
  transition: background-color 0.2s ease-in-out, background-image 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
/* ===== UNIFORM BUTTON PRESSED (tıklandıktan sonra kısa süre mavi - yumuşak dönüş) ===== */
button.pressed:not(:disabled),
input.pressed[type='submit'],
input.pressed[type='button'],
input.pressed[type='reset'],
.button.pressed,
.archiveFilterBtn.pressed,
.archive-page-btn.pressed,
.ip-btn.pressed,
.qr-btn.pressed,
.cp-btn.pressed,
.cp-copy-btn.pressed,
.uc-calc-btn.pressed,
.adm-modal-close.pressed,
.adm-cat-opt span.pressed {
  background-image: none !important;
  background: #2563eb !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
  transition: background-color 0.2s ease-in-out, background-image 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
/* Kırmızı/tetikleyici butonlar tıklanınca kısa süre kırmızı kalır
   (mavi uniform blokta hiç yer almadıkları için bu kural her zaman kazanır). */
button.adm-btn-danger.pressed:not(:disabled),
.adm-btn-danger.pressed,
.adm-confirm-actions .adm-btn-danger.pressed {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 2px #dc2626 !important;
  transition: background-color 0.2s ease-in-out, background-image 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* ===== MOBILE: kill sticky button :hover =====
   On touch screens the browser keeps a tapped element ":hover"-ed until the
   user taps elsewhere, so a button stays lit/lifted ("stuck hover"). These
   high-specificity (#main) rules reset every button class to its resting look
   on hover-incapable (touch) devices only, so a tap no longer leaves the
   button highlighted. Desktop (:hover capable) is completely unaffected.
   Active/pressed tap feedback (which clears on its own) is preserved. */
@media (hover: none), (pointer: coarse) {
  /* Outline buttons: transparent bg, blue text, blue outline, no lift.
     :not(.pressed):not(:active) lets the transient tap flash still show. */
  #main .ip-btn:not(.pressed):not(:active),
  #main .qr-btn:not(.pressed):not(:active),
  #main .cp-btn:not(.pressed):not(:active),
  #main .cp-copy-btn:not(.pressed):not(:active),
  #main .uc-calc-btn:not(.pressed):not(:active),
  #main .archiveFilterBtn:not(.pressed):not(:active),
  #main .archive-page-btn:not(.pressed):not(:active),
  #main .button:not(.primary):not(.adm-btn-danger):not(.pressed):not(:active) {
    background-color: transparent !important;
    background-image: none !important;
    color: #4a84ff !important;
    box-shadow: inset 0 0 0 2px #4a84ff !important;
    transform: none !important;
    border: 0 !important;
  }
  /* SELECTED category tags keep their persistent filled "hover-style" on
     touch too. The generic outline reset above would otherwise strip the
     chosen look; these higher-specificity rules restate it for the Archive
     filter tags (.active) and the Admin category pills (:checked). */
  #main .archiveFilterBtn.active:not(.pressed):not(:active),
  #main .adm-cat-opt input:checked + span:not(.pressed):not(:active) {
    background-color: #4a84ff !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 2px #4a84ff, 0 0.65em 1.5em rgba(74,132,255,0.25) !important;
    transform: translateY(-1px) !important;
    border: 0 !important;
  }
  /* Unchecked Admin pills must return to their outline look after deselection
     (kills the sticky :hover on touch) instead of staying lit. */
  #main .adm-cat-opt input:not(:checked) + span:not(.pressed):not(:active) {
    background-color: transparent !important;
    background-image: none !important;
    color: #4a84ff !important;
    box-shadow: inset 0 0 0 2px #4a84ff !important;
    transform: none !important;
    border: 0 !important;
  }
  /* Filled primary buttons (keep filled, just no lift). */
  #main .primary:not(.pressed):not(:active),
  #main button.primary:not(.pressed):not(:active),
  #main input[type="submit"].primary:not(.pressed):not(:active),
  #main input[type="button"].primary:not(.pressed):not(:active),
  #main .button.primary:not(.pressed):not(:active),
  #main .ip-btn.primary:not(.pressed):not(:active),
  #main .qr-btn.primary:not(.pressed):not(:active) {
    background-color: #4a84ff !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
    border: 0 !important;
  }
  /* Danger buttons: red outline, red text, no lift. */
  #main .adm-btn-danger:not(.pressed):not(:active) {
    background-color: transparent !important;
    background-image: none !important;
    color: #ff8a7a !important;
    box-shadow: inset 0 0 0 2px rgba(231,76,60,0.85) !important;
    transform: none !important;
    border: 0 !important;
  }
  /* Modal close: neutral. */
  #main .adm-modal-close:not(.pressed):not(:active) {
    background-color: rgba(255,255,255,0.04) !important;
    background-image: none !important;
    color: #8899a8 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08) !important;
    transform: none !important;
    border: 0 !important;
  }
}