/* @TASK P2-S0-T1 - Blog AI Styles */
/* @SPEC Blog AI Dashboard - Complete UI styling */

/* ===== AI Theme Colors ===== */
:root {
  --blog-ai: #8B5CF6;
  --blog-ai-light: #A78BFA;
  --blog-ai-dark: #7C3AED;
  --blog-streaming: #06B6D4;
  --blog-streaming-light: #22D3EE;
}

/* ===== Page Header ===== */
.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-header-actions {
  display: flex;
  gap: 12px;
}

/* ===== Blog Cards ===== */
.blog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.blog-card {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.blog-card:hover {
  border-color: var(--blog-ai);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

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

.blog-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.4;
}

.blog-card-prompt {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-500);
}

/* ===== Status Badges ===== */
.blog-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.blog-status-badge.draft {
  background: #F3F4F6;
  color: #6B7280;
}

.blog-status-badge.generating {
  background: #FEF3C7;
  color: #92400E;
  animation: pulse 2s infinite;
}

.blog-status-badge.completed {
  background: #D1FAE5;
  color: #065F46;
}

.blog-status-badge.published {
  background: #DBEAFE;
  color: #1E40AF;
}

.blog-status-badge.pending,
.blog-status-badge.prompting {
  background: #E0F2FE;
  color: #075985;
}

.blog-status-badge.failed {
  background: #FEE2E2;
  color: #991B1B;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Blog Editor ===== */
.blog-editor {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.blog-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.blog-editor-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  border: none;
  outline: none;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.blog-editor-title:focus,
.blog-editor-title[contenteditable]:focus {
  background: var(--gray-100);
}

.blog-editor-content {
  min-height: 400px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--gray-700);
  border: none;
  outline: none;
  padding: 16px;
  border-radius: 8px;
  transition: background 0.2s;
  /* 스트리밍 중 textContent 의 \n·공백, simple_format 결과 <p><br> 모두 보존 */
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.blog-editor-content p {
  margin: 0 0 1em 0;
}

.blog-editor-content p:last-child {
  margin-bottom: 0;
}

.blog-editor-content:focus,
.blog-editor-content[contenteditable]:focus {
  background: var(--gray-100);
}

.blog-editor-status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.blog-editor-status.info {
  background: #DBEAFE;
  color: #1E40AF;
}

.blog-editor-status.success {
  background: #D1FAE5;
  color: #065F46;
}

.blog-editor-status.error {
  background: #FEE2E2;
  color: #991B1B;
}

/* ===== AI Chat Panel ===== */
.ai-chat-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  z-index: 1000;
}

.ai-chat-panel.open {
  right: 0;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--blog-ai) 0%, var(--blog-ai-light) 100%);
}

.ai-chat-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== Chat Messages ===== */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-chat-message {
  display: flex;
  gap: 12px;
  align-items: start;
}

.ai-chat-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ai-chat-message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--blog-ai) 0%, var(--blog-ai-light) 100%);
}

.message-content {
  flex: 1;
  max-width: 280px;
}

.message-text {
  background: var(--gray-100);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
}

.ai-chat-message.user .message-text {
  background: var(--blog-ai);
  color: white;
}

.ai-chat-message.assistant .message-text {
  background: var(--gray-100);
}

.message-time {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
  padding: 0 16px;
}

.ai-chat-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.empty-hint {
  font-size: 12px;
  margin-top: 8px;
}

/* ===== Chat Input ===== */
.ai-chat-input-wrapper {
  border-top: 1px solid var(--gray-200);
  padding: 16px;
  background: white;
}

.ai-chat-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--blog-ai);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ai-chat-actions {
  display: flex;
  justify-content: flex-end;
}

/* ===== Streaming Cursor ===== */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--blog-streaming);
  margin-left: 2px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.streaming-text {
  position: relative;
  display: inline;
}

/* ===== Status Indicator ===== */
.ai-chat-status {
  padding: 12px 16px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--blog-ai);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

/* ===== File Upload ===== */
.file-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--gray-100);
}

.file-dropzone:hover {
  border-color: var(--blog-ai);
  background: #F5F3FF;
}

.file-dropzone.dragover {
  border-color: var(--blog-ai);
  background: #F5F3FF;
  border-width: 3px;
}

.file-dropzone-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.file-dropzone-text {
  font-size: 16px;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.file-dropzone-hint {
  font-size: 12px;
  color: var(--gray-500);
}

/* ===== File Preview ===== */
.file-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
}

.file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.file-size {
  font-size: 12px;
  color: var(--gray-500);
}

.file-remove {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 24px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.file-remove:hover {
  background: var(--gray-100);
  color: var(--danger);
}

/* ===== Blog Search ===== */
.blog-search {
  position: relative;
  margin-bottom: 24px;
}

.blog-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 16px;
}

