/* Publication Cards - Modern Design */

/* ===== Card Container ===== */
.publication-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.publication-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.publication-card.card-removed {
  opacity: 0.6;
}

/* ===== Image Container ===== */
.card-image-container {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.card-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.publication-card:hover .card-image-container img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 100%);
  display: flex;
  justify-content: flex-end;
}

.removed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(220, 53, 69, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.removed-overlay i {
  font-size: 2.5rem;
  color: #fff;
  opacity: 0.8;
}

/* ===== Status Badges ===== */
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.status-draft {
  background: rgba(0, 123, 255, 0.9);
  color: #fff;
}

.status-pending {
  background: rgba(255, 193, 7, 0.9);
  color: #000;
}

.status-scheduled {
  background: rgba(255, 159, 67, 0.9);
  color: #fff;
}

.status-processing {
  background: rgba(115, 103, 240, 0.9);
  color: #fff;
}

.status-published {
  background: rgba(40, 199, 111, 0.9);
  color: #fff;
}

.status-failed {
  background: rgba(234, 84, 85, 0.9);
  color: #fff;
}

.status-removal {
  background: rgba(255, 159, 67, 0.9);
  color: #fff;
}

.status-removed {
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
}

.status-expired {
  background: rgba(108, 117, 125, 0.9);
  color: #fff;
}

/* ===== Card Content ===== */
.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* ===== Header Row with Social Icons ===== */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.social-icons {
  display: flex;
  gap: 8px;
}

.social-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #f1f3f5;
  color: #adb5bd;
}

.social-icon.clickable {
  cursor: pointer;
}

.social-icon.clickable:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #697a8d;
  background: #e9ecef;
}

.category-tag {
  background: #f8f9fa;
  color: #6c757d;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* ===== Auction Info ===== */
.auction-info {
  margin-bottom: 10px;
}

.auction-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3436;
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.auction-details {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #868e96;
}

.detail-item i {
  font-size: 12px;
  color: #7367f0;
}

/* ===== Description ===== */
.description {
  font-size: 0.8rem;
  color: #495057;
  margin: 0 0 12px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* ===== Stats Row ===== */
.stats-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f1f3f5;
  border-bottom: 1px solid #f1f3f5;
  margin-bottom: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #495057;
  font-weight: 500;
}

.stat-item i {
  font-size: 14px;
  color: #7367f0;
}

.stat-item.date {
  margin-left: auto;
  color: #868e96;
}

.stat-item.date i {
  color: #868e96;
}

/* ===== Footer Row ===== */
.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.created-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #adb5bd;
}

.created-date i {
  font-size: 12px;
}

.btn-remove,
.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-action.remove-btn {
  background: #fff5f5;
  color: #ea5455;
}

.btn-action.info-btn {
  background: #eef2ff;
  color: #7367f0;
}

.btn-remove:hover,
.btn-action.remove-btn:hover {
  background: #ea5455;
  color: #fff;
  transform: scale(1.1);
}

.btn-action.info-btn:hover {
  background: #7367f0;
  color: #fff;
  transform: scale(1.1);
}

.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-remove i,
.btn-action i {
  font-size: 14px;
}

/* ===== Infinite Scroll Indicator ===== */
#scroll-sentinel {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ===== No Results ===== */
#noResults {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f8f9fa;
  border-radius: 12px;
}

#publicationsContainer {
  min-height: 200px;
  padding-top: 1rem;
}

/* ===== Search Input ===== */
.form-control:focus,
.form-select:focus {
  border-color: #7367f0;
  box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.15);
}

#publications-count {
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

/* ===== KPI Cards ===== */
.kpi-card {
  text-align: center;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-card .card-body {
  padding: 1rem;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.25rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #2d3436;
}

.kpi-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Dark mode KPI */
.dark-style .kpi-value {
  color: #d0d2d6;
}

.dark-style .kpi-label {
  color: #b4b7bd;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .publication-card {
    border-radius: 12px;
  }
  
  .card-image-container {
    height: 140px;
  }
  
  .card-content {
    padding: 12px;
  }
  
  .auction-title {
    font-size: 0.85rem;
  }
  
  .stats-row {
    gap: 8px;
  }
}

