/* BalkanBox Content Requests — matches Moje linije dashboard */

.bbx-cr-wrap {
  --bbx-cr-accent: var(--bde-button-primary-background-color, #e6004a);
  --bbx-cr-dark: #202427;
  --bbx-cr-success: #059669;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards must not stretch to fill parent (fixes huge empty form card) */
.bbx-cr-wrap .bbx-card {
  height: auto !important;
  flex: 0 0 auto;
  align-self: stretch;
  padding: 20px 22px !important;
  margin: 0 !important;
}

/* Sidebar: "Novo" bubble */
.woocommerce-MyAccount-navigation-link--zahtevi.bbx-cr-nav-item a,
.woocommerce-MyAccount-navigation-link--zahtevi a {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.woocommerce-MyAccount-navigation-link--zahtevi.bbx-cr-nav-item a::after,
.woocommerce-MyAccount-navigation-link--zahtevi a::after {
  content: 'Novo';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  background: var(--bbx-cr-accent, #e6004a);
  color: #fff;
  box-shadow: 0 2px 6px rgba(230, 0, 74, 0.35);
}

.woocommerce-MyAccount-navigation-link--zahtevi.is-active a::after {
  background: #fff;
  color: var(--bbx-cr-accent, #e6004a);
}

/* Hero — compact gradient bar */
.bbx-cr-hero {
  border: none !important;
  border-radius: 16px !important;
  padding: 18px 22px !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #e6004a 0%, #202427 100%) !important;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.bbx-cr-hero-content {
  flex: 1;
  min-width: 200px;
}

.bbx-cr-hero-pill {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  backdrop-filter: blur(10px);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px !important;
}

.bbx-cr-hero-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff !important;
}

.bbx-cr-hero-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
}

.bbx-cr-quota-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  min-width: 120px;
}

.bbx-cr-quota-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 2px;
}

.bbx-cr-quota-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.bbx-cr-quota-value span {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.75;
}

.bbx-cr-alert {
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}

/* Intro block above form */
.bbx-cr-intro-block {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 0;
}

.bbx-cr-intro-block p {
  margin: 0;
}

.bbx-cr-divider {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 18px 0;
}

.bbx-cr-section-sub {
  margin: 0;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Card sections */
.bbx-cr-form-card,
.bbx-cr-history-card {
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  transition: box-shadow 0.2s ease;
}

.bbx-cr-form-card:hover,
.bbx-cr-history-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.bbx-cr-card-head {
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: 0;
}

.bbx-cr-card-head--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--gray-100);
}

.bbx-cr-section-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
}

.bbx-cr-history-count {
  background: #fdf2f6 !important;
  color: var(--bbx-cr-accent, #e6004a) !important;
  font-size: 12px !important;
  padding: 5px 11px !important;
  border-radius: 999px !important;
  flex-shrink: 0;
}

/* Form steps — tight, consistent rhythm */
.bbx-cr-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bbx-cr-step {
  margin-bottom: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.bbx-cr-step:first-child {
  padding-top: 0;
}

.bbx-cr-step-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bbx-cr-type-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bbx-cr-type-btn {
  appearance: none;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-700);
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bbx-cr-type-btn:hover {
  border-color: var(--bbx-cr-accent);
  color: var(--bbx-cr-accent);
}

.bbx-cr-type-btn.is-active {
  border-color: var(--bbx-cr-accent);
  background: var(--bbx-cr-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230, 0, 74, 0.2);
}

/* Inputs */
.bbx-cr-search-wrap {
  position: relative;
  max-width: 100%;
}

.bbx-cr-search-input,
.bbx-cr-input,
.bbx-cr-select {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--gray-50);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

.bbx-cr-message-wrap {
  position: relative;
  max-width: 520px;
}

.bbx-cr-message-input {
  padding-right: 58px;
}

.bbx-cr-char-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--gray-600);
  pointer-events: none;
}

.bbx-cr-search-input:focus,
.bbx-cr-input:focus,
.bbx-cr-select:focus {
  outline: none;
  border-color: var(--bbx-cr-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(230, 0, 74, 0.1);
}

.bbx-cr-search-results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  max-height: 320px;
  overflow-y: auto;
}

