/* Blog Factory V4 Guide - Styles */

/* ==================== Base ==================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-track { background: #1e293b; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ==================== Sidebar ==================== */
#sidebar {
  transition: transform 0.3s ease-in-out;
  scrollbar-width: thin;
}

#main-content {
  transition: margin-left 0.3s ease-in-out;
}

@media (min-width: 1024px) {
  #sidebar { transform: translateX(0); }
  .main-content { margin-left: 280px; }
}

@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0 !important; }
}

#sidebar.sidebar-open {
  transform: translateX(0) !important;
}

/* ==================== Prose Content ==================== */
.prose-content {
  line-height: 1.85;
  color: #374151;
  font-size: 1.0625rem;
}

.dark .prose-content {
  color: #d1d5db;
}

.prose-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.dark .prose-content h3 {
  color: #f3f4f6;
  border-bottom-color: #374151;
}

.prose-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.dark .prose-content h4 {
  color: #e5e7eb;
}

.prose-content p {
  margin-bottom: 1rem;
}

.prose-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.prose-content li {
  margin-bottom: 0.5rem;
}

.prose-content strong {
  color: #111827;
  font-weight: 600;
}

.dark .prose-content strong {
  color: #f3f4f6;
}

/* ==================== Section Intro ==================== */
.section-intro {
  margin-bottom: 2rem;
}

.section-intro h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

.dark .section-intro h3 {
  color: #f3f4f6;
}

/* ==================== Callout Boxes ==================== */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin: 1.25rem 0;
  border: 1px solid;
}

.callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.6;
}

.callout p { margin-bottom: 0.25rem; }
.callout ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.callout li { margin-bottom: 0.25rem; font-size: 1rem; }

.callout-info {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #005038;
}
.dark .callout-info {
  background: rgba(0, 152, 103, 0.1);
  border-color: rgba(0, 152, 103, 0.3);
  color: #6ee7b7;
}

.callout-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.dark .callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* ==================== Info Tables ==================== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.dark .info-table {
  border-color: #374151;
}

.info-table th,
.info-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.dark .info-table th,
.dark .info-table td {
  border-bottom-color: #374151;
}

.info-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.dark .info-table th {
  background: #1e293b;
  color: #94a3b8;
}

.info-table td {
  background: #fff;
}

.dark .info-table td {
  background: #1f2937;
  color: #d1d5db;
}

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

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

.dark .info-table tr:hover td {
  background: #1e293b;
}

.info-table.compact th,
.info-table.compact td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* ==================== Steps Box ==================== */
.steps-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.dark .steps-box {
  background: #1f2937;
  border-color: #374151;
}

.steps-box h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  margin-top: 0;
}

.dark .steps-box h4 {
  color: #e5e7eb;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  font-size: 1rem;
}

.step + .step {
  border-top: 1px solid #f3f4f6;
}

.dark .step + .step {
  border-top-color: #374151;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #009867, #22c55e);
  color: #fff;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==================== Feature Box ==================== */
.feature-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.dark .feature-box {
  background: #1f2937;
  border-color: #374151;
}

.feature-box h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.dark .feature-box h4 {
  color: #e5e7eb;
}

.feature-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-box li {
  padding: 0.625rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: 1rem;
}

.feature-box li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #009867;
  font-weight: 700;
}

.feature-box li + li {
  border-top: 1px solid #f3f4f6;
}

.dark .feature-box li + li {
  border-top-color: #374151;
}

/* ==================== Image Source Cards ==================== */
.image-source-cards {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 768px) {
  .image-source-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.source-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s;
}

.dark .source-card {
  background: #1f2937;
  border-color: #374151;
}

.source-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #3b82f6;
}

.source-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid;
}

.source-header h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0;
}

