/* Fable SUBSCRIBE - gumb "Shrani iskanje" in stran "Shranjena iskanja" */

/* ---------- gumb na strani iskanja ---------- */

.fsub-form,
.fsub-remove-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.fsub-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #d0d0d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
  -webkit-appearance: none;
  appearance: none;
}

.fsub-btn:hover {
  border-color: #999;
  text-decoration: none;
  color: #111;
}

.fsub-btn svg {
  flex-shrink: 0;
}

.fsub-btn.fsub-saved {
  background: #eef8f3;
  border-color: #9ad2b7;
  color: #0b6b45;
}

.fsub-btn.fsub-saved:hover {
  border-color: #4faa7e;
}

.fsub-btn.fsub-loading {
  opacity: .6;
  cursor: wait;
}

/* odprto lastno shranjeno iskanje: gumb "Odstrani narocnino" */
.fsub-btn.fsub-remove,
.fsub-btn-mobile.fsub-remove {
  background: #fdeeec;
  border-color: #f0c2bc;
  color: #b03a2e;
}

.fsub-btn.fsub-remove:hover,
.fsub-btn-mobile.fsub-remove:hover {
  background: #fadbd6;
  border-color: #e09a90;
  color: #922b20;
}

/* namizje: v vrstici z naslovom, levo od razvrscanja */
.search-title-right .fsub-form,
.search-title-right .fsub-remove-form,
.search-title-right .fsub-btn-desktop {
  margin-right: 10px;
}

/* mobilni: gumb v vrstici s Filter / Razvrsti */
.fsub-btn-mobile {
  display: none;
}

@media screen and (max-width: 767px) {
  .fsub-btn-desktop,
  .search-title-right .fsub-form,
  .search-title-right .fsub-remove-form {
    display: none !important;
  }

  .mobile-search-actions .fsub-form,
  .mobile-search-actions .fsub-remove-form {
    flex: 1 1 0;
    display: flex;
    min-width: 0;
  }

  .fsub-btn-mobile {
    display: flex;
    flex: 1 1 0;
    width: 100%;
    justify-content: center;
    padding: 12px 10px;
    border: 1px solid #4c4c4c;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1;
  }

  .fsub-btn-mobile.fsub-saved {
    border-color: #9ad2b7;
    color: #0b6b45;
  }

  /* samostojna vrstica, ko iskanje nima zadetkov (vrstica Filter/Razvrsti se ne izrise) */
  .fsub-mobile-row {
    display: flex;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ebebeb;
  }

  .fsub-mobile-row .fsub-form,
  .fsub-mobile-row .fsub-remove-form {
    flex: 1 1 0;
    display: flex;
  }
}

@media screen and (min-width: 768px) {
  .fsub-mobile-row {
    display: none;
  }
}

/* ---------- obvestilo po shranjevanju ---------- */

.fsub-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity .2s;
}

.fsub-toast.fsub-show {
  opacity: 1;
}

.fsub-toast a {
  color: #8fd3b6;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.fsub-toast.fsub-toast-error {
  background: #8f2a2a;
}

/* ---------- stran "Shranjena iskanja" ---------- */

.fsub-page {
  width: 100%;
}

.fsub-page-head h1 {
  margin: 0 0 6px;
}

.fsub-head-count {
  font-weight: 400;
  color: #777;
  font-size: .8em;
}

.fsub-intro {
  margin: 0 0 16px;
  color: #666;
  font-size: 13.5px;
}

.fsub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  clear: both;
}

/* kartica: ime + meta | obvescanje | prikazi | kos */
.fsub-item {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e6e7e9;
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}

.fsub-item:hover {
  border-color: #cfd3d8;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.fsub-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fsub-item-name {
  display: block;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #1a1a1a;
  text-decoration: none;
}

.fsub-item-name:hover {
  color: #008060;
  text-decoration: none;
}

.fsub-item-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fsub-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12.5px;
  color: #7a7a7a;
  line-height: 1.3;
}

.fsub-item-muted .fsub-item-name {
  color: #555;
}

/* znacka "N filtrov" s seznamom filtrov ob hoverju / fokusu (tap na mobilniku) */
.fsub-filters {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid #e0e2e5;
  border-radius: 999px;
  background: #f7f8f9;
  color: #555;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: default;
  outline: none;
}

.fsub-filters:hover,
.fsub-filters:focus {
  border-color: #bfc4ca;
  color: #222;
}

.fsub-filters svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.fsub-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 240px;
  max-width: 340px;
  padding: 10px 12px 11px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
}

.fsub-tip::before {
  content: '';
  position: absolute;
  left: 14px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: #1a1a1a;
  transform: rotate(45deg);
}

.fsub-filters:hover .fsub-tip,
.fsub-filters:focus .fsub-tip,
.fsub-filters:focus-within .fsub-tip {
  display: block;
}