.bbx-cr-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--gray-100);
  background: #fff;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}

.bbx-cr-result-item:last-child {
  border-bottom: 0;
}

.bbx-cr-result-item:hover,
.bbx-cr-result-item:focus {
  background: #fdf2f6;
  outline: none;
}

.bbx-cr-result-item.is-in-library {
  cursor: default;
}

.bbx-cr-result-item.is-in-library:hover,
.bbx-cr-result-item.is-in-library:focus {
  background: #fff;
}

.bbx-cr-result-item.is-in-library:active {
  background: #f0fdf4;
}

.bbx-cr-result-poster {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--gray-100);
  flex-shrink: 0;
  cursor: zoom-in;
}

.bbx-cr-poster-preview {
  position: fixed;
  z-index: 999998;
  width: 140px;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fff;
  background: var(--gray-100);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: bbx-cr-poster-preview-in 0.15s ease-out;
}

.bbx-cr-poster-preview[hidden] {
  display: none !important;
}

.bbx-cr-poster-preview img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

@keyframes bbx-cr-poster-preview-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.bbx-cr-result-body {
  flex: 1;
  min-width: 0;
}

.bbx-cr-result-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bbx-cr-result-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  color: var(--gray-900);
}

.bbx-cr-result-original {
  font-size: 12px;
  color: var(--gray-600);
  font-style: italic;
}

.bbx-cr-result-sub {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 600;
}

.bbx-cr-result-overview {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bbx-cr-result-popularity {
  font-size: 11px;
  color: var(--bbx-cr-accent, #e6004a);
  font-weight: 700;
}

.bbx-cr-result-library {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--bbx-cr-success, #059669);
}

.bbx-cr-selected-popularity .bbx-cr-result-library {
  margin-top: 4px;
}

.bbx-cr-result-empty {
  padding: 14px;
  color: var(--gray-600);
  font-size: 13px;
  text-align: center;
}

/* Selected preview */
.bbx-cr-selected {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(230, 0, 74, 0.15);
  border-radius: 12px;
  background: #fffafb;
}

.bbx-cr-selected-poster {
  width: 64px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--gray-100);
  flex-shrink: 0;
}

.bbx-cr-selected-info {
  flex: 1;
  min-width: 0;
}

.bbx-cr-selected-type {
  margin-bottom: 6px;
  background: #fdf2f6 !important;
  color: var(--bbx-cr-accent, #e6004a) !important;
}

.bbx-cr-selected-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-900);
}

.bbx-cr-selected-meta {
  display: block;
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.bbx-cr-selected-overview {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}

.bbx-cr-selected-popularity {
  display: block;
  font-size: 12px;
  color: var(--bbx-cr-accent, #e6004a);
  font-weight: 700;
}

.bbx-cr-change-selection {
  align-self: center;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Channel fields */
.bbx-cr-channel-fields .bbx-cr-step-label {
  margin-bottom: 10px;
}

.bbx-cr-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bbx-cr-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  line-height: 1.3;
  margin: 0;
}

.bbx-cr-channel-grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 16px;
  max-width: 560px;
}

.bbx-cr-channel-grid .bbx-cr-select,
.bbx-cr-channel-grid .bbx-cr-input {
  width: 100%;
  min-height: 42px;
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--gray-900);
}

/* Centered overlay toast — above search dropdown and all page content */
.bbx-cr-toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.42);
}

.bbx-cr-toast-overlay[hidden] {
  display: none !important;
}

.bbx-cr-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  margin: 0;
  padding: 16px 44px 16px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
  animation: bbx-cr-toast-in 0.22s ease-out;
}

@keyframes bbx-cr-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bbx-cr-toast.is-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.bbx-cr-toast.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.bbx-cr-toast-text {
  flex: 1;
  min-width: 0;
}

.bbx-cr-toast-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  font: inherit;
}

.bbx-cr-toast-close:hover,
.bbx-cr-toast-close:focus {
  background: rgba(0, 0, 0, 0.12);
  outline: none;
  transform: translateY(-50%);
}

