/* ============================================================
   COMPONENTS — cards, filters, carousel, sidebar, modal
   ============================================================ */

/* ── Sort / Filters container ── */
.sort-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  row-gap: 20px;
  padding: 24px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  justify-content: center;
}

.column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 220px;
  flex: 1 1 200px;
}

.column label {
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ── Search input ── */
.search-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

input[type="search"] {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card-inner);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

#clearSearch {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: none;
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
}

#clearSearch:hover {
  color: var(--accent);
}

/* ── Range slider ── */
.range-wrapper {
  position: relative;
  width: 100%;
  height: 30px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.range-slider {
  position: absolute;
  width: 100%;
  height: 4px;
  background: var(--border-strong);
  border-radius: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.range-track {
  position: absolute;
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  z-index: 2;
}

.range-input {
  position: absolute;
  width: 100%;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  margin: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 10;
}

.range-input::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border: none;
  background: transparent;
}

.decorative-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(229, 9, 20, 0.35);
}

/* ── Gender switch ── */
.gender-switch {
  display: flex;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
}

.gender-switch input[type="radio"] {
  display: none;
}

.gender-switch label {
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0 !important;
  flex: 1;
  text-align: center;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.gender-switch label:hover {
  color: var(--text-primary);
}

.gender-switch input[type="radio"]:checked+label {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(229, 9, 20, 0.3);
}

/* ── Sort select ── */
#sortSelect {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card-inner);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}

#sortSelect:focus {
  border-color: var(--accent);
}

/* ── Fav toggle button ── */
.fav-toggle-btn {
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: inherit;
}

.fav-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fav-toggle-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── User / Actor grid ── */
.user-container {
  max-width: 1280px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.user-container a {
  color: inherit !important;
  text-decoration: none !important;
}

.user {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  max-width: 220px;
  width: 100%;
  background: var(--bg-card-inner);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.user:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.user-photo {
  margin-bottom: 12px;
}

.user-photo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
}

.user-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.user-age {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ── Star rating ── */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 4px;
  margin: 8px 0;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 22px;
  color: var(--border-strong);
  cursor: pointer;
  transition: color 0.2s;
}

.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
  color: #fbbf24;
}

/* ── Fav button (on cards) ── */
.fav-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  line-height: 1;
  margin-top: 4px;
  opacity: 0.4;
}

.fav-btn.active {
  opacity: 1;
}

.fav-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* ── Carousel ── */
.carousel-wrapper {
  width: 100%;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.carousel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
  text-align: left;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-md);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  padding: 0 6px;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .carousel-slide {
    flex: 0 0 33.333%;
  }
}

.carousel-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.carousel-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
}

.carousel-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.carousel-card:hover .carousel-card-img-wrap img {
  transform: scale(1.05);
}

.carousel-card-img-wrap .fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  margin-top: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0;
  z-index: 2;
}

/* Info below image */
.carousel-card-info {
  padding: 12px 14px 14px;
}

.carousel-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.carousel-card-orig {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.carousel-card-rating-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.carousel-btn {
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.carousel-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.08);
}

.carousel-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  cursor: pointer;
  transition: all var(--transition);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

/* ── Sidebar ── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-widget-body {
  padding: 16px;
}

/* Actor of day */
.actor-day-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.actor-day-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--accent);
}

.actor-day-name {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.actor-day-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.actor-day-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.actor-day-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  opacity: 1;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  text-align: center;
}

.modal-content .close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition);
}

.modal-content .close:hover {
  color: var(--accent);
}

.modal-content img {
  border-radius: var(--radius-md);
  margin: 12px auto;
  display: block;
}

.modal-more-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.modal-more-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* --- БЛОК ІНТЕРАКТИВНИХ КНОПОК --- */
.content-interactive-actions {
  display: flex;
  gap: 16px;
  margin: 10px auto;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

.content-interactive-actions button {
  /*flex: 1;*/
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-share {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.btn-share:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-report {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-report:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: translateY(-2px);
}

/* --- МОДАЛЬНЕ ВІКНО --- */
.app-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.app-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.app-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.app-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.app-modal-close:hover {
  color: var(--text-primary);
}

.app-form-group {
  margin-bottom: 18px;
}

.app-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.app-form-group input,
.app-form-group textarea {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}

.app-form-group input:focus,
.app-form-group textarea:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
  background: var(--bg-card);
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.app-modal-footer button {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-cancel:hover {
  background: var(--bg-card-inner);
  color: var(--text-primary);
}

.btn-submit {
  background: var(--accent, #3b82f6);
  border: none;
  color: #ffffff;
}

.btn-submit:hover {
  filter: brightness(1.15);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Спливаюче вікно TOAST --- */
.app-toast {
  visibility: hidden;
  min-width: 280px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  border-radius: 10px;
  padding: 16px 20px;
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.5));
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 40px;
}

@media (max-width: 600px) {
  .content-interactive-actions {
    flex-direction: column;
    gap: 12px;
  }

  .app-modal-footer {
    flex-direction: column-reverse;
  }

  .app-modal-footer button {
    width: 100%;
  }
}
/* ============================================================
   UNIFIED RESULT BUTTONS
   ============================================================ */
.btn-result-primary,
.btn-result-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 36px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.1rem;
    text-decoration: none;
    text-align: center;
    margin: 10px 5px;
    box-sizing: border-box;
}

.btn-result-primary {
    background: var(--accent-color, #fbbf24);
    color: #000;
    border: none;
}
.btn-result-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-result-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    border: 2px solid rgb(101 69 69 / 44%);
}
.btn-result-secondary:hover {
    border-color: var(--accent-color, #fbbf24); 
    background: rgba(251,191,36,0.08);
    transform: translateY(-2px);
}

body:not(.dark-mode) .btn-result-secondary {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}
body:not(.dark-mode) .btn-result-secondary:hover {
    border-color: var(--accent-color, #fbbf24); 
    background: rgba(251,191,36,0.15);
}

@media (max-width: 600px) {
    .btn-result-primary,
    .btn-result-secondary {
        height: 42px;
        padding: 0 20px;
        font-size: 1rem;
    }
}
