/* Telegram Channels Styling */

/* Channels Index Page */
.channels-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.channels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.channels-header h1 {
  margin: 0;
  color: #212529;
  font-size: 2rem;
}

.channels-header .btn-primary {
  background: #0088cc;
  color: white;
  border-color: #0088cc;
}

.channels-header .btn-primary:hover {
  background: #006da8;
  border-color: #006da8;
  color: white;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.demo-channels-section {
  margin-bottom: 3rem;
}

.demo-channels-section .section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.channel-card-item.demo-channel {
  border: 2px solid #17a2b8;
  position: relative;
}

.channel-card-item.demo-channel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #17a2b8, #138496);
}

.channel-card-item {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.channel-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.channel-card-item-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.channel-card-item-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  color: #212529;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.channel-status-badge {
  flex-shrink: 0;
}

.channel-card-item-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.channel-card-item-description {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-card-item-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.channel-meta-item {
  font-size: 0.875rem;
  color: #495057;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.channel-meta-item strong {
  color: #212529;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.channel-card-item-info {
  font-size: 0.875rem;
}

.channel-card-item-footer {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.channel-main-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
}

/* Кнопка Контент план на странице index */
.content-plan-btn-index {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.content-plan-btn-index:hover {
  background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
  color: white;
  transform: translateX(0) translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.content-plan-btn-index .badge {
  background: rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

.bg-light-purple {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.channel-action-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

/* Синий стиль для обычных кнопок действий (не контент-план) */
.channel-action-btn.btn-primary:not(.content-plan-btn-index) {
  background: #0088cc;
  color: white;
  border: none;
}

.channel-action-btn.btn-primary:not(.content-plan-btn-index):hover {
  background: #006da8;
  color: white;
}

.channel-action-btn:hover {
  transform: translateX(4px);
}

.channel-action-btn .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  margin-left: auto;
}

.btn-icon-emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.btn-text {
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}

.channel-secondary-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-icon {
  padding: 0.25rem 0.5rem;
  min-width: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .channels-grid {
    grid-template-columns: 1fr;
  }

  .channels-header {
    flex-direction: column;
    align-items: stretch;
  }

  .channel-card-item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .channel-header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .channel-action-btn {
    justify-content: center;
    gap: 0.5rem;
  }

  .btn-text {
    display: none;
  }

  .btn-icon-emoji {
    font-size: 1.5rem;
  }

  .channel-action-btn .badge {
    margin-left: 0;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    min-width: 20px;
  }

  .content-plan-btn-index {
    grid-column: 1 / -1;
  }

  .content-plan-btn-index .btn-text {
    display: inline;
  }
}

.channel-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.channel-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.channel-header {
  padding: 2rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.channel-title-block {
  flex: 1;
  min-width: 250px;
}

.channel-title-block h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: #212529;
}

.channel-title-block .channel-description {
  margin: 0;
  font-size: 1rem;
  color: #6c757d;
  line-height: 1.5;
}

.channel-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.channel-body {
  padding: 2rem;
}

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

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

.channel-section h3 {
  margin: 0 0 1rem 0;
  color: #495057;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.channel-settings-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
}

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

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

.channel-setting-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
}

.channel-setting-value {
  color: #212529;
}

.channel-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.channel-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.channel-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.recent-posts-section {
  margin-top: 2rem;
}

.recent-posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.channel-actions-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recent-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.recent-post-item:hover {
  border-color: #0088cc;
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.1);
}

.recent-post-content {
  flex: 1;
  min-width: 0;
}

.recent-post-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #212529;
}

.recent-post-title a {
  color: #212529;
  text-decoration: none;
}

.recent-post-title a:hover {
  color: #0088cc;
}

.recent-post-excerpt {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-post-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #6c757d;
}

.recent-post-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.channel-footer {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.channel-dates {
  font-size: 0.875rem;
  color: #6c757d;
}

.channel-dates strong {
  color: #495057;
}

.empty-posts-state {
  text-align: center;
  padding: 3rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

.empty-posts-state p {
  margin: 0 0 1rem 0;
  color: #6c757d;
}

/* Часовой пояс */
.channel-timezone-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
}

.channel-timezone-value {
  font-size: 1.1rem;
  color: #212529;
  font-weight: 600;
}

/* Статистика постов - компактный вид */
.channel-stats-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #495057;
  flex-wrap: wrap;
}

.stat-compact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-compact-item strong {
  color: #212529;
  font-weight: 600;
}

.stat-separator {
  color: #dee2e6;
  font-weight: 300;
}

/* Кнопка Контент план */
.channel-primary-action {
  margin-bottom: 1.5rem;
}

.btn-content-plan {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
  width: 100%;
  justify-content: center;
}

.btn-content-plan:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  color: white;
}

.content-plan-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.content-plan-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.content-plan-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.content-plan-count {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 500;
}

/* Сетка действий */
.channel-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.btn-action-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
}

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

/* Сетка действий на странице show */
.channel-show-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.channel-show-action-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
  font-size: 1rem;
}

/* Синий стиль для обычных кнопок действий (не контент-план) */
.channel-show-action-btn.btn-primary:not(.content-plan-btn) {
  background: #0088cc;
  color: white;
  border: none;
}

.channel-show-action-btn.btn-primary:not(.content-plan-btn):hover {
  background: #006da8;
  color: white;
}

.channel-show-action-btn:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}

.channel-show-action-btn .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  margin-left: auto;
}

.channel-show-action-btn .btn-icon-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.channel-show-action-btn .btn-text {
  font-size: 1rem;
  font-weight: 500;
  flex: 1;
}

/* Кнопка Контент план на странице show */
.content-plan-btn {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 1.1rem;
  padding: 1.25rem 1.5rem;
}

.content-plan-btn:hover {
  background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.content-plan-btn .btn-icon-emoji {
  font-size: 1.75rem;
}

.content-plan-btn .btn-text {
  font-weight: 600;
}

.content-plan-btn .badge {
  background: rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  min-width: 28px;
}

@media (max-width: 768px) {
  .channel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .channel-title-block {
    min-width: 100%;
  }

  .channel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .channel-settings-grid {
    grid-template-columns: 1fr;
  }

  .recent-post-item {
    flex-direction: column;
  }

  .recent-post-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .channel-stats-compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-separator {
    display: none;
  }

  .btn-content-plan {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .content-plan-icon {
    font-size: 2.5rem;
  }

  .content-plan-text {
    align-items: center;
    text-align: center;
  }

  .content-plan-title {
    font-size: 1.25rem;
  }

  .channel-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .channel-show-actions-grid {
    grid-template-columns: 1fr;
  }

  .content-plan-btn {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .channel-show-action-btn .btn-text {
    font-size: 0.9rem;
  }

  .channel-show-action-btn .btn-icon-emoji {
    font-size: 1.3rem;
  }

  .channel-show-action-btn {
    padding: 0.875rem 1rem;
  }

  .content-plan-btn .btn-icon-emoji {
    font-size: 1.5rem;
  }
}