.blog-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--gray-500);
}

/* ===== Pagination ===== */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.blog-pagination a,
.blog-pagination span {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.2s;
}

.blog-pagination a:hover {
  border-color: var(--blog-ai);
  background: #F5F3FF;
}

.blog-pagination .current {
  background: var(--blog-ai);
  color: white;
  border-color: var(--blog-ai);
}

/* ===== Empty State ===== */
.blog-empty-state {
  text-align: center;
  padding: 64px 24px;
  background: white;
  border-radius: 12px;
}

.blog-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.blog-empty-text {
  font-size: 18px;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.blog-empty-hint {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ===== Prompt Form ===== */
.blog-prompt-form {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-prompt-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 16px;
  resize: vertical;
  font-family: inherit;
}

.blog-prompt-textarea:focus {
  outline: none;
  border-color: var(--blog-ai);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ===== Tone & Length Selectors ===== */
.blog-tone-selector,
.blog-length-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.blog-tone-option,
.blog-length-option {
  flex: 1;
}

.blog-tone-option input[type="radio"],
.blog-length-option input[type="radio"] {
  display: none;
}

.blog-tone-label,
.blog-length-label {
  display: block;
  padding: 12px 16px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.blog-tone-option input[type="radio"]:checked + .blog-tone-label,
.blog-length-option input[type="radio"]:checked + .blog-length-label {
  border-color: var(--blog-ai);
  background: #F5F3FF;
  color: var(--blog-ai);
}

.blog-tone-label:hover,
.blog-length-label:hover {
  border-color: var(--blog-ai-light);
}

/* ===== Blog Video Generation ===== */
.blog-video-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  margin-bottom: 28px;
}

.blog-video-command-main,
.blog-video-command-side,
.blog-video-player-panel,
.blog-video-summary,
.blog-video-detail-panel {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.blog-video-command-main {
  padding: 28px;
}

.blog-video-command-main h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
}

.blog-video-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0E7490;
  background: #ECFEFF;
  border: 1px solid #A5F3FC;
  border-radius: 9999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.blog-video-form {
  display: grid;
  gap: 16px;
}

.blog-video-field {
  display: grid;
  gap: 8px;
}

.blog-video-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

.blog-video-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: white;
  color: var(--gray-900);
  font-size: 15px;
  font-family: inherit;
}

.blog-video-select:focus {
  outline: none;
  border-color: var(--blog-ai);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.blog-video-settings {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-video-settings span,
.blog-video-keywords span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 9999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 700;
}

.blog-video-submit {
  justify-self: start;
}

.blog-video-empty-inline {
  padding: 16px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  color: var(--gray-500);
  background: var(--gray-100);
}

.blog-video-command-side {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.blog-video-stat {
  display: grid;
  gap: 6px;
  padding: 22px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.blog-video-stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}

.blog-video-stat strong {
  font-size: 16px;
  color: var(--gray-900);
}

.blog-video-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 16px;
}

.blog-video-section-header h2 {
  font-size: 18px;
  color: var(--gray-900);
}

.blog-video-section-header span {
  color: var(--gray-500);
  font-size: 14px;
}

.blog-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.blog-video-card {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.blog-video-card:hover {
  border-color: #0E7490;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.blog-video-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-video-thumb {
  aspect-ratio: 16 / 9;
  background: #0F172A;
  overflow: hidden;
}

.blog-video-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.blog-video-thumb-state {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

.blog-video-thumb-state.prompting,
.blog-video-thumb-state.generating {
  background: linear-gradient(135deg, #164E63 0%, #7C3AED 100%);
}

.blog-video-thumb-state.completed {
  background: linear-gradient(135deg, #065F46 0%, #0E7490 100%);
}

.blog-video-thumb-state.failed {
  background: linear-gradient(135deg, #7F1D1D 0%, #991B1B 100%);
}

.blog-video-card-body {
  padding: 18px;
}

.blog-video-card-date {
  color: var(--gray-500);
  font-size: 12px;
}

.blog-video-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--gray-500);
  font-size: 12px;
}

.blog-video-show-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  margin-bottom: 24px;
}

.blog-video-player-panel {
  padding: 18px;
}

.blog-video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 8px;
  background: #020617;
}

.blog-video-player-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--gray-500);
  font-size: 13px;
}

.blog-video-summary {
  padding: 18px;
  align-self: start;
}

.blog-video-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  font-size: 14px;
}

.blog-video-summary-row:last-child {
  border-bottom: 0;
}

.blog-video-summary-row span {
  color: var(--gray-500);
}

.blog-video-summary-row strong {
  color: var(--gray-900);
  text-align: right;
}

.blog-video-state {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  border-radius: 8px;
  background: #F8FAFC;
  color: var(--gray-700);
  padding: 32px;
}

.blog-video-state.failed {
  background: #FEF2F2;
  color: #991B1B;
}

.blog-video-state p {
  color: var(--gray-500);
  max-width: 520px;
  line-height: 1.6;
}

.blog-video-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #BAE6FD;
  border-top-color: #0E7490;
  animation: blogVideoSpin 1s linear infinite;
}

