/**
 * Chapter Section Navigation Styles
 * Works with Alpine.js for smooth, glitch-free transitions
 * Uses ultra-unique class names (fcn-child-sec prefix) to avoid ALL conflicts
 */

/* ============================================================================
   ALPINE.JS X-CLOAK - Prevents flash of unstyled content
   ========================================================================= */
[x-cloak] {
  display: none !important;
}

/* ============================================================================
   CONTAINER
   ========================================================================= */
.fcn-child-sec-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.fcn-child-sec-alpine-container {
  min-height: 100px;
}

/* ============================================================================
   SECTIONS
   ========================================================================= */
.fcn-child-sec-text-block {
  margin-bottom: 1rem;
}

/* ============================================================================
   NAVIGATION
   ========================================================================= */
.fcn-child-sec-nav-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 1rem 0;
  padding: 0;
}

.fcn-child-sec-nav-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0 0 0;
  padding: 0;
}

/* Legacy support - kept for backwards compatibility */
.fcn-child-sec-nav-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 2rem 0 1.5rem;
  padding: 0;
}

/* ============================================================================
   BUTTONS - Subtle & Compact Design
   ========================================================================= */
.fcn-child-sec-load-button {
  /* Explicit resets - no 'all: unset' to avoid cascade issues */
  margin: 0 !important;
  padding: 6px 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.08) 100%) !important;
  box-sizing: border-box !important;

  /* Layout */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;

  /* Sizing - Comfortable touch target */
  min-width: auto !important;
  width: auto !important;
  max-width: none !important;
  height: 32px !important;
  min-height: auto !important;

  /* Typography - Readable & friendly */
  font-family: var(--ff-base, -apple-system, sans-serif) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  letter-spacing: 0.01em !important;

  /* Color - light mode */
  color: var(--fg-700, #555) !important;
  border-radius: 16px !important;

  /* Subtle shadow for depth */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  text-shadow: none !important;
  filter: none !important;

  /* Interaction */
  cursor: pointer !important;
  user-select: none !important;
  pointer-events: auto !important;
  transition: all 0.2s ease !important;

  /* Accessibility */
  outline: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.fcn-child-sec-load-button:hover {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.12) 100%) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: var(--fg-600, #444) !important;
  transform: scale(1.02) translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.fcn-child-sec-load-button:active {
  transform: scale(0.98) translateY(0);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.14) 100%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

.fcn-child-sec-load-button:focus-visible {
  outline: 2px solid var(--primary-500, #4a90e2);
  outline-offset: 3px;
  border-radius: 16px;
}

/* Dark mode - subtle adjustments */
body[data-mode="dark"] .fcn-child-sec-load-button {
  color: var(--fg-600, #aaa) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body[data-mode="dark"] .fcn-child-sec-load-button:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.14) 100%) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--fg-500, #ccc) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

body[data-mode="dark"] .fcn-child-sec-load-button:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.16) 100%) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

/* ============================================================================
   SECTION COUNTER - Minimalist caption
   ========================================================================= */
.fcn-child-sec-counter {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.75rem 0 0 0;
  padding: 0;
}

.fcn-child-sec-counter span {
  font-family: var(--ff-base, -apple-system, sans-serif);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.01em;
  text-align: center;
}

/* Dark mode counter */
body[data-mode="dark"] .fcn-child-sec-counter span {
  color: rgba(255, 255, 255, 0.35);
}

/* ============================================================================
   RESPONSIVE DESIGN - Mobile & Tablet
   ========================================================================= */

/* Tablet and smaller (768px and below) */
@media only screen and (max-width: 768px) {
  .fcn-child-sec-nav-top {
    margin: 0 0 0.75rem 0;
  }

  .fcn-child-sec-nav-bottom {
    margin: 1rem 0 0 0;
  }

  .fcn-child-sec-nav-controls {
    gap: 5px !important;
    margin: 1.5rem 0 1rem !important;
  }

  .fcn-child-sec-load-button {
    padding: 5px 14px !important;
    height: 28px !important;
    font-size: 11px !important;
    border-radius: 14px !important;
  }

  .fcn-child-sec-counter {
    margin: 0.6rem 0 0 0;
  }

  .fcn-child-sec-counter span {
    font-size: 9px;
  }
}

/* Mobile (480px and below) */
@media only screen and (max-width: 480px) {
  .fcn-child-sec-nav-top {
    margin: 0 0 0.6rem 0;
  }

  .fcn-child-sec-nav-bottom {
    margin: 0.75rem 0 0 0;
  }

  .fcn-child-sec-nav-controls {
    gap: 4px !important;
    margin: 1.25rem 0 0.75rem !important;
  }

  .fcn-child-sec-load-button {
    padding: 4px 12px !important;
    height: 26px !important;
    font-size: 10px !important;
    border-radius: 13px !important;
    letter-spacing: 0 !important;
  }

  .fcn-child-sec-counter {
    margin: 0.5rem 0 0 0;
  }

  .fcn-child-sec-counter span {
    font-size: 8px;
  }
}

/* Very small mobile (375px and below) */
@media only screen and (max-width: 375px) {
  .fcn-child-sec-nav-top {
    margin: 0 0 0.5rem 0;
  }

  .fcn-child-sec-nav-bottom {
    margin: 0.6rem 0 0 0;
  }

  .fcn-child-sec-nav-controls {
    gap: 3px !important;
  }

  .fcn-child-sec-load-button {
    padding: 3px 10px !important;
    height: 24px !important;
    font-size: 9px !important;
    border-radius: 12px !important;
  }

  .fcn-child-sec-counter {
    margin: 0.4rem 0 0 0;
  }

  .fcn-child-sec-counter span {
    font-size: 8px;
  }
}
