/* MTips5s Photoshop Lite - Filter Gallery Styles */

.filter-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e0e0e0;
}

.filter-gallery-window {
  width: 92vw;
  max-width: 1180px;
  height: 88vh;
  max-height: 820px;
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-gallery-header {
  height: 42px;
  background: #1e1e1e;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.filter-gallery-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-gallery-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.filter-gallery-close:hover {
  background: #333;
  color: #fff;
}

.filter-gallery-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px 280px;
  overflow: hidden;
  background: #1e1e1e;
}

/* Left: Preview Section */
.filter-gallery-preview-pane {
  background: #181818;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.filter-gallery-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  background-image: 
    linear-gradient(45deg, #222 25%, transparent 25%), 
    linear-gradient(-45deg, #222 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #222 75%), 
    linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.filter-gallery-canvas {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  border: 1px solid #333;
}

.filter-gallery-preview-toolbar {
  height: 36px;
  background: #252526;
  border-top: 1px solid #333;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  font-size: 11px;
}

.filter-gallery-preview-toolbar button {
  background: #333;
  border: 1px solid #444;
  color: #ccc;
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 11px;
}

.filter-gallery-preview-toolbar button:hover {
  background: #444;
  color: #fff;
}

/* Middle: Category & Filter Selector */
.filter-gallery-catalog-pane {
  background: #252526;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.filter-category-folder {
  border-bottom: 1px solid #2e2e2e;
}

.filter-category-title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #bbb;
  background: #2a2a2b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-category-title:hover {
  color: #fff;
  background: #303031;
}

.filter-category-items {
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: #202021;
}

.filter-item-card {
  background: #2a2a2c;
  border: 1px solid #38383a;
  border-radius: 4px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.filter-item-card:hover {
  background: #353538;
  border-color: #555;
}

.filter-item-card.active {
  background: #004d80;
  border-color: #007acc;
  color: #fff;
}

.filter-item-icon {
  width: 44px;
  height: 44px;
  background: #181818;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #999;
}

.filter-item-card.active .filter-item-icon {
  color: #fff;
  background: #005a9e;
}

.filter-item-name {
  font-size: 10.5px;
  line-height: 1.2;
  word-break: break-word;
}

/* Right: Parameters & Effect Stack */
.filter-gallery-control-pane {
  background: #252526;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-gallery-actions {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #333;
}

.filter-gallery-actions .btn-row {
  display: flex;
  gap: 8px;
}

.filter-gallery-actions button {
  flex: 1;
  padding: 7px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.filter-gallery-actions .btn-primary {
  background: #007acc;
  color: #fff;
  border-color: #0060a0;
}

.filter-gallery-actions .btn-primary:hover {
  background: #0088e0;
}

.filter-gallery-actions .btn-secondary {
  background: #3a3a3c;
  color: #ddd;
  border-color: #4a4a4c;
}

.filter-gallery-actions .btn-secondary:hover {
  background: #4a4a4c;
  color: #fff;
}

.filter-gallery-params {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  border-bottom: 1px solid #333;
}

.filter-param-header {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
  border-bottom: 1px solid #383838;
  padding-bottom: 6px;
}

.filter-param-group {
  margin-bottom: 14px;
}

.filter-param-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #bbb;
  margin-bottom: 5px;
}

.filter-param-slider {
  width: 100%;
  accent-color: #007acc;
  height: 4px;
  cursor: pointer;
}

.filter-param-select {
  width: 100%;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  color: #eee;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 11px;
}

/* Stack Panel */
.filter-gallery-stack-pane {
  height: 180px;
  background: #202021;
  display: flex;
  flex-direction: column;
}

.filter-gallery-stack-header {
  padding: 6px 12px;
  background: #282829;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #ccc;
}

.filter-gallery-stack-tools {
  display: flex;
  gap: 4px;
}

.filter-gallery-stack-tools button {
  background: #333;
  border: 1px solid #444;
  color: #ccc;
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
}

.filter-gallery-stack-tools button:hover {
  background: #444;
  color: #fff;
}

.filter-gallery-stack-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-stack-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #28282a;
  border: 1px solid #353538;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.filter-stack-item.active {
  background: #004d80;
  border-color: #007acc;
  color: #fff;
}

.filter-stack-eye {
  cursor: pointer;
  color: #888;
}

.filter-stack-item.active .filter-stack-eye,
.filter-stack-eye.visible {
  color: #fff;
}

.filter-stack-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
