/* Photoshop Dark Theme - Camera Raw Filter Modal */
.cr-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.cr-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cr-dialog {
  width: 96vw;
  height: 94vh;
  max-width: 1400px;
  max-height: 920px;
  background: #242424;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  user-select: none;
  overflow: hidden;
}

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

.cr-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 13px;
  color: #f5f5f5;
}

.cr-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cr-icon-btn {
  background: #2c2c2c;
  border: 1px solid #444;
  color: #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
}

.cr-icon-btn:hover {
  background: #383838;
  color: #fff;
}

.cr-icon-btn.active {
  background: #2680eb;
  border-color: #1a6cd1;
  color: #fff;
}

.cr-close-btn {
  background: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

.cr-close-btn:hover {
  color: #fff;
}

.cr-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Canvas Viewport */
.cr-viewport {
  flex: 1;
  background: #181818;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(45deg, #1f1f1f 25%, transparent 25%),
                    linear-gradient(-45deg, #1f1f1f 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #1f1f1f 75%),
                    linear-gradient(-45deg, transparent 75%, #1f1f1f 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.cr-preview-canvas {
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Right Control Panel */
.cr-sidebar {
  width: 340px;
  background: #222222;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
}

/* Histogram Container */
.cr-histogram-box {
  padding: 12px 16px 8px;
  background: #1c1c1c;
  border-bottom: 1px solid #303030;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cr-histogram-canvas {
  width: 100%;
  height: 64px;
  background: #141414;
  border: 1px solid #383838;
  border-radius: 3px;
}

/* Tabs */
.cr-tab-bar {
  display: flex;
  background: #1f1f1f;
  border-bottom: 1px solid #333;
}

.cr-tab {
  flex: 1;
  padding: 9px 8px;
  text-align: center;
  cursor: pointer;
  color: #999;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}

.cr-tab:hover {
  color: #ddd;
}

.cr-tab.active {
  color: #fff;
  border-bottom-color: #2680eb;
  background: #242424;
}

/* Scrollable Controls */
.cr-controls {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cr-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #777;
  margin-bottom: 8px;
  border-bottom: 1px solid #2e2e2e;
  padding-bottom: 4px;
}

.cr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cr-row:last-child {
  margin-bottom: 0;
}

.cr-label {
  width: 90px;
  flex-shrink: 0;
  color: #bbb;
  font-size: 11.5px;
}

.cr-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cr-range {
  flex: 1;
  accent-color: #2680eb;
  cursor: pointer;
}

.cr-num {
  width: 44px;
  background: #181818;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  color: #fff;
  padding: 3px 5px;
  font-size: 11.5px;
  text-align: right;
  outline: none;
}

.cr-num:focus {
  border-color: #2680eb;
}

/* HSL Channel Selector */
.cr-hsl-channels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cr-hsl-btn {
  padding: 3px 7px;
  border-radius: 3px;
  background: #2b2b2b;
  border: 1px solid #3e3e3e;
  color: #ccc;
  font-size: 10.5px;
  cursor: pointer;
}

.cr-hsl-btn.active {
  background: #2680eb;
  border-color: #1a6cd1;
  color: #fff;
}

/* Footer Actions */
.cr-footer {
  padding: 12px 16px;
  background: #1a1a1a;
  border-top: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cr-btn {
  background: #333333;
  border: 1px solid #484848;
  border-radius: 4px;
  color: #eee;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}

.cr-btn:hover {
  background: #404040;
  color: #fff;
}

.cr-btn-primary {
  background: #2680eb;
  border-color: #1a6cd1;
  color: #fff;
  font-weight: 600;
}

.cr-btn-primary:hover {
  background: #1f6fd1;
}