.fsub-tip-title {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.fsub-tip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fsub-tip li {
  margin: 0;
  padding: 3px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.fsub-tip li:first-child {
  border-top: 0;
  padding-top: 0;
}

.fsub-new {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 9px;
  background: #008060;
  color: #fff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.fsub-item-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fsub-freq-form,
.fsub-delete-form {
  margin: 0;
  display: flex;
  align-items: center;
}

/* izbira obvescanja: zvoncek + select v enem okvirju */
.fsub-freq-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 10px;
  height: 36px;
  border: 1px solid #d5d7db;
  border-radius: 8px;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: border-color .15s;
}

.fsub-freq-wrap:hover {
  border-color: #999;
}

.fsub-freq-wrap svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.fsub-select {
  padding: 0 28px 0 6px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #222;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  width: auto;
  margin: 0;
  box-shadow: none;
}

.fsub-select:focus {
  outline: none;
}

.fsub-freq-wrap:focus-within {
  border-color: #008060;
  box-shadow: 0 0 0 3px rgba(0, 128, 96, .12);
}

.fsub-open {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: #008060;
  color: #fff;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}

.fsub-open:hover {
  background: #006a4f;
  color: #fff;
  text-decoration: none;
}

.fsub-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #9a9a9a;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}

.fsub-delete svg {
  width: 17px;
  height: 17px;
}

.fsub-delete:hover {
  color: #c0392b;
  border-color: #e6c2be;
  background: #fdf3f2;
}

.fsub-btn-small {
  padding: 6px 10px;
  border: 1px solid #4c4c4c;
  border-radius: 7px;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* prazno stanje */
.fsub-empty {
  clear: both;
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border: 1px dashed #d0d0d0;
  border-radius: 12px;
  color: #555;
}

.fsub-empty svg {
  width: 36px;
  height: 36px;
  color: #bbb;
}

.fsub-empty h2 {
  margin: 12px 0 6px;
  font-size: 17px;
}

.fsub-empty p {
  margin: 0 0 16px;
  font-size: 14px;
}

.fsub-browse-btn {
  display: inline-block;
  padding: 9px 18px;
  background: #008060;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.fsub-browse-btn:hover {
  background: #006a4f;
  color: #fff;
  text-decoration: none;
}

@media screen and (max-width: 767px) {
  .fsub-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }

  .fsub-item-main {
    flex: 1 1 100%;
  }

  .fsub-item-actions {
    flex: 1 1 100%;
    gap: 8px;
  }

  .fsub-freq-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fsub-freq-wrap {
    width: 100%;
  }

  .fsub-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fsub-open {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ---------- temni nacin teme ---------- */

html[data-theme="dark"] .fsub-btn,
html[data-theme="dark"] .fsub-btn-mobile,
html[data-theme="dark"] .fsub-btn-small,
html[data-theme="dark"] .fsub-freq-wrap {
  background: var(--fd-surface-2, #1e1e1e);
  border-color: var(--fd-border, #444);
  color: var(--fd-text, #eee);
}

html[data-theme="dark"] .fsub-select {
  color: var(--fd-text, #eee);
}

html[data-theme="dark"] .fsub-filters {
  background: var(--fd-surface-2, #1e1e1e);
  border-color: var(--fd-border, #444);
  color: var(--fd-text-muted, #aaa);
}

html[data-theme="dark"] .fsub-filters:hover,
html[data-theme="dark"] .fsub-filters:focus {
  color: var(--fd-text, #eee);
}

html[data-theme="dark"] .fsub-tip,
html[data-theme="dark"] .fsub-tip::before {
  background: #2a2a2a;
}

html[data-theme="dark"] .fsub-btn.fsub-remove,
html[data-theme="dark"] .fsub-btn-mobile.fsub-remove {
  background: rgba(192, 57, 43, .18);
  border-color: #7a3a33;
  color: #f1a49a;
}

html[data-theme="dark"] .fsub-btn.fsub-remove:hover,
html[data-theme="dark"] .fsub-btn-mobile.fsub-remove:hover,
html[data-theme="dark"] .fsub-delete:hover {
  background: rgba(192, 57, 43, .3);
  border-color: #a04a40;
}

html[data-theme="dark"] .fsub-btn.fsub-saved {
  background: rgba(0, 128, 96, .18);
  border-color: #2f8a67;
  color: #8fd3b6;
}

html[data-theme="dark"] .fsub-item,
html[data-theme="dark"] .fsub-empty {
  background: var(--fd-surface, #181818);
  border-color: var(--fd-border, #444);
}

html[data-theme="dark"] .fsub-item-name {
  color: var(--fd-text, #eee);
}

html[data-theme="dark"] .fsub-intro,
html[data-theme="dark"] .fsub-item-meta,
html[data-theme="dark"] .fsub-head-count,
html[data-theme="dark"] .fsub-empty {
  color: var(--fd-text-muted, #aaa);
}

html[data-theme="dark"] .fsub-mobile-row {
  border-top-color: var(--fd-border, #444);
}
