/* AVIF Local Support admin styles */
.avif-local-support-tab {
  margin-top: 16px;
}

.avif-local-support-tab:not(.active) {
  display: none;
}

.avif-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.avif-status-success {
  color: #00a32a;
}

.avif-status-success-text {
  color: #00a32a;
  font-weight: 700;
}

.avif-status-error {
  color: #d63638;
  font-weight: 700;
}

.avif-status-error-note {
  color: #d63638;
  font-size: 11px;
}

.avif-error-text {
  color: #d63638;
}

.avif-spinner-inline {
  float: none;
  margin: 0;
  vertical-align: middle;
}

#avif-local-support-stats,
#aviflosu-thumbhash-stats {
  margin-bottom: 12px;
}

.avif-result-row {
  margin-top: 15px;
}

#avif-local-support-result .spinner,
#aviflosu-thumbhash-result .spinner {
  float: none;
  visibility: visible;
  margin: 0 8px 0 0;
}

.avif-test-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.avif-playground-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.avif-playground-upload-row label {
  font-weight: 600;
}

.avif-playground-controls {
  margin: 14px 0 10px;
  padding: 12px;
  border: 1px solid #dcdcde;
  background: #fff;
}

.avif-playground-controls-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.avif-playground-range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avif-playground-range-wrap input[type="range"] {
  width: min(360px, 100%);
}

.avif-playground-view-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.avif-playground-view-switch .button.is-primary {
  border-color: #2271b1;
}

.avif-playground-controls .button.disabled,
.avif-tools-section .button.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.avif-playground-preview-card {
  border: 1px solid #dcdcde;
  background: #fff;
  padding: 10px;
}

.avif-playground-preview-card h4 {
  margin: 0 0 8px;
}

#avif-local-support-playground-size-summary {
  margin: 0 0 10px;
}

.avif-playground-preview-frame {
  max-width: 100%;
  max-height: min(70vh, 900px);
  overflow: auto;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
}

.avif-playground-preview-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: initial;
  background: transparent;
  border: 0;
}

.avif-code-overflow {
  white-space: pre-wrap;
  word-break: break-word;
  display: inline-block;
  max-width: 680px;
  overflow: auto;
}

.avif-binary-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.avif-panel-output {
  max-width: 960px;
  white-space: pre-wrap;
  background: #f6f7f7;
  padding: 10px;
  border: 1px solid #ccd0d4;
  margin-top: 8px;
}

/* Align labels and inputs a bit nicer in Settings API tables */
.form-table th {
  width: 260px;
}

.avif-settings-form {
  max-width: 980px;
}

.avif-tools-layout {
  max-width: 980px;
}

.avif-settings-form .title {
  margin: 0 0 2px;
}

.avif-tools-section {
  margin: 0 0 24px;
}

.avif-tools-section + .avif-tools-section {
  padding-top: 16px;
  border-top: 1px solid #dcdcde;
}

.avif-tools-section h3 {
  margin: 0 0 8px;
}

.avif-help-tip {
  color: #646970;
  font-size: 16px;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  vertical-align: text-bottom;
}

.avif-help-tip:hover {
  color: #2271b1;
}

/* Increase spacing between inline radio options */
#aviflosu_subsampling label,
#aviflosu_bit_depth label {
  margin-right: 18px;
  display: inline-flex;
  align-items: center;
}

/* Logs styling */
.avif-logs-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.avif-logs-filter input {
  margin: 0;
}

.avif-logs-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #c3c4c7;
  background: #fff;
  padding: 10px;
}

.avif-log-entry {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #dcdcde;
}

.avif-log-entry:last-child {
  border-bottom: 0;
}

.avif-log-entry.error {
  border-left: 3px solid #dc3232;
}

.avif-log-entry.warning {
  border-left: 3px solid #ffb900;
}

.avif-log-entry.success,
.avif-log-entry.info {
  border-left: 3px solid #46b450;
}

.avif-log-header {
  font-weight: 600;
  margin-bottom: 4px;
}

.avif-log-status.error {
  color: #dc3232;
}

.avif-log-status.warning {
  color: #ffb900;
}

.avif-log-status.success,
.avif-log-status.info {
  color: #46b450;
}

.avif-log-details {
  font-size: 11px;
  color: #666;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.4;
}

.avif-log-suggestion {
  margin: 6px 0;
  padding: 6px 8px;
  background: #fcf9e8;
  border-left: 4px solid #dba617;
  color: #3c434a;
  font-weight: 400;
  font-size: 12px;
}

.avif-support-panel .widefat td {
  vertical-align: top;
}

.avif-support-details {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #dcdcde;
  background: #fff;
}

.avif-support-details>summary {
  cursor: pointer;
}

.avif-support-details-body {
  margin-top: 8px;
}

.avif-support-details .form-table {
  margin-top: 0;
}

.avif-inline-help {
  margin: 8px 0 0;
}

.avif-inline-help>summary {
  cursor: pointer;
}

/* About tab readme styling */
.avif-readme-content {
  max-width: 960px;
}

.avif-readme-content h2 {
  margin: 0 0 10px;
}

.avif-readme-content h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dcdcde;
}

.avif-readme-content h4 {
  margin: 16px 0 8px;
  color: #1d2327;
}

.avif-readme-content p {
  margin: 0 0 12px;
  line-height: 1.6;
}

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

.avif-readme-content ul {
  list-style: disc;
}

.avif-readme-content ol {
  list-style: decimal;
}

.avif-readme-content ul li,
.avif-readme-content ol li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.avif-readme-content code {
  background: #f0f0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.avif-code-block {
  background: #f6f7f7;
  padding: 12px 14px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
  border: 1px solid #dcdcde;
}

.avif-code-block code {
  background: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

/* Hide log entries that appear in wrong location (direct children of .wrap) */
.wrap>.avif-log-entry {
  display: none !important;
}

@media (max-width: 782px) {
  .avif-playground-controls-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .avif-playground-preview-frame {
    max-height: 60vh;
  }
}