/* ===== Dark Mode Support ===== */
.dark-style .publication-card {
  background: #283046;
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-style .publication-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.dark-style .card-content {
  background: #283046;
}

.dark-style .auction-title {
  color: #d0d2d6;
}

.dark-style .description {
  color: #b4b7bd;
}

.dark-style .category-tag {
  background: #343d55;
  color: #b4b7bd;
}

.dark-style .social-icon {
  background: #343d55;
  color: #65677a;
}

.dark-style .social-icon.clickable:hover {
  background: #3b4461;
  color: #b4b7bd;
}

.dark-style .stats-row {
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-style .stat-item {
  color: #b4b7bd;
}

.dark-style .btn-remove,
.dark-style .btn-action.remove-btn {
  background: rgba(234, 84, 85, 0.12);
}

.dark-style .btn-action.info-btn {
  background: rgba(115, 103, 240, 0.12);
}

.dark-style #noResults {
  background: #283046;
}

/* ===== Scheduled Date Indicator ===== */
.footer-dates {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scheduled-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #ff9f43;
  font-weight: 500;
}

.scheduled-date i {
  font-size: 12px;
}

/* ===== Batch Lot Schedule ===== */
.batch-lot-schedule {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.batch-lot-schedule label {
  display: block;
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.batch-lot-schedule-input {
  font-size: 0.75rem;
}

/* ===== Publication Info Modal (PIM) ===== */
.pim-popup {
  border-radius: 12px !important;
  background: var(--bs-card-bg, var(--bs-body-bg)) !important;
  border: 1px solid var(--bs-border-color) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
  overflow: hidden;
}

.pim-popup .swal2-close {
  color: var(--bs-body-color) !important;
  top: 16px !important;
  right: 16px !important;
  font-size: 1.4rem !important;
  z-index: 10;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.pim-popup .swal2-close:hover {
  opacity: 1;
}

.pim-html-container {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.pim-modal {
  color: var(--bs-body-color);
}

/* ---- Hero Header ---- */
.pim-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--bs-border-color);
  gap: 16px;
  flex-wrap: wrap;
}

.pim-hero-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pim-status-lg {
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 6px;
  font-weight: 600;
  width: fit-content;
}

.pim-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.pim-hero-meta i {
  font-size: 14px;
}

.pim-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--bs-heading-color);
}

.pim-separator {
  color: var(--bs-border-color);
}

.pim-auctioneer {
  font-weight: 500;
}

.pim-hero-right {
  display: flex;
  gap: 8px;
}

.pim-auction-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 6px 16px;
  min-width: 68px;
}

.pim-auction-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--bs-secondary-color);
  font-weight: 600;
}

.pim-auction-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bs-heading-color);
  line-height: 1.3;
}

/* ---- ID Row ---- */
.pim-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 28px 0;
  padding: 6px 12px;
  background: var(--bs-body-bg);
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
}

.pim-id-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--bs-secondary-color);
  flex-shrink: 0;
}

.pim-id-value {
  font-size: 0.72rem;
  color: var(--bs-primary);
  background: rgba(115, 103, 240, 0.08);
  padding: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: all;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pim-id-value:hover {
  background: var(--bs-primary);
  color: #fff;
}

.pim-id-value.copied {
  background: var(--bs-success);
  color: #fff;
}

.pim-id-value.copied::after {
  content: ' ✓ copiado';
  font-size: 0.65rem;
}

.pim-id-copy {
  font-size: 14px;
  color: var(--bs-secondary-color);
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0;
}

.pim-id-copy:hover {
  color: var(--bs-primary);
}

/* ---- Tabs ---- */
.pim-tabs {
  display: flex;
  gap: 0;
  margin: 16px 28px 0;
  border-bottom: 2px solid var(--bs-border-color);
}

.pim-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.pim-tab i {
  font-size: 16px;
}

.pim-tab:hover {
  color: var(--bs-heading-color);
}

.pim-tab.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
}

