/* ==========================================================================
   Favorites page styles
   ========================================================================== */

/* ===== Reorder hint ===== */
.favorite-reorder-hint {
  width: 22px;
  height: 22px;

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

  padding: 0;
  margin: 0;
  line-height: 1;

  position: absolute;
  top: 9px;
  left: 7px;
  z-index: 6;

  pointer-events: none;
}

.favorite-reorder-hint i {
  font-size: 1.3rem;
  line-height: 1;
}

/* pokud nemas globalne */
.text-shadow {
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}

.sortable-ghost { opacity: .35; }

.sortable-chosen {
  transform: none !important;
  outline: 2px solid rgba(0,0,0,.08);
  outline-offset: 5px;
}

/* ===== Removing animation ===== */
.favorite-card-removing {
  opacity: 0;
  transform: translateY(0) scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ===== Favorite toggle checkbox ===== */
.favorite-checkbox {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 6px;

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

  padding: 0;
  margin: 0;
  line-height: 1;

  outline: none;
  box-shadow: none;
  cursor: pointer;
}

.favorite-checkbox i {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
  pointer-events: none;
}

.favorite-checkbox.is-active i { display: block; }
.favorite-open.favorite-checkbox i { display: none; }
.favorite-open.favorite-checkbox.is-active i { display: block; }

.favorite-checkbox:hover {
  background: rgba(255, 255, 255, 0.92);
}

/* ===== Photo arrows overlay (favorites page) ===== */
.projects-photo-picker {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

/* sjednoceni looku se "favorite-checkbox" */
.projects-photo-arrow {
  pointer-events: auto;

  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 22px;
  height: 22px;

  box-shadow: none;
  transition: background .15s ease, opacity .15s ease;

  opacity: 0.95;
}

.projects-photo-arrow i {
  font-size: 1.6rem;
  line-height: 1;
  pointer-events: none;
}

.projects-photo-arrow:hover {
  opacity: 1;
}

.projects-photo-arrow:active {
  transform: translateY(-50%) scale(0.98);
}

/* ===== Manual card: trash button (bila se stinem jako reorder hint) ===== */
.projects-manual-remove {
  width: 22px;
  height: 22px;

  position: absolute;
  top: 9px;
  right: 7px;

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

  padding: 0;
  margin: 0;

  border: 0 !important;
  background: transparent !important;

  color: #fff !important;
  opacity: 0.98;

  cursor: pointer;

  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.projects-manual-remove i {
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
}

.projects-manual-remove:hover { opacity: 1; }
.projects-manual-remove:focus,
.projects-manual-remove:active {
  outline: none !important;
  box-shadow: none !important;
}

/* ===== Manual card: odstranit zaobleni rohu ===== */
.projects-manual-card .profile-image-wrapper,
.projects-manual-card .projects-manual-image {
  border-radius: 0 !important;
}

.projects-manual-card img.profile-image,
.projects-manual-card .projects-manual-photo {
  border-radius: 0 !important;
}

/* ==========================================================================
   Favorites actions (top buttons)
   - mobile: 2 radky (3 + 2), ikona nad textem
   - desktop: VSECHNA tlacitka v JEDNOM radku, centrovana
   ========================================================================== */

.projects-actions {
  width: 100%;
}

.projects-actions .projects-action {
  color: #004759 !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

.projects-actions .projects-action:hover,
.projects-actions .projects-action:focus {
  color: var(--bs-primary) !important;
}

.projects-actions .projects-action:focus,
.projects-actions .projects-action:focus-visible,
.projects-actions .projects-action:active {
  outline: none !important;
  box-shadow: none !important;
}

/* share wrapper (span) se chova jako tlacitko area */
.projects-actions .projects-action--share {
  display: inline-flex;
  align-items: center;
}

/* ===== Desktop / tablet ===== */
@media (min-width: 768px) {

  /* jeden radek */
  .projects-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
  }

  /* ZPLOSTENI obou "radku" */
  .projects-actions-row {
    display: contents;
  }

  .projects-actions .projects-action,
  .projects-actions .projects-action--share > button {
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
  }

  .projects-actions .projects-action i,
  .projects-actions .projects-action--share > button i {
    line-height: 1;
  }

  .projects-actions .projects-action-label,
  .projects-actions .profile-action-label {
    margin-top: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: nowrap;
  }
}

/* ===== Mobile ===== */
@media (max-width: 767.98px) {

  .projects-actions {
    display: block;
    width: 100%;
  }

  .projects-actions-row--top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .projects-actions-row--bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;

    width: calc(100% * 2 / 3);
    margin-left: auto;
    margin-right: auto;
  }

  /* prebiti p-2 ps-3 z markupu */
  .projects-actions .projects-action,
  .projects-actions .projects-action--share > button {
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;

    padding: 10px 0 !important;
    margin: 0 !important;

    font-size: inherit !important;
    line-height: inherit !important;
  }

  .projects-actions .projects-action--share {
    width: 100%;
    padding: 0 !important;
    justify-content: center;
  }

  .projects-actions .projects-action i,
  .projects-actions .projects-action--share > button i {
    line-height: 1;
  }

  .projects-actions .projects-action-label,
  .projects-actions .profile-action-label {
    margin-top: 6px !important;
    font-size: .75rem !important;
    line-height: 1.1 !important;
    white-space: nowrap;
  }

  .projects-actions .btn-link {
    font-size: inherit !important;
    line-height: inherit !important;
  }
}

#favoritesAddModal #favoritesCreateProjectBtn,
#favoritesAddModal .favoritesCreateRoleBtnInProject {
  color: #004759 !important;
  box-shadow: none !important;
}

#favoritesAddModal #favoritesCreateProjectBtn:hover,
#favoritesAddModal #favoritesCreateProjectBtn:focus,
#favoritesAddModal .favoritesCreateRoleBtnInProject:hover,
#favoritesAddModal .favoritesCreateRoleBtnInProject:focus {
  color: var(--bs-primary) !important;
}