.bbx-cr-toast-close-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bbx-cr-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  flex-shrink: 0;
}

.bbx-cr-toast.is-success .bbx-cr-toast-icon {
  background: #059669;
  color: #fff;
}

.bbx-cr-toast.is-error .bbx-cr-toast-icon {
  background: #dc2626;
  color: #fff;
}

/* Submit row — sits flush at bottom of form */
.bbx-cr-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0 0;
  margin: 0;
}

.bbx-cr-submit-btn {
  background: var(--bbx-cr-success) !important;
  border-color: var(--bbx-cr-success) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 10px 22px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
}

.bbx-cr-submit-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.bbx-cr-submit-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.bbx-cr-form-message {
  font-size: 14px;
  font-weight: 500;
}

.bbx-cr-form-message.is-success {
  color: var(--bbx-success, #10b981);
}

.bbx-cr-form-message.is-error {
  color: var(--bbx-danger, #dc2626);
}

/* History */
.bbx-cr-history-empty {
  text-align: center;
  padding: 28px 20px;
  border: 2px dashed var(--gray-200);
  border-radius: 12px;
  background: var(--gray-50);
}

.bbx-cr-history-empty-icon {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.bbx-cr-history-empty strong {
  display: block;
  font-size: 15px;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.bbx-cr-history-empty p {
  margin: 0 auto;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.55;
  max-width: 400px;
}

.bbx-cr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
}

.bbx-cr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.bbx-cr-table th,
.bbx-cr-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: middle;
}

.bbx-cr-table tbody tr:last-child td {
  border-bottom: 0;
}

.bbx-cr-table tbody tr:hover {
  background: var(--gray-50);
}

.bbx-cr-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  background: var(--gray-50);
  font-weight: 600;
}

.bbx-cr-history-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bbx-cr-history-poster {
  width: 34px;
  height: 51px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--gray-100);
}

.bbx-cr-status-pending { background: #fef3c7; color: #92400e; }
.bbx-cr-status-in_progress { background: #dbeafe; color: #1e40af; }
.bbx-cr-status-added { background: #d1fae5; color: #065f46; }
.bbx-cr-status-declined { background: #fee2e2; color: #991b1b; }

.bbx-cr-decline-reason {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
}

.bbx-cr-message-preview {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  cursor: help;
  color: var(--gray-700);
}

.bbx-cr-notice {
  padding: 20px;
  border-radius: 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

.bbx-cr-form-message {
  display: none !important;
}

@media (max-width: 768px) {
  .bbx-cr-wrap .bbx-card {
    padding: 16px !important;
  }

  .bbx-cr-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px !important;
  }

  .bbx-cr-hero-title {
    font-size: 1.15rem;
  }

  .bbx-cr-hero-aside {
    margin-left: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .bbx-cr-quota-card {
    flex: 1;
    min-width: 110px;
  }

  .bbx-cr-type-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .bbx-cr-type-btn {
    padding: 9px 10px;
    font-size: 13px;
    text-align: center;
  }

  .bbx-cr-channel-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .bbx-cr-message-wrap {
    max-width: none;
  }

  .bbx-cr-selected {
    flex-direction: column;
  }

  .bbx-cr-change-selection {
    align-self: stretch;
    width: 100%;
    text-align: center;
  }

  .bbx-cr-submit-row {
    padding-top: 8px;
  }

  .bbx-cr-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .bbx-cr-table-wrap {
    border: 0;
    overflow: visible;
  }

  .bbx-cr-table thead {
    display: none;
  }

  .bbx-cr-table tbody {
    display: block;
  }

  .bbx-cr-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  .bbx-cr-table td {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px 12px;
    align-items: start;
    border: 0;
    padding: 8px 0;
  }

  .bbx-cr-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
    padding-top: 2px;
  }

  .bbx-cr-table td[data-label="Sadržaj"] .bbx-cr-history-title {
    flex-wrap: wrap;
  }

  .bbx-cr-message-preview {
    max-width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .bbx-cr-card-head--row {
    flex-direction: column;
    align-items: flex-start;
  }
}
