/**
 * ProRank Design System - AI Content Generation Feature Styles
 * 
 * Styles specific to AI content generation, templates, and credit system.
 * Revolutionary 2025 UI components for AI-powered features.
 * 
 * @module features/ai-content
 * @since 3.0.0
 */

/* ============================================
   AI TOOLS PAGE LAYOUT
   Specific styles for AI Tools admin page
   ============================================ */

/* AI Tools page specific styles - header fix now handled globally in _layout.css */

.prorank-ai-tools-page .prorank-module-control {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--prorank-shadow-sm);
}

.prorank-ai-tools-page .prorank-module-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prorank-ai-tools-page .prorank-module-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--prorank-primary) 0%, var(--prorank-accent) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.prorank-ai-tools-page .prorank-module-info h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--prorank-text);
}

.prorank-ai-tools-page .prorank-module-info p {
  margin: 0;
  font-size: 14px;
  color: var(--prorank-text-secondary);
}

.prorank-ai-tools-page .prorank-settings-content {
  background: white;
  border-radius: var(--prorank-radius);
  padding: 24px;
  box-shadow: var(--prorank-shadow-sm);
}

.prorank-ai-tools-page .prorank-module-locked {
  background: white;
  border-radius: var(--prorank-radius);
  padding: 24px;
  box-shadow: var(--prorank-shadow-sm);
}

/* ============================================
   CREDIT SYSTEM
   AI credits and usage display
   ============================================ */

.prorank-credit-bar {
  background: linear-gradient(135deg, var(--prorank-bg-secondary) 0%, var(--prorank-bg-tertiary) 100%);
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--prorank-shadow-sm);
}

.prorank-credit-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.prorank-credit-label {
  font-weight: 600;
  color: var(--prorank-text-secondary);
}

.prorank-credit-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--prorank-primary);
}

.prorank-credit-estimate {
  color: var(--prorank-text-tertiary);
  font-size: 14px;
  font-style: italic;
}

/* ============================================
   REASONING PROCESS
   AI reasoning display
   ============================================ */

.prorank-reasoning-process {
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border: 2px solid var(--prorank-primary);
  border-radius: var(--prorank-radius);
  padding: 20px;
  margin-bottom: 25px;
  animation: fadeIn 0.3s ease-in;
}

/* ============================================
   TEMPLATE SYSTEM
   AI content templates
   ============================================ */

.prorank-seo-template-categories {
  background: white;
  border-radius: var(--prorank-radius);
  box-shadow: var(--prorank-shadow);
  overflow: hidden;
}

.prorank-seo-template-categories .components-card__header {
  background: var(--prorank-gradient);
  color: white;
  padding: 20px 24px;
  border-bottom: none;
}

.prorank-seo-template-categories .components-card__header h3 {
  color: white;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.prorank-template-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.template-category-btn {
  background: white;
  border: 2px solid var(--prorank-border);
  border-radius: var(--prorank-radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.template-category-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--prorank-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.template-category-btn:hover::before {
  opacity: 1;
}

.template-category-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--prorank-shadow-lg);
  border-color: var(--prorank-primary);
}

.template-category-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

.template-category-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--prorank-text);
  margin-bottom: 4px;
}

.template-count {
  font-size: 12px;
  color: var(--prorank-text-secondary);
}

/* ============================================
   AI GENERATOR INTERFACE
   Main AI generation UI
   ============================================ */

.prorank-ai-generator {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.prorank-ai-generator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--prorank-border-light);
}

.prorank-ai-generator-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--prorank-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.prorank-ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--prorank-bg-secondary);
  border-radius: 20px;
  font-size: 13px;
}

.prorank-ai-status--generating {
  background: rgba(37, 99, 235, 0.1);
  color: var(--prorank-primary);
}

.prorank-ai-status--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--prorank-success);
}

.prorank-ai-status--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--prorank-error);
}

/* ============================================
   AI MODELS SELECTOR
   Model selection interface
   ============================================ */