@keyframes blogVideoSpin {
  to { transform: rotate(360deg); }
}

.blog-video-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.blog-video-detail-panel {
  padding: 22px;
}

.blog-video-detail-panel.wide {
  grid-column: 1 / -1;
}

.blog-video-detail-panel h2 {
  font-size: 16px;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.blog-video-detail-panel p {
  color: var(--gray-700);
  line-height: 1.7;
}

.blog-video-detail-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--gray-700);
  background: #F8FAFC;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.blog-video-keywords {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-video-muted {
  color: var(--gray-500);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .ai-chat-panel {
    width: 100%;
    right: -100%;
  }

  .blog-cards {
    grid-template-columns: 1fr;
  }

  .blog-editor {
    padding: 16px;
  }

  .blog-editor-title {
    font-size: 24px;
  }

  .blog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .blog-header-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .blog-tone-selector,
  .blog-length-selector {
    flex-direction: column;
  }

  .blog-video-command,
  .blog-video-show-layout,
  .blog-video-detail-grid {
    grid-template-columns: 1fr;
  }

  .blog-video-command-main {
    padding: 20px;
  }

  .blog-video-submit {
    width: 100%;
    justify-content: center;
  }
}

/* === SEO Panel === */
.blog-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.blog-detail-sidebar {
  position: sticky;
  top: 24px;
}

.seo-panel-inner {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--gray-300);
}

.seo-panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--gray-900);
}

/* Score Circle */
.seo-score-circle {
  text-align: center;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.seo-score-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.seo-score-number.score-high { color: #22c55e; }
.seo-score-number.score-mid { color: #f59e0b; }
.seo-score-number.score-low { color: #ef4444; }

.seo-score-total {
  font-size: 18px;
  font-weight: 400;
  color: var(--gray-500);
}

.seo-score-grade {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Category */
.seo-category {
  margin-bottom: 16px;
}

.seo-category-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

/* Item */
.seo-item {
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.seo-item.success { background: #f0fdf4; }
.seo-item.warning { background: #fffbeb; }
.seo-item.error { background: #fef2f2; }

.seo-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.seo-item-name {
  font-weight: 600;
  color: var(--gray-900);
}

.seo-item-score {
  font-weight: 700;
  font-size: 12px;
}

.seo-item.success .seo-item-score { color: #22c55e; }
.seo-item.warning .seo-item-score { color: #f59e0b; }
.seo-item.error .seo-item-score { color: #ef4444; }

.seo-item-feedback {
  color: var(--gray-600, #4b5563);
  font-size: 12px;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.seo-optimize-btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
}

.btn-xs {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.seo-optimize-all {
  width: 100%;
  margin-top: 12px;
}

.seo-reanalyze {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
}

.seo-analyzed-at {
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 8px;
  margin-bottom: 0;
}

.seo-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--gray-500);
}

.seo-error {
  text-align: center;
  padding: 24px 0;
  color: var(--danger);
}

.seo-inline-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
}

/* Modal */
.seo-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}

.seo-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.seo-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin: 16px 0;
  align-items: start;
}

.seo-comparison-before,
.seo-comparison-after {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  word-break: break-all;
}

.seo-comparison-before {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.seo-comparison-after {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.seo-comparison-arrow {
  display: flex;
  align-items: center;
  font-size: 24px;
  color: var(--gray-500);
}

.seo-reasoning {
  font-size: 13px;
  color: var(--gray-600, #4b5563);
  line-height: 1.5;
  margin-bottom: 16px;
}

.seo-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Responsive - SEO Panel */
@media (max-width: 1024px) {
  .blog-detail-layout {
    grid-template-columns: 1fr;
  }
  .blog-detail-sidebar {
    position: static;
  }
}

/* ===== Image Lightbox ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(0px);
}

.lightbox-overlay.visible {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
  backdrop-filter: blur(4px);
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  max-width: 80vw;
  word-break: break-word;
}

.generated-image-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.generated-image-card:hover {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
}

.generated-image-card img {
  cursor: pointer;
}

/* ===== Responsive Lightbox ===== */
@media (max-width: 768px) {
  .lightbox-close {
    top: -40px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .lightbox-image {
    max-height: 70vh;
  }

  .lightbox-caption {
    max-width: 100%;
  }
}
