/* Tozan Theme Settings Panel Styles */

/* Toggle Button */
.tozan-settings-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-one, #120b14);
  color: var(--color-font-two, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tozan-settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.tozan-settings-toggle:active {
  transform: scale(0.95);
}

/* Panel Container */
.tozan-settings-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tozan-settings-panel.is-open {
  opacity: 1;
  visibility: visible;
}

/* Backdrop */
.tozan-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Content Panel */
.tozan-settings-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--color-body, #fff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.tozan-settings-panel.is-open .tozan-settings-content {
  transform: translateX(0);
}

/* Header */
.tozan-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-three, #ededed);
  flex-shrink: 0;
}

.tozan-settings-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-font-one, #120b14);
}

.tozan-settings-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-two, #f6f6f6);
  color: var(--color-font-one, #120b14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.tozan-settings-close:hover {
  background: var(--color-three, #ededed);
}

/* Body */
.tozan-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Sections */
.tozan-settings-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-three, #ededed);
}

.tozan-settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.tozan-settings-section-title {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-font-one, #120b14);
  opacity: 0.6;
}

/* Groups */
.tozan-settings-group {
  margin-bottom: 16px;
}

.tozan-settings-group:last-child {
  margin-bottom: 0;
}

.tozan-settings-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-font-one, #120b14);
}

.tozan-settings-value {
  font-weight: 400;
  opacity: 0.7;
}

/* Options Container */
.tozan-settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tozan-settings-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tozan-settings-options-stack {
  flex-direction: column;
}