.prorank-ai-models {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.prorank-ai-model-card {
  padding: 16px;
  border: 2px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.prorank-ai-model-card:hover {
  border-color: var(--prorank-primary);
  background: var(--prorank-bg-secondary);
}

.prorank-ai-model-card.selected {
  border-color: var(--prorank-primary);
  background: rgba(37, 99, 235, 0.05);
}

.prorank-ai-model-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--prorank-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.prorank-ai-model-name {
  font-weight: 600;
  color: var(--prorank-text);
  margin-bottom: 4px;
}

.prorank-ai-model-desc {
  font-size: 12px;
  color: var(--prorank-text-secondary);
}

.prorank-ai-model-badge {
  display: inline-block;
  padding: 2px 6px;
  background: var(--prorank-gradient-accent);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 8px;
}

/* ============================================
   GENERATION PROGRESS
   AI generation progress indicators
   ============================================ */

.prorank-ai-progress {
  background: var(--prorank-bg-secondary);
  border-radius: var(--prorank-radius-sm);
  padding: 20px;
  margin: 20px 0;
}

.prorank-ai-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.prorank-ai-progress-title {
  font-weight: 600;
  color: var(--prorank-text);
}

.prorank-ai-progress-percentage {
  font-weight: 600;
  color: var(--prorank-primary);
}

.prorank-ai-progress-bar {
  height: 8px;
  background: var(--prorank-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.prorank-ai-progress-fill {
  height: 100%;
  background: var(--prorank-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.prorank-ai-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progressShine 2s linear infinite;
}

.prorank-ai-progress-steps {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.prorank-ai-step {
  flex: 1;
  padding: 8px;
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  color: var(--prorank-text-secondary);
  transition: all 0.3s;
}

.prorank-ai-step.active {
  background: var(--prorank-primary);
  color: white;
  border-color: var(--prorank-primary);
}

.prorank-ai-step.completed {
  background: var(--prorank-success);
  color: white;
  border-color: var(--prorank-success);
}

/* ============================================
   CONTENT OUTPUT
   Generated content display
   ============================================ */

.prorank-ai-output {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 20px;
  margin-top: 20px;
}

.prorank-ai-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--prorank-border-light);
}

.prorank-ai-output-title {
  font-weight: 600;
  color: var(--prorank-text);
}

.prorank-ai-output-actions {
  display: flex;
  gap: 8px;
}

.prorank-ai-output-content {
  line-height: 1.6;
  color: var(--prorank-text);
}

.prorank-ai-output-content h1,
.prorank-ai-output-content h2,
.prorank-ai-output-content h3 {
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--prorank-text);
}

.prorank-ai-output-content ul,
.prorank-ai-output-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.prorank-ai-output-content blockquote {
  border-left: 4px solid var(--prorank-primary);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--prorank-text-secondary);
}

/* ============================================
   CONTENT LIBRARY
   Saved AI content management
   ============================================ */

.prorank-content-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.prorank-content-card {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.prorank-content-card:hover {
  box-shadow: var(--prorank-shadow);
  transform: translateY(-2px);
}

.prorank-content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.prorank-content-card-title {
  font-weight: 600;
  color: var(--prorank-text);
  margin: 0;
  flex: 1;
}

.prorank-content-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--prorank-text-tertiary);
  margin-bottom: 8px;
}

.prorank-content-card-excerpt {
  font-size: 14px;
  color: var(--prorank-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prorank-content-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.prorank-content-tag {
  padding: 2px 8px;
  background: var(--prorank-bg-secondary);
  border-radius: 12px;
  font-size: 11px;
  color: var(--prorank-text-secondary);
}

/* ============================================
   BULK GENERATION
   Bulk content generation interface
   ============================================ */

.prorank-bulk-generator {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius);
  padding: 24px;
}

.prorank-bulk-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.prorank-bulk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--prorank-bg-secondary);
  border-radius: var(--prorank-radius-sm);
  border: 1px solid var(--prorank-border);
}

.prorank-bulk-item-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prorank-bulk-item-status--pending {
  background: var(--prorank-bg-tertiary);
  color: var(--prorank-text-tertiary);
}

.prorank-bulk-item-status--processing {
  background: rgba(37, 99, 235, 0.1);
  color: var(--prorank-primary);
  animation: pulse 2s infinite;
}

.prorank-bulk-item-status--completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--prorank-success);
}

.prorank-bulk-item-status--failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--prorank-error);
}

.prorank-bulk-item-info {
  flex: 1;
}

.prorank-bulk-item-title {
  font-weight: 500;
  color: var(--prorank-text);
  margin-bottom: 2px;
}

.prorank-bulk-item-meta {
  font-size: 12px;
  color: var(--prorank-text-secondary);
}

/* ============================================
   RESPONSIVE DESIGN
   Mobile adjustments for AI features
   ============================================ */

@media (max-width: 768px) {
  .prorank-ai-models {
    grid-template-columns: 1fr;
  }
  
  .prorank-template-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .prorank-content-library-grid {
    grid-template-columns: 1fr;
  }
  
  .prorank-credit-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .prorank-ai-progress-steps {
    flex-direction: column;
  }
}
