/*
 * IMPORTANT: Prefer using Jaspr Component Styles over adding styles here.
 * See: https://docs.jaspr.site/concepts/styling#component-styles
 *
 * Only add styles to this file when absolutely necessary, such as:
 * - Global resets and base styles
 * - Font imports and @font-face declarations
 * - Styles that cannot be achieved with component styles
 *
 * For component-specific styles, use the @css annotation in your Dart components.
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;600;700&family=Roboto:wght@400;500;600;700&family=Roboto+Slab:wght@400;500&display=swap');

/* Icon fonts */
@font-face {
  font-family: 'Planter';
  src: url('fonts/Planter.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', 'Roboto', sans-serif;
  background-color: #FAFAFA;
  color: #333;
  scroll-behavior: smooth;
  /* clip (not hidden): hidden creates a scroll container, which breaks
     position: sticky everywhere on the page (e.g. the docs sidebar) */
  overflow-x: clip;
}

/* White background for home page */
.home-layout {
  background-color: #ffffff;
}

/* Icon styles */
.icon {
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-planter {
  font-family: 'Planter';
}

.icon-mdi {
  font-family: 'Material Design Icons';
}

/* Planter icon font classes */
.planter-icon {
  font-family: 'Planter' !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.planter-sprout-thermometer::before {
  content: '\e816';
}

.planter-ph::before {
  content: '\e80a';
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.3;
}

a {
  color: #4CAF50;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons should not have underline on hover */
a.hero-btn:hover,
a.btn:hover,
a.btn-outline-white:hover,
a.btn-primary-filled:hover,
a.download-btn:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Slideshow active states (needed for JavaScript toggle) */
.slide.active {
  opacity: 1 !important;
}

.dot.active {
  background-color: white !important;
}

.thumbnail.active {
  opacity: 1 !important;
  border-color: #4CAF50 !important;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3) !important;
}

/* ===== Quick Info Card Dialog Animations ===== */
.quick-info-dialog-overlay {
  animation: dialogFadeIn 0.2s ease;
}

@keyframes dialogFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.quick-info-dialog {
  animation: dialogSlideIn 0.2s ease;
}

@keyframes dialogSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== Accessibility Styles ===== */

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Slideshow button resets for accessibility */
.slideshow-dot {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.slideshow-thumb {
  cursor: pointer;
}

/* Clickable critter and nutrition card hover effects */
a[href^="/pests/"],
a[href^="/diseases/"],
a[href^="/beneficials/"],
a[href^="/vitamins/"],
a[href^="/nutrients/"] {
  text-decoration: none;
  display: block;
}

a[href^="/pests/"] > div,
a[href^="/diseases/"] > div,
a[href^="/beneficials/"] > div,
a[href^="/vitamins/"] > div,
a[href^="/nutrients/"] > div {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a[href^="/pests/"]:hover > div,
a[href^="/diseases/"]:hover > div,
a[href^="/beneficials/"]:hover > div,
a[href^="/vitamins/"]:hover > div,
a[href^="/nutrients/"]:hover > div {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Footer padding to accommodate floating subscription (home page only) */
.home-layout .site-footer {
  padding-top: 100px !important;
}

@media (max-width: 991px) {
  .home-layout .site-footer {
    padding-top: 0 !important;
  }
}

/* ===== Podcast Page Styles ===== */
.podcast-content {
  text-align: center;
}

.podcast-intro {
  font-size: 16px;
  color: #555;
  line-height: 1.7em;
  margin-bottom: 32px;
}

.podcast-subscribe {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 24px;
}

.podcast-section {
  margin-bottom: 40px;
}

.podcast-section h3 {
  font-size: 24px;
  color: #333;
  margin-bottom: 16px;
}

.podcast-section h4 {
  font-size: 18px;
  color: #555;
  margin-bottom: 16px;
  margin-top: 24px;
}

.podcast-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.podcast-badge {
  display: block;
  transition: transform 0.2s;
}

.podcast-badge:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.podcast-badge img {
  height: 48px;
  width: auto;
}

.podcast-video {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

.podcast-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.podcast-player {
  width: 100%;
  max-width: 100%;
  margin-top: 32px;
}

.podcast-player iframe {
  width: 100%;
  height: 630px;
  border: none;
}

/* Podcast page mobile responsive */
@media (max-width: 576px) {
  .podcast-badge img {
    height: 40px;
  }
}

/* ===== Blog Layout Styles ===== */

.blog-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.blog-post {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  width: 100%;
}

.blog-header {
  margin-bottom: 40px;
}

.blog-header-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Cover image */
.blog-cover {
  margin: 0 0 32px 0;
  border-radius: 12px;
  overflow: hidden;
}

.blog-cover-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.blog-cover-caption {
  padding: 12px 16px;
  background: #f5f5f5;
  font-size: 14px;
  color: #666;
  text-align: center;
  font-style: italic;
}

/* Title */
.blog-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  line-height: 1.2;
}

/* Meta info */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-meta i {
  color: #43a047;
}

/* Tags */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.blog-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #e8f5e9;
  color: #43a047;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.blog-tag:hover {
  background: #43a047;
  color: white;
  text-decoration: none;
}

/* Content wrapper with TOC */
.blog-content-wrapper {
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  margin: 0 auto;
}

/* Table of contents sidebar */
.blog-toc {
  width: 250px;
  flex-shrink: 0;
  position: relative;
}

.blog-toc-inner {
  position: sticky;
  top: 100px;
}

.blog-toc-title {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #43a047;
}

.blog-toc-nav .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc-nav .toc-item {
  margin-bottom: 8px;
}

.blog-toc-nav .toc-item-h3 {
  padding-left: 16px;
}

.blog-toc-nav .toc-link {
  color: #666;
  font-size: 13px;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
}

.blog-toc-nav .toc-link:hover {
  color: #43a047;
  text-decoration: none;
}

.blog-toc-nav .toc-link.active {
  color: #43a047;
  font-weight: 500;
  border-left-color: #43a047;
}

/* Blog footer */
.blog-footer {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e0e0e0;
  max-width: 800px;
}

.blog-series {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.blog-series h4 {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.blog-series-link {
  display: inline-block;
  padding: 6px 16px;
  background: #43a047;
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  margin-right: 8px;
}

.blog-series-link:hover {
  background: #388e3c;
  text-decoration: none;
}

.blog-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

/* When no TOC, center the content */
.blog-content-wrapper.no-toc {
  justify-content: center;
}

.blog-content-wrapper.no-toc .blog-content {
  margin: 0 auto;
}

/* Blog responsive */
@media (max-width: 1024px) {
  .blog-toc {
    display: none;
  }

  .blog-content-wrapper {
    max-width: 800px;
  }
}

@media (max-width: 768px) {
  .blog-post {
    padding: 80px 16px 32px;
  }

  .blog-title {
    font-size: 2rem;
  }

  .blog-meta {
    gap: 12px;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .blog-title {
    font-size: 1.75rem;
  }

  .blog-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== Blog Index Layout Styles ===== */

.blog-index-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.blog-index {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  width: 100%;
}

.blog-index-header {
  text-align: center;
  margin-bottom: 48px;
}

.blog-index-header-content {
  max-width: 700px;
  margin: 0 auto;
}

.blog-index-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

.blog-index-description {
  font-size: 18px;
  color: #666;
  line-height: 1.6;
}

/* Blog posts grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.blog-posts-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.blog-debug {
  text-align: left;
  background: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 13px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Blog post card */
.blog-post-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.blog-post-card-link:hover {
  text-decoration: none;
}

.blog-post-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.blog-post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-post-card:hover .blog-post-card-image img {
  transform: scale(1.05);
}

.blog-post-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.blog-post-card-image-placeholder i {
  font-size: 48px;
  color: #43a047;
  opacity: 0.5;
}

.blog-post-card-content {
  padding: 20px;
}

.blog-post-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.3;
}

.blog-post-card-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}

.blog-post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-post-card-tag {
  font-size: 12px;
  color: #43a047;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Blog index responsive */
@media (max-width: 768px) {
  .blog-index {
    padding: 80px 16px 40px;
  }

  .blog-index-title {
    font-size: 2rem;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .blog-index-title {
    font-size: 1.75rem;
  }

  .blog-post-card-image {
    height: 180px;
  }
}

/* ===== Documentation Layout Styles ===== */

.docs-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-wrapper {
  flex: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  /* Extra top clearance below the fixed navbar: docs have no hero image
     creating space like blog pages do */
  padding: 120px 20px 40px;
  width: 100%;
  gap: 40px;
}

/* Left sidebar navigation */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: relative;
}

.docs-sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  align-items: center;
  gap: 8px;
}

/* Search + nav pin together while the content scrolls; the nav list
   scrolls independently inside it. The sticky block releases only when the
   page scrolls past the end of the docs wrapper. */
.docs-sidebar-sticky {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.docs-nav {
  overflow-y: auto;
  min-height: 0;
}

.docs-nav-section {
  margin-bottom: 8px;
}

.docs-nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: #f8f9fa;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
  transition: background 0.2s;
}

.docs-nav-section-toggle:hover {
  background: #e8f5e9;
}

.docs-nav-section-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.docs-nav-section.collapsed .docs-nav-section-icon {
  transform: rotate(-90deg);
}

.docs-nav-section.collapsed .docs-nav-list {
  display: none;
}

.docs-nav-list {
  list-style: none;
  padding: 4px 0 4px 8px;
  margin: 0;
}

.docs-nav-item {
  margin: 2px 0;
}

.docs-nav-link {
  display: block;
  padding: 8px 12px;
  color: #555;
  font-size: 13px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.docs-nav-link:hover {
  color: #43a047;
  background: #f5f5f5;
  text-decoration: none;
}

.docs-nav-item.active .docs-nav-link {
  color: #43a047;
  background: #e8f5e9;
  font-weight: 500;
  border-left-color: #43a047;
}

/* Main content area */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

.docs-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.docs-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.docs-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.docs-body {
  line-height: 1.7;
}

/* Right TOC sidebar */
.docs-toc {
  width: 220px;
  flex-shrink: 0;
  position: relative;
}

.docs-toc-inner {
  position: sticky;
  top: 100px;
}

.docs-toc-title {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.docs-toc-nav .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc-nav .toc-item {
  margin-bottom: 4px;
}

.docs-toc-nav .toc-item-h3 {
  padding-left: 12px;
}

.docs-toc-nav .toc-link {
  color: #666;
  font-size: 12px;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
  border-left: 2px solid #e0e0e0;
  padding-left: 12px;
}

.docs-toc-nav .toc-link:hover {
  color: #43a047;
  text-decoration: none;
}

.docs-toc-nav .toc-link.active {
  color: #43a047;
  border-left-color: #43a047;
}

/* Pagination */
.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid #e0e0e0;
}

.docs-pagination-spacer {
  flex: 1;
}

.docs-pagination-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  min-width: 200px;
}

.docs-pagination-link:hover {
  background: #e8f5e9;
  text-decoration: none;
}

.docs-pagination-prev {
  flex-direction: row;
}

.docs-pagination-next {
  flex-direction: row;
  text-align: right;
  margin-left: auto;
}

.docs-pagination-link i {
  color: #43a047;
  font-size: 18px;
}

.docs-pagination-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-pagination-label {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
}

.docs-pagination-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* Docs responsive */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-wrapper {
    padding: 70px 16px 32px;
  }

  .docs-sidebar {
    width: 100%;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-sidebar-sticky {
    position: static;
    max-height: none;
    display: block;
  }

  .docs-nav {
    position: static;
    max-height: none;
    display: none;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
  }

  .docs-nav.open {
    display: block;
  }

  .docs-content {
    margin-top: 80px;
  }

  .docs-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 576px) {
  .docs-pagination {
    flex-direction: column;
  }

  .docs-pagination-link {
    min-width: auto;
  }

  .docs-pagination-next {
    margin-left: 0;
  }
}

/* ===== Shared Markdown Content Styles ===== */

.markdown-content {
  line-height: 1.7;
  color: #333;
}

.markdown-content h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 40px 0 20px;
  color: #333;
}

.markdown-content h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 36px 0 16px;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.markdown-content h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: #333;
}

.markdown-content h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: #444;
}

.markdown-content p {
  margin: 0 0 16px;
}

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

.markdown-content li {
  margin-bottom: 8px;
}

.markdown-content a {
  color: #43a047;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content strong {
  font-weight: 600;
}

.markdown-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
}

.markdown-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.markdown-content blockquote {
  border-left: 4px solid #43a047;
  margin: 0 0 16px;
  padding: 12px 20px;
  background: #f8f9fa;
  color: #555;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.markdown-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 32px 0;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.markdown-content th,
.markdown-content td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.markdown-content th {
  background: #f8f9fa;
  font-weight: 600;
}

/* ===== Author Page Styles ===== */

.author-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.author-page {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  width: 100%;
}

.author-header {
  text-align: center;
  margin-bottom: 40px;
}

.author-name {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.author-role {
  font-size: 1.25rem;
  color: #43a047;
  font-weight: 500;
  margin: 0;
}

.author-bio {
  margin-bottom: 40px;
  line-height: 1.8;
}

.author-bio p {
  margin-bottom: 16px;
}

.author-bio img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
}

/* Author page responsive */
@media (max-width: 768px) {
  .author-page {
    padding: 80px 16px 40px;
  }

  .author-name {
    font-size: 2rem;
  }

  .author-role {
    font-size: 1.1rem;
  }
}

/* ===== Series Page Styles ===== */

.series-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.series-page {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  width: 100%;
}

.series-header {
  text-align: center;
  margin-bottom: 32px;
}

.series-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background-color: #E8F5E9;
  border-radius: 50%;
  margin-bottom: 16px;
}

.series-page-icon .fas {
  font-size: 1.75rem;
  color: #4CAF50;
}

.series-page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.series-page-description {
  font-size: 1.15rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.series-cover {
  margin: 0 0 32px 0;
}

.series-cover-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.series-cover-caption {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.series-content {
  margin-bottom: 40px;
  line-height: 1.8;
}

.series-content p {
  margin-bottom: 16px;
}

.series-posts {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e0e0e0;
}

.series-posts-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 24px;
}

.series-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.series-post-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.2s ease;
}

.series-post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.series-post-card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.series-post-part {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: #4CAF50;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 1;
}

.series-post-card-image {
  width: 180px;
  height: 135px;
  overflow: hidden;
  flex-shrink: 0;
}

.series-post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-post-card-content {
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.series-post-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.3;
}

.series-post-card-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-post-card-date {
  font-size: 0.8rem;
  color: #999;
}

.series-posts-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Series page responsive */
@media (max-width: 768px) {
  .series-page {
    padding: 80px 16px 40px;
  }

  .series-page-title {
    font-size: 1.75rem;
  }

  .series-page-description {
    font-size: 1rem;
  }

  .series-post-card-link {
    flex-direction: column;
  }

  .series-post-card-image {
    width: 100%;
    height: 180px;
  }

  .series-post-part {
    top: auto;
    bottom: 12px;
  }
}

/* ===== Admin CMS Styles ===== */

/* Loading spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Admin header hover states */
.admin-header a:hover {
  text-decoration: none;
}

.sign-out-btn:hover {
  background-color: #f5f5f5 !important;
  color: #333 !important;
}

/* Login form hover states */
.login-submit:hover:not(:disabled) {
  background-color: #388e3c !important;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Login input focus states */
.login-form input:focus {
  border-color: #43a047;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

/* Toolbar button hover states */
.toolbar-btn:hover,
.view-mode-btn:hover {
  background-color: #f5f5f5 !important;
}

/* Save button states */
.save-btn:hover:not(:disabled) {
  background-color: #388e3c !important;
}

/* Post card hover */
.post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Dashboard card hover */
.admin-dashboard a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  text-decoration: none;
}

/* Dialog overlay animation */
.dialog-overlay {
  animation: dialogFadeIn 0.2s ease;
}

/* Dialog animations */
.dialog {
  animation: dialogSlideIn 0.2s ease;
}

/* Editor textarea styling */
.editor-container textarea {
  font-family: 'Roboto Mono', monospace;
}

.editor-container textarea:focus {
  outline: none;
}

/* Preview pane markdown content */
.preview-pane .markdown-content {
  max-width: 800px;
}

/* Responsive admin layout */
@media (max-width: 768px) {
  .editor-panes {
    flex-direction: column !important;
  }

  .preview-pane {
    border-left: none !important;
    border-top: 1px solid #e0e0e0 !important;
  }

  .metadata-panel > div {
    grid-template-columns: 1fr !important;
  }

  .editor-toolbar {
    gap: 4px !important;
  }

  .editor-toolbar button {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
}

/* Admin layout minimum height */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-content {
  flex: 1;
}

/* ===== Rich Text Editor Styles ===== */

/* Block focus state */
.rich-text-block.focused {
  outline: 2px solid rgba(67, 160, 71, 0.3);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Contenteditable placeholder */
.rich-text-block[contenteditable="true"]:empty::before,
.rich-text-block [contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

/* Block add animation */
@keyframes blockSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rich-text-block {
  animation: blockSlideIn 0.15s ease;
}

/* Block hover handle visibility */
.rich-text-block:hover .block-handle {
  opacity: 1;
}

/* Contenteditable links styling */
.rich-text-block a {
  color: #43a047;
  text-decoration: underline;
  cursor: pointer;
}

/* Inline formatting preview */
.rich-text-block strong,
.rich-text-block b {
  font-weight: 600;
}

.rich-text-block em,
.rich-text-block i {
  font-style: italic;
}

.rich-text-block code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
}

/* Component block hover states */
.image-block:hover,
.youtube-block:hover,
.notice-block:hover,
.affiliate-block:hover {
  border-color: #43a047;
}

/* Add block menu hover */
.rich-text-editor button:hover {
  background-color: #e8f5e9 !important;
}

/* Toolbar button active state animation */
@keyframes toolbarPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.rich-text-toolbar button:active {
  animation: toolbarPulse 0.1s ease;
}

/* Link dialog input focus */
.rich-text-editor input[type="url"]:focus,
.rich-text-editor input[type="text"]:focus,
.rich-text-editor textarea:focus {
  border-color: #43a047;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
  outline: none;
}

/* YouTube preview responsive */
.youtube-preview iframe {
  max-width: 100%;
}

/* Notice type colors */
.notice-block.notice-tip {
  border-left: 4px solid #43a047;
}

.notice-block.notice-info {
  border-left: 4px solid #2196f3;
}

.notice-block.notice-warning {
  border-left: 4px solid #ff9800;
}

.notice-block.notice-note {
  border-left: 4px solid #9e9e9e;
}

/* Rich text editor responsive */
@media (max-width: 768px) {
  .rich-text-toolbar {
    gap: 4px !important;
  }

  .rich-text-toolbar button {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .rich-text-blocks {
    padding: 12px !important;
  }
}

/* ===== Admin Datalist/Autocomplete Styling ===== */
/* Note: Datalist styling is limited by browser support */
input[list] {
  background-color: #ffffff;
  color: #333333;
}

/* Chrome/Safari datalist options */
datalist option {
  background-color: #ffffff;
  color: #333333;
  padding: 8px 12px;
}

/* Selected chip hover effect */
.selected-chip:hover {
  background-color: #c8e6c9 !important;
}