/* Option Buttons */
.tozan-settings-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--color-three, #ededed);
  border-radius: 8px;
  background: transparent;
  color: var(--color-font-one, #120b14);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tozan-settings-option:hover {
  background: var(--color-two, #f6f6f6);
  border-color: var(--color-two, #f6f6f6);
}

.tozan-settings-option.is-active {
  background: var(--color-one, #120b14);
  color: var(--color-font-two, #fff);
  border-color: var(--color-one, #120b14);
}

/* Color Preview Circles */
.tozan-settings-option-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tozan-settings-option-auto {
  background: linear-gradient(135deg, #fff 50%, #11131d 50%);
  border: 1px solid #ddd;
}

/* Layout Preview Icons */
.tozan-layout-preview {
  width: 32px;
  height: 24px;
  background: var(--color-three, #ededed);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.tozan-layout-grid::before {
  content: '';
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(var(--color-font-one, #120b14) 0 0) 0 0 / 48% 48%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 52% 0 / 48% 48%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 0 52% / 48% 48%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 52% 52% / 48% 48%;
  background-repeat: no-repeat;
  opacity: 0.3;
}

.tozan-settings-option.is-active .tozan-layout-preview {
  background: rgba(255, 255, 255, 0.2);
}

.tozan-settings-option.is-active .tozan-layout-grid::before {
  background:
    linear-gradient(#fff 0 0) 0 0 / 48% 48%,
    linear-gradient(#fff 0 0) 52% 0 / 48% 48%,
    linear-gradient(#fff 0 0) 0 52% / 48% 48%,
    linear-gradient(#fff 0 0) 52% 52% / 48% 48%;
  background-repeat: no-repeat;
  opacity: 0.6;
}

.tozan-layout-balance::before {
  content: '';
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(var(--color-font-one, #120b14) 0 0) 0 0 / 60% 100%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 64% 0 / 36% 48%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 64% 52% / 36% 48%;
  background-repeat: no-repeat;
  opacity: 0.3;
}

.tozan-settings-option.is-active .tozan-layout-balance::before {
  background:
    linear-gradient(#fff 0 0) 0 0 / 60% 100%,
    linear-gradient(#fff 0 0) 64% 0 / 36% 48%,
    linear-gradient(#fff 0 0) 64% 52% / 36% 48%;
  background-repeat: no-repeat;
  opacity: 0.6;
}

.tozan-layout-showcase::before {
  content: '';
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(var(--color-font-one, #120b14) 0 0) 0 0 / 100% 55%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 0 60% / 32% 40%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 34% 60% / 32% 40%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 68% 60% / 32% 40%;
  background-repeat: no-repeat;
  opacity: 0.3;
}

.tozan-settings-option.is-active .tozan-layout-showcase::before {
  background:
    linear-gradient(#fff 0 0) 0 0 / 100% 55%,
    linear-gradient(#fff 0 0) 0 60% / 32% 40%,
    linear-gradient(#fff 0 0) 34% 60% / 32% 40%,
    linear-gradient(#fff 0 0) 68% 60% / 32% 40%;
  background-repeat: no-repeat;
  opacity: 0.6;
}

.tozan-layout-solo::before {
  content: '';
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(var(--color-font-one, #120b14) 0 0) 10% 0 / 80% 45%,
    linear-gradient(var(--color-font-one, #120b14) 0 0) 10% 55% / 80% 45%;
  background-repeat: no-repeat;
  opacity: 0.3;
}

.tozan-settings-option.is-active .tozan-layout-solo::before {
  background:
    linear-gradient(#fff 0 0) 10% 0 / 80% 45%,
    linear-gradient(#fff 0 0) 10% 55% / 80% 45%;
  background-repeat: no-repeat;
  opacity: 0.6;
}

/* Image Orientation Preview */
.tozan-img-preview {
  background: var(--color-three, #ededed);
  border-radius: 3px;
}

.tozan-img-classic {
  width: 28px;
  height: 18px;
}

.tozan-img-portrait {
  width: 16px;
  height: 24px;
}

.tozan-img-square {
  width: 20px;
  height: 20px;
}

.tozan-img-landscape {
  width: 32px;
  height: 18px;
}

.tozan-img-ultrawide {
  width: 36px;
  height: 14px;
}

.tozan-img-natural {
  width: 24px;
  height: 20px;
  border-radius: 3px;
  position: relative;
}

.tozan-img-natural::after {
  content: 'N';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-font-one, #120b14);
  opacity: 0.5;
}

.tozan-settings-option.is-active .tozan-img-natural::after {
  color: #fff;
  opacity: 0.8;
}

.tozan-settings-option.is-active .tozan-img-preview {
  background: rgba(255, 255, 255, 0.4);
}

/* Widget Preview */
.tozan-widget-preview {
  width: 24px;
  height: 24px;
  background: var(--color-three, #ededed);
  border-radius: 4px;
}

.tozan-widget-round {
  border-radius: 50%;
}

.tozan-widget-mixed {
  border-radius: 4px 12px;
}

.tozan-widget-compact {
  width: 32px;
  height: 16px;
  border-radius: 8px;
}

.tozan-settings-option.is-active .tozan-widget-preview {
  background: rgba(255, 255, 255, 0.4);
}

/* Range Input */
.tozan-settings-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-three, #ededed);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.tozan-settings-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-one, #120b14);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tozan-settings-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.tozan-settings-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--color-one, #120b14);
  cursor: pointer;
}

/* Toggle Switch */
.tozan-settings-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-font-one, #120b14);
}

.tozan-settings-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tozan-settings-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-three, #ededed);
  border-radius: 12px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.tozan-settings-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.tozan-settings-checkbox:checked + .tozan-settings-toggle-switch {
  background: var(--color-one, #120b14);
}

.tozan-settings-checkbox:checked + .tozan-settings-toggle-switch::after {
  transform: translateX(20px);
}

/* Footer */
.tozan-settings-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-three, #ededed);
  flex-shrink: 0;
}

.tozan-settings-reset {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--color-three, #ededed);
  border-radius: 8px;
  background: transparent;
  color: var(--color-font-one, #120b14);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tozan-settings-reset:hover {
  background: var(--color-two, #f6f6f6);
  border-color: var(--color-two, #f6f6f6);
}

/* Content Display Toggle Styles */
body.hide-author .item-byline-name,
body.hide-author .item-byline-link {
  display: none;
}

body.hide-date .item-meta-date,
body.hide-date .item-byline-date {
  display: none;
}

body.hide-excerpt .item-excerpt {
  display: none;
}

body.hide-reading-time .item-meta-length {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .tozan-settings-content {
    max-width: 100%;
  }

  .tozan-settings-toggle {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .tozan-settings-options-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tozan-settings-header h2 {
    font-size: 1.125rem;
  }
}

/* Hide homepage layout switcher when settings panel is present */
.homepage-layout-switcher-btn,
.homepage-layout-switcher-dropdown {
  display: none !important;
}

/* Select Dropdown */
.tozan-settings-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-three, #ededed);
  border-radius: 8px;
  background: var(--color-body, #fff);
  color: var(--color-font-one, #120b14);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.tozan-settings-select:hover {
  border-color: var(--color-two, #f6f6f6);
}

.tozan-settings-select:focus {
  outline: none;
  border-color: var(--color-one, #120b14);
}

/* Options Wrap (for more flexible layouts) */
.tozan-settings-options-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Load More Button Styles */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: var(--grid-gap, 34px) 0;
}

.load-more-btn {
  padding: 14px 28px;
  border: 1px solid var(--color-three, #ededed);
  border-radius: var(--radius, 6px);
  background: var(--color-body, #fff);
  color: var(--color-font-one, #120b14);
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: var(--color-one, #120b14);
  color: var(--color-font-two, #fff);
  border-color: var(--color-one, #120b14);
}

/* Pagination Styles */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--color-three, #ededed);
  border-radius: var(--radius, 6px);
  background: var(--color-body, #fff);
  color: var(--color-font-one, #120b14);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: var(--color-two, #f6f6f6);
}

.pagination-btn.is-active {
  background: var(--color-one, #120b14);
  color: var(--color-font-two, #fff);
  border-color: var(--color-one, #120b14);
}