/* ---- Tab Content ---- */
.pim-tab-content {
  display: none;
  padding: 20px 28px 28px;
}

.pim-tab-content.active {
  display: block;
  animation: pimFadeIn 0.2s ease;
}

@keyframes pimFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Metrics ---- */
.pim-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.pim-metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bs-body-bg);
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
  transition: box-shadow 0.2s;
}

.pim-metric-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pim-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pim-metric-icon i {
  font-size: 22px;
}

.pim-metric-data {
  display: flex;
  flex-direction: column;
}

.pim-metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bs-heading-color);
  line-height: 1.2;
}

.pim-metric-label {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ---- Details Grid (2 cols) ---- */
.pim-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ---- Sections ---- */
.pim-section {
  background: var(--bs-body-bg);
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
  padding: 18px;
  margin-bottom: 0;
}

.pim-tab-content > .pim-section:last-child {
  margin-bottom: 0;
}

.pim-tab-content > .pim-section {
  margin-bottom: 16px;
}

.pim-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--bs-secondary-color);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bs-border-color);
}

.pim-section-title i {
  font-size: 15px;
  color: var(--bs-primary);
}

/* ---- Info List (key-value rows) ---- */
.pim-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pim-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--bs-border-color);
}

.pim-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pim-info-row:first-child {
  padding-top: 0;
}

.pim-info-key {
  font-size: 0.76rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.pim-info-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-heading-color);
  text-align: right;
}

/* ---- User Card ---- */
.pim-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pim-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7367f0, #9e95f5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.pim-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.pim-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--bs-heading-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pim-user-email {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Platform Cards ---- */
.pim-platforms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pim-platform-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-card-bg, #fff);
  transition: box-shadow 0.2s;
}

.pim-platform-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pim-platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.pim-platform-card.platform-instagram .pim-platform-icon {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}

.pim-platform-card.platform-facebook .pim-platform-icon {
  background: #1877f2;
  color: #fff;
}

.pim-platform-card.platform-other .pim-platform-icon {
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.pim-platform-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pim-platform-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bs-heading-color);
}

.pim-platform-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  width: fit-content;
}

.pim-platform-status i {
  font-size: 13px;
}

.pim-platform-success {
  color: #28c76f;
}

.pim-platform-failed {
  color: #ea5455;
}

.pim-platform-pending {
  color: #ff9f43;
}

.pim-platform-date {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Empty State ---- */
.pim-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--bs-secondary-color);
}

.pim-empty-state i {
  font-size: 28px;
  opacity: 0.4;
}

.pim-empty-state span {
  font-size: 0.78rem;
}

/* ---- Timeline Container ---- */
.pim-timeline-container {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.pim-timeline-container::-webkit-scrollbar {
  width: 4px;
}

.pim-timeline-container::-webkit-scrollbar-track {
  background: transparent;
}

.pim-timeline-container::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 4px;
}

/* ===== Status Timeline ===== */
.status-timeline {
  position: relative;
  padding-left: 40px;
  list-style: none;
  margin: 0;
}

.status-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 11px;
  bottom: 11px;
  width: 2px;
  background: var(--bs-border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 22px;
  border: none !important;
}

.timeline-item-last {
  padding-bottom: 0;
}

.timeline-indicator {
  position: absolute;
  left: -40px;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.timeline-indicator i {
  font-size: 11px;
  color: #fff;
  line-height: 1;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bs-heading-color);
}

.timeline-date {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.timeline-note {
  font-size: 0.72rem;
  color: var(--bs-tertiary-color);
  font-style: italic;
}

.timeline-duration {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  margin-top: 2px;
}

.timeline-duration i {
  font-size: 12px;
  opacity: 0.6;
}

.timeline-total-duration {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 12px;
  background: rgba(115,103,240,0.08);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #7367f0;
}

.timeline-total-duration i {
  font-size: 14px;
}