#favoritesAddModal #favoritesCreateProjectBtn:focus,
#favoritesAddModal #favoritesCreateProjectBtn:focus-visible,
#favoritesAddModal #favoritesCreateProjectBtn:active,
#favoritesAddModal .favoritesCreateRoleBtnInProject:focus,
#favoritesAddModal .favoritesCreateRoleBtnInProject:focus-visible,
#favoritesAddModal .favoritesCreateRoleBtnInProject:active {
  outline: none !important;
  box-shadow: none !important;
}

#favoritesAddModal .projects-project-roles-list .projects-role-label {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* ==========================================================================
   Favorites v2
   ========================================================================== */

.projects-card {
  position: relative;
}

.projects-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
}

.projects-create-card {
  transition: 0.2s;
}

.projects-create-card:hover {
  transform: none;
}

.projects-plus {
  line-height: 1;
  font-size: 128px;
}

.projects-empty {
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: #fff;
}

.projects-create-card .profile-card {
  cursor: pointer;
}

.projects-mosaic {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 1px;
  background: #fff;
}

.projects-mosaic-item,
.projects-mosaic img,
.projects-mosaic-placeholder {
  width: 100%;
  height: 100%;
}

.projects-mosaic img,
.projects-mosaic-placeholder {
  object-fit: cover;
}

.projects-mosaic--count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.projects-mosaic--count-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.projects-mosaic--count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.projects-mosaic--count-3 .projects-mosaic-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.projects-mosaic--count-3 .projects-mosaic-item:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.projects-mosaic--count-3 .projects-mosaic-item:nth-child(3) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.projects-mosaic--count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.projects-mosaic img {
  background: transparent;
  display: block;
}

.projects-mosaic-placeholder {
  background: var(--bs-light);
}

@media (max-width: 767.98px) {
  .projects-project-meta,
  .projects-role-meta {
    display: none;
  }
}

.fav-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fav-card-action-btn,
.fav-card-actions .favorite-reorder-hint {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  transition: 0.2s;
  padding: 0;
  margin: 0;
  flex: 0 0 34px;
}

.fav-card-action-btn:hover,
.fav-card-actions .favorite-reorder-hint:hover {
  background: #fff;
  transform: scale(1.05);
}

.fav-card-action-btn--danger {
  color: #a11a1a;
}

.fav-card-action-btn--active {
  background: rgba(0, 71, 89, 0.95);
  color: #fff;
}

.fav-card-action-btn--active:hover {
  background: #004759;
  color: #fff;
}

.fav-card-actions .favorite-reorder-hint {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  pointer-events: auto;
  cursor: grab;
}

.fav-card-actions .favorite-reorder-hint:active {
  cursor: grabbing;
}

.fav-card-actions .favorite-reorder-hint i,
.fav-card-action-btn i {
  font-size: 14px;
  line-height: 1;
}

.fav-card-actions .favorite-reorder-hint[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  white-space: nowrap;
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  padding: 7px 9px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.fav-card-actions .favorite-reorder-hint[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.projects-role-item-card {
  position: relative;
}

.projects-role-item-card > .fav-card-actions {
  right: 22px;
}

.projects-role-item-note {
  min-height: 2.8em;
  line-height: 1.35;
}

.projects-role-item-note-btn {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.projects-role-item-note-btn:hover,
.projects-role-item-note-btn:focus {
  color: #004759 !important;
  outline: none;
}

.projects-manual-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 10;
  width: 22px;
  height: 22px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
  font-size: 18px;
  line-height: 1;
}

.projects-manual-badge[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  white-space: nowrap;
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  padding: 7px 9px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.projects-manual-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.fav-role-hero-cover {
  width: 100%;
  aspect-ratio: 3 / 1;
  background: #f3f3f3;
  border-radius: 20px;
  overflow: hidden;
}

.fav-mosaic--hero {
  grid-template-columns: repeat(3, 1fr);
  height: 100%;
}

.profile-card-wrap {
  min-width: 0;
}

@media (max-width: 767.98px) {
  .projects-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .projects-toolbar > div {
    display: flex !important;
    align-items: center;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .projects-toolbar .projects-action,
  .projects-toolbar .projects-action--share {
    display: inline-flex !important;
    width: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .projects-toolbar .projects-action--share > button {
    display: inline-flex !important;
    width: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .projects-toolbar .projects-action,
  .projects-toolbar .projects-action--share > button {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 6px !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  .projects-toolbar .projects-action-label,
  .projects-toolbar .profile-action-label {
    display: none !important;
  }

  .projects-toolbar .projects-action i,
  .projects-toolbar .projects-action--share > button i {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }
}