.source-header.pixabay { border-color: #009867; color: #008059; }
.source-header.duckduckgo { border-color: #34d399; color: #008059; }
.source-header.local { border-color: #6ee7b7; color: #006847; }

.dark .source-header.pixabay { color: #34d399; }
.dark .source-header.duckduckgo { color: #6ee7b7; }
.dark .source-header.local { color: #a7f3d0; }

.source-card p {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.dark .source-card p {
  color: #9ca3af;
}

.hint {
  font-size: 0.8125rem;
  color: #008059;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.dark .hint {
  color: #34d399;
}

/* ==================== Tab Sections ==================== */
.tab-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.tab-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.dark .tab-section {
  background: #1f2937;
  border-color: #374151;
}

.tab-section h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1f2937;
}

.dark .tab-section h4 {
  color: #f3f4f6;
  border-bottom-color: #374151;
}

.tab-section ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 1rem 0 0;
}

.tab-section li {
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

/* ==================== Guide Screenshots ==================== */
.guide-image {
  display: block;
  max-width: 100%;
  margin: 1.25rem auto;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: zoom-in;
}

.guide-image:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: scale(1.01);
}

.dark .guide-image {
  border-color: #374151;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dark .guide-image:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Image caption */
.image-caption {
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.dark .image-caption {
  color: #9ca3af;
}

/* Image lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  padding: 2rem;
  animation: fadeIn 0.2s ease-out;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  object-fit: contain;
}

/* ==================== FAQ ==================== */
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary { list-style: none; }

/* ==================== Dark Mode ==================== */
.dark body {
  background: linear-gradient(to bottom, #0f172a, #1e293b);
}

.dark header {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(8px);
  border-color: #334155 !important;
}

.dark #sidebar {
  background: linear-gradient(to bottom, #1e293b, #0f172a) !important;
  border-color: #334155 !important;
}

.dark .bg-white { background: #1e293b !important; }
.dark .bg-gray-50 { background: #0f172a !important; }
.dark .bg-gray-100 { background: #1e293b !important; }
.dark .border-gray-200 { border-color: #334155 !important; }
.dark .border-gray-100 { border-color: #1e293b !important; }
.dark .text-gray-900 { color: #f1f5f9 !important; }
.dark .text-gray-700 { color: #e2e8f0 !important; }
.dark .text-gray-600 { color: #cbd5e1 !important; }
.dark .text-gray-500 { color: #94a3b8 !important; }

/* ==================== Responsive ==================== */
/* Source link cards for workflow */
.source-link-card {
  text-decoration: none !important;
}

.source-link-card:hover {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  main { padding: 0.75rem !important; }
  
  .prose-content { font-size: 1rem; }
  .prose-content h3 { font-size: 1.25rem; }
  .prose-content h4 { font-size: 1.0625rem; }
  
  .info-table { font-size: 0.9375rem; display: block; overflow-x: auto; }
  .info-table th, .info-table td { padding: 0.625rem 0.75rem; white-space: nowrap; }
  
  .image-source-cards { grid-template-columns: 1fr; }
  
  .callout { padding: 0.75rem 1rem; font-size: 0.9375rem; }
  .steps-box { padding: 1rem; }
  .feature-box { padding: 1rem; }
}

@media (max-width: 640px) {
  header .text-xl { font-size: 0.9375rem; }
  
  .workflow-step { flex-direction: column; gap: 0.75rem; }
  .workflow-step > div:first-child { align-self: flex-start; }
}

/* ==================== Mobile Sidebar ==================== */
@media (max-width: 1023px) {
  #sidebar { width: 85vw; max-width: 320px; }
  .sidebar-category > div { min-height: 44px; }
  .sidebar-category a { min-height: 40px; display: flex; align-items: center; }
}

/* ==================== Print ==================== */
@media print {
  header, aside { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn { animation: fadeIn 0.2s ease-out; }

/* ==================== Touch Devices ==================== */
@media (hover: none) and (pointer: coarse) {
  button, a { min-height: 44px; }
  button:active, a:active { opacity: 0.8; }
}

/* ==================== Safe Areas ==================== */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #sidebar { padding-bottom: env(safe-area-inset-bottom); }
}
