/* -----------------------------------------------------------------------------
   Additional Shortcodes CSS
   For new shortcodes added to the Hugo site
   ----------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------
   1. copy_text shortcode
   ----------------------------------------------------------------------------- */
.copy-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-gray);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: var(--font-size-small);
}

.copy-text__value {
  color: var(--text-color);
}

.copy-text__button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: var(--font-size-xsmall);
  transition: background-color 0.2s ease;
}

.copy-text__button:hover {
  background: var(--primary-hover);
}

.copy-text__button.success {
  background: var(--success-color, #28a745);
}

.copy-text__button.error {
  background: var(--error-color, #dc3545);
}

.copy-text__feedback {
  font-size: var(--font-size-xsmall);
  margin-left: 0.5rem;
}

/* -----------------------------------------------------------------------------
   2. video_embed shortcode
   ----------------------------------------------------------------------------- */
.video-embed {
  position: relative;
  width: 100%;
  margin: 2rem 0;
}

/* 16:9 aspect ratio */
.video-embed--16x9 {
  padding-bottom: 56.25%;
}

/* 4:3 aspect ratio */
.video-embed--4x3 {
  padding-bottom: 75%;
}

/* 1:1 aspect ratio */
.video-embed--1x1 {
  padding-bottom: 100%;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -----------------------------------------------------------------------------
   3. progress_bar shortcode
   ----------------------------------------------------------------------------- */
.progress-bar {
  margin: 1.5rem 0;
}

.progress-bar__label {
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.5rem;
  display: block;
}

.progress-bar__track {
  background: var(--light-gray);
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar__fill {
  background: var(--primary-color);
  height: 100%;
  border-radius: 12px;
  position: relative;
  transition: width 0.5s ease;
  min-width: 40px;
}

.progress-bar__value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
}

/* Progress bar variants */
.progress-bar--success .progress-bar__fill {
  background: var(--success-color, #28a745);
}

.progress-bar--warning .progress-bar__fill {
  background: var(--warning-color, #ffc107);
}

.progress-bar--warning .progress-bar__value {
  color: var(--text-color);
}

/* -----------------------------------------------------------------------------
   4. poll shortcode
   ----------------------------------------------------------------------------- */
.poll {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}

.poll__question {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-h4);
  color: var(--heading-color);
}

.poll__form {
  margin-bottom: 1.5rem;
}

.poll__option {
  position: relative;
  margin-bottom: 1rem;
}

.poll__input {
  position: absolute;
  opacity: 0;
}

.poll__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--light-gray);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.poll__input:checked + .poll__label {
  background: var(--primary-light);
  border: 2px solid var(--primary-color);
  padding: calc(0.75rem - 2px) calc(1rem - 2px);
}

.poll__input:disabled + .poll__label {
  cursor: not-allowed;
  opacity: 0.7;
}

.poll__option-text {
  flex: 1;
}

.poll__option-count {
  font-weight: var(--font-weight-medium);
  margin-left: 1rem;
  color: var(--text-muted);
}

.poll__option-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 6px 6px;
  transition: width 0.5s ease;
}

.poll__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.poll__submit {
  min-width: 120px;
}

.poll__status {
  color: var(--text-muted);
  font-size: var(--font-size-small);
}

.poll__results {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.poll__total {
  margin: 0;
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   5. tabs shortcode
   ----------------------------------------------------------------------------- */
.tabs {
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.tabs__nav {
  display: flex;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tabs__nav-item {
  flex: 0 0 auto;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--text-color);
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.tabs__nav-item:last-child {
  border-right: none;
}

.tabs__nav-item:hover {
  background: var(--gray-100);
}

.tabs__nav-item.active {
  background: var(--white);
  font-weight: var(--font-weight-medium);
  color: var(--primary-color);
}

.tabs__content {
  background: var(--white);
}

.tab {
  padding: 2rem;
}

.tab__content {
  /* Content styling handled by global styles */
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
  .tabs__nav {
    -webkit-overflow-scrolling: touch;
  }
  
  .tabs__nav-item {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-small);
  }
  
  .tab {
    padding: 1.5rem;
  }
}

/* -----------------------------------------------------------------------------
   6. rating shortcode
   ----------------------------------------------------------------------------- */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-base);
}

.rating__label {
  font-weight: var(--font-weight-medium);
}

.rating__stars {
  display: inline-flex;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.rating__star {
  display: inline-block;
  margin: 0 0.1em;
}

.rating__star--full {
  color: var(--primary-color);
}

.rating__star--half {
  position: relative;
  color: var(--border-color);
}

.rating__star--half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: var(--primary-color);
}

.rating__star--empty {
  color: var(--border-color);
}

.rating__value {
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

.rating__count {
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   7. roi_calculator shortcode
   ----------------------------------------------------------------------------- */
.roi-calculator {
  background: var(--light-gray);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}

.roi-calculator__title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.roi-calculator__form {
  margin-bottom: 1.5rem;
}

.roi-calculator__fields {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.roi-calculator__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roi-calculator__field label {
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
}

.roi-calculator__input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: var(--font-size-base);
}

.roi-calculator__input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.roi-calculator__actions {
  display: flex;
  gap: 1rem;
}

.roi-calculator__result {
  background: var(--white);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
}

.roi-calculator__result-label {
  font-size: var(--font-size-small);
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.roi-calculator__result-value {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.roi-calculator__cta {
  margin-top: 1.5rem;
}

/* Responsive calculator */
@media (min-width: 768px) {
  .roi-calculator__fields {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* -----------------------------------------------------------------------------
   8. mermaid shortcode
   ----------------------------------------------------------------------------- */
.mermaid-wrapper {
  margin: 2rem 0;
  text-align: center;
}

.mermaid {
  display: inline-block;
  background: var(--white);
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 100px;
}

.mermaid.rendered {
  padding: 0;
  border: none;
  background: transparent;
}

.mermaid.rendered svg {
  max-width: 100%;
  height: auto;
}

.mermaid .error {
  color: var(--error-color);
  padding: 2rem;
}

/* -----------------------------------------------------------------------------
   9. accordion_group shortcode
   ----------------------------------------------------------------------------- */
.accordion-group {
  margin: 2rem 0;
}

.accordion-group__controls {
  margin-bottom: 1rem;
  text-align: right;
}

.accordion-group__toggle-all {
  font-size: var(--font-size-small);
}

.accordion-group__items {
  /* Items styling handled by accordion shortcode */
}

/* -----------------------------------------------------------------------------
   10. schema shortcode
   ----------------------------------------------------------------------------- */
.schema-debug {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 4px;
  font-size: var(--font-size-small);
}

.schema-debug summary {
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
}

.schema-debug pre {
  margin-top: 1rem;
  background: var(--white);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.schema-debug code {
  font-family: var(--font-mono, monospace);
  font-size: var(--font-size-xsmall);
  color: var(--text-color);
}

/* -----------------------------------------------------------------------------
   Utility classes
   ----------------------------------------------------------------------------- */
.btn--tertiary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn--tertiary:hover {
  background: var(--primary-light);
}

/* Print styles */
@media print {
  .video-embed,
  .poll,
  .roi-calculator,
  .tabs__nav,
  .copy-text__button,
  .accordion-group__controls {
    display: none;
  }
  
  .tab {
    display: block !important;
    page-break-inside: avoid;
  }
}