/**
 * Content Workflow Enhancement Styles
 * Provides styling for content management workflow features
 * ADMIN ONLY - These styles only apply to authenticated admin users in admin contexts
 */

/* Admin Access Restriction - Only apply styles to admin contexts */
.admin-workflow-page,
.admin-workflow-form,
.admin-workflow-node {
  /* Base admin workflow container */
}

/* Hide workflow features from non-admin contexts */
body:not(.admin-workflow-page) .workflow-status,
body:not(.admin-workflow-page) .editorial-calendar,
body:not(.admin-workflow-page) .content-review,
body:not(.admin-workflow-page) .workflow-notifications {
  display: none !important;
}

/* ==========================================================================
   Workflow Status Indicators - ADMIN ONLY
   ========================================================================== */

.workflow-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  border: 2px solid;
  transition: all 0.3s ease;
}

.workflow-status-draft {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.workflow-status-review {
  background: #cce5ff;
  color: #004085;
  border-color: #80bdff;
}

.workflow-status-published {
  background: #d1edff;
  color: #0c5aa6;
  border-color: #b3d9ff;
}

.workflow-status-scheduled {
  background: #e2e3e5;
  color: #383d41;
  border-color: #c6c8ca;
}

.status-icon {
  font-size: 1rem;
}

.workflow-transition {
  margin-left: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 15px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.workflow-transition:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   Editorial Calendar
   ========================================================================== */

.editorial-calendar {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-nav button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.calendar-nav button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.calendar-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-controls .btn-group .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.calendar-controls .btn-group .btn.active,
.calendar-controls .btn-group .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.calendar-grid {
  padding: 1.5rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.calendar-day {
  background: #f8f9fa;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
}

.calendar-day.header {
  background: #e9ecef;
  color: #6c757d;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day.today {
  background: #0d6efd;
  color: white;
}

.calendar-day.other-month {
  color: #adb5bd;
  background: #f1f3f4;
}

.calendar-events {
  min-height: 200px;
}

.calendar-event {
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.calendar-event:hover {
  background: #cce5ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-event.high-priority {
  background: #f8d7da;
  border-color: #f1aeb5;
}

.calendar-event.medium-priority {
  background: #fff3cd;
  border-color: #ffeaa7;
}

.calendar-event-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.calendar-event-time {
  font-size: 0.8125rem;
  color: #6c757d;
}

/* ==========================================================================
   Content Review System
   ========================================================================== */

.content-review-form {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.review-checklist {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.review-checklist h4 {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-checklist h4::before {
  content: '\f0ae';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: #0d6efd;
}

.checklist-items {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.checklist-item:hover {
  background: #f1f3f4;
  border-color: #0d6efd;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked + .checkmark::after {
  opacity: 1;
}

.checkmark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  background: white;
  transition: all 0.3s ease;
}

.checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #28a745;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.checklist-item input[type="checkbox"]:checked ~ .checkmark {
  border-color: #28a745;
  background: #f8fff9;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checklist-progress .progress {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.checklist-progress .progress-bar {
  background: linear-gradient(90deg, #28a745, #20c997);
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
  white-space: nowrap;
}

/* Review Comments */
.review-comments {
  border-top: 1px solid #e9ecef;
  padding-top: 2rem;
  margin-top: 2rem;
}

.review-comments h4 {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-comments h4::before {
  content: '\f075';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: #0d6efd;
}

.comments-list {
  margin-bottom: 1.5rem;
}

.comment-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 600;
  color: #333;
}

.comment-date {
  font-size: 0.8125rem;
  color: #6c757d;
}

.comment-content {
  color: #495057;
  line-height: 1.5;
}

.comment-suggestion {
  background: #fff3cd;
  border-color: #ffeaa7;
}

.comment-suggestion::before {
  content: '\f0eb';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #856404;
}

.add-comment {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
}

.add-comment textarea {
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.add-comment textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}

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

.comment-actions .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* ==========================================================================
   Content Templates
   ========================================================================== */

.content-template-selector {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.template-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.template-card:hover {
  background: #e9ecef;
  border-color: #0d6efd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
  background: #e7f3ff;
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.template-icon {
  width: 48px;
  height: 48px;
  background: #0d6efd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.5rem;
}

.template-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.template-description {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.template-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #6c757d;
}

.template-type {
  background: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.template-preview {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.template-card:hover .template-preview {
  opacity: 1;
}

/* ==========================================================================
   Content Analytics
   ========================================================================== */

.content-analytics {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 2rem;
}

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

.analytics-title {
  margin: 0;
  color: #333;
  font-weight: 600;
}

.analytics-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.analytics-filters select {
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.analytics-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0d6efd;
  line-height: 1;
  margin-bottom: 0.5rem;
}

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

.analytics-change {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.analytics-change.positive {
  color: #28a745;
}

.analytics-change.negative {
  color: #dc3545;
}

.analytics-chart {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.workflow-notifications-badge {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
}

.notification-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  min-width: 300px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .calendar-nav {
    justify-content: center;
  }
  
  .calendar-controls {
    justify-content: center;
  }
  
  .calendar-days {
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.75rem;
  }
  
  .template-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .analytics-filters {
    justify-content: center;
  }
  
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .checklist-items {
    gap: 0.75rem;
  }
  
  .checklist-item {
    padding: 0.5rem;
  }
  
  .comment-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .workflow-status {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .calendar-days {
    font-size: 0.6875rem;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-number {
    font-size: 2rem;
  }
  
  .checklist-progress {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .workflow-transition,
  .calendar-controls,
  .template-preview,
  .comment-actions,
  .analytics-filters {
    display: none;
  }
  
  .content-review-form,
  .content-analytics,
  .editorial-calendar {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .calendar-header {
    background: #f8f9fa;
    color: #333;
  }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .content-review-form,
  .content-analytics,
  .editorial-calendar,
  .content-template-selector {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .review-checklist,
  .template-card,
  .analytics-card {
    background: #4a5568;
    border-color: #718096;
  }
  
  .checklist-item {
    background: #2d3748;
    border-color: #4a5568;
  }
  
  .checklist-item:hover {
    background: #4a5568;
  }
  
  .calendar-day {
    background: #4a5568;
    color: #e2e8f0;
  }
  
  .calendar-day.header {
    background: #718096;
    color: #cbd5e0;
  }
  
  .comment-item,
  .add-comment {
    background: #4a5568;
    border-color: #718096;
  }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators */
.workflow-transition:focus,
.template-card:focus,
.calendar-event:focus,
.checklist-item:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .workflow-status,
  .template-card,
  .analytics-card,
  .checklist-item {
    border-width: 2px;
  }
  
  .workflow-transition,
  .btn {
    border-width: 2px;
    font-weight: 600;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .workflow-status,
  .template-card,
  .calendar-event,
  .checklist-item,
  .workflow-transition,
  .progress-bar {
    transition: none;
  }
  
  .template-card:hover,
  .workflow-transition:hover {
    transform: none;
  }
}