/* Incoming Posts Styles */

/* Breadcrumbs in Incoming Posts */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: #0088cc;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: #006699;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #d1d5db;
  margin: 0 0.25rem;
}

.breadcrumb-current {
  color: #6b7280;
  font-weight: 500;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  flex: 1;
  min-width: 0;
}

.page-header-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Actions Bar */
.actions-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.actions-bar .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
  font-size: 1rem;
  flex: 0 1 auto;
  min-width: auto;
  width: auto;
  text-align: center;
  white-space: nowrap;
}

.actions-bar .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .actions-bar {
    flex-direction: column;
    gap: 0.75rem;
  }

  .actions-bar .btn {
    width: 100%;
  }
}

/* Incoming Post Summary */

.incoming-post-summary {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .incoming-post-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.summary-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-media {
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.summary-media .media-container-compact {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
}

.summary-media .media-photo-compact {
  background: transparent;
}

.summary-media .media-image-compact {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

.summary-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.summary-content {
  flex: 1;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  line-height: 1.6;
  color: #374151;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  min-height: 200px;
}

/* Info Grid - единый стиль для всех информационных блоков */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 0.875rem;
  color: #1f2937;
  font-weight: 500;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Filters Bar */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: #4b5563;
}

.filter-link {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.filter-link:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.filter-link.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Badge Variants */

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Alert Box */

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.alert-warning {
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert strong {
  font-weight: 600;
}

/* Posts Grid Layout - использует стили из posts.css */

/* Media Indicators */
.media-indicator {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.media-indicator:hover {
  opacity: 1;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.bg-success {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.bg-danger {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
}

.bg-info {
  background-color: #dbeafe !important;
  color: #1e40af !important;
}

.bg-secondary {
  background-color: #f3f4f6 !important;
  color: #6b7280 !important;
}

/* Media in post cards */

.post-card .post-media-preview {
  margin-bottom: 1rem;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
}

.post-card .media-container-compact {
  width: 100%;
  max-height: 250px;
  border-radius: 8px;
}

.post-card .media-image-compact {
  max-height: 250px;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}



/* Post Details */

.post-details {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1f2937;
}

.detail-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  color: #374151;
}

.detail-section h3:first-child {
  margin-top: 0;
}

/* Table Container */

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.data-table thead {
  background: #f9fafb;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
  color: #4b5563;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: #f9fafb;
}

.table-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.table-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.detail-value {
  font-size: 1rem;
  color: #1f2937;
}

.content-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.content-box pre {
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
}

/* Media Preview Styles */

.post-media-preview {
  margin-bottom: 1.5rem;
}

/* Compact Media Preview for Index */

.post-media-preview {
  margin-bottom: 1rem;
  width: 100%;
  display: block;
}

.post-media-preview-compact {
  margin-bottom: 1rem;
  width: 100%;
  display: block;
}

.media-container-compact {
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  width: 100%;
  display: block;
}

/* Compact Photo */

.media-photo-compact {
  background: #fff;
  width: 100%;
  display: block;
}

.media-image-compact {
  width: 100%;
  height: auto;
  display: block;
  max-height: 250px;
  object-fit: contain;
  border-radius: 6px;
}

/* Compact Telegram Link */

.media-telegram-compact {
  background: #f9fafb;
}

.telegram-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.telegram-post-link:hover .telegram-preview {
  background: #eff6ff;
  border-color: #3b82f6;
}

.telegram-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.5rem;
  transition: all 0.2s;
  border: 2px solid transparent;
  border-radius: 6px;
}

.telegram-icon {
  font-size: 2.5rem;
  opacity: 0.7;
}

.telegram-label {
  font-size: 0.875rem;
  color: #3b82f6;
  font-weight: 600;
}

.telegram-hint {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Compact Video/Document/Unknown Placeholders */

.media-video-compact,
.media-document-compact,
.media-unknown-compact {
  background: #f9fafb;
}

.video-placeholder,
.document-placeholder,
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.5rem;
}

.video-icon,
.document-icon,
.media-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.video-label,
.document-label,
.media-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.media-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.media-type-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
}

.media-type-badge .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.625rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bg-primary {
  background-color: #3b82f6 !important;
  color: white !important;
}

.bg-warning {
  background-color: #f59e0b !important;
  color: white !important;
}

/* Photo Media */

.media-photo {
  max-width: 100%;
}

.media-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 600px;
  object-fit: contain;
}

/* Telegram Widget */

.media-telegram {
  max-width: 100%;
  background: white;
  padding: 1rem;
}

.telegram-widget-container {
  margin-bottom: 1rem;
}

.telegram-fallback {
  text-align: center;
  padding: 1rem;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0088cc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.telegram-link:hover {
  background: #006699;
  color: white;
}

/* Video Media */

.media-video {
  max-width: 100%;
}

.media-video-player {
  width: 100%;
  max-height: 600px;
  display: block;
  background: #000;
}

/* Document Media */

.media-document {
  padding: 2rem;
  background: white;
}

.media-document-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.media-document-icon {
  font-size: 3rem;
  opacity: 0.7;
}

.media-document-info {
  flex: 1;
}

.media-document-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.media-document-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 1rem;
  word-break: break-all;
}

.media-document-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

/* Unknown Media */

.media-unknown {
  padding: 2rem;
  background: white;
}

.media-unknown-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.media-unknown-icon {
  font-size: 3rem;
  opacity: 0.7;
}

.media-unknown-info {
  flex: 1;
}

.media-unknown-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.media-unknown-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 1rem;
}

.media-unknown-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

/* Empty State */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state p {
  margin: 0.5rem 0;
  font-size: 1.125rem;
}

.empty-state-hint {
  font-size: 0.875rem !important;
  color: #9ca3af;
}

/* Pagination */

.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Button Sizes */

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* AI Agent Actions Tabs */

.tabs-container {
  margin-top: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 0;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  padding: 0;
  margin: 0;
}

.tab-button {
  flex: 1;
  min-width: 150px;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  text-align: center;
}

.tab-button:hover {
  color: #374151;
  background-color: #f3f4f6;
}

.tab-button.active {
  color: #2563eb;
  background: white;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: white;
}

.tab-content {
  display: none !important;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.tab-content.active {
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Action Results */

.action-result {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-comment {
  padding: 0.75rem;
  background-color: #f9fafb;
  border-left: 3px solid #2563eb;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.action-error {
  padding: 0.75rem;
  background-color: #fef2f2;
  border-left: 3px solid #ef4444;
  color: #991b1b;
  font-size: 0.875rem;
}

.action-details {
  margin-top: 0.5rem;
}

.action-details summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 0.875rem;
  user-select: none;
}

.action-details summary:hover {
  text-decoration: underline;
}

.action-content {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  max-height: 300px;
  overflow-y: auto;
}
