/**
 * MTips5s Photoshop Lite - Save for Web Styling
 * Classic Photoshop CC Save for Web (Legacy) dark workspace
 */

.sfw-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

.sfw-window {
  width: 96vw;
  height: 94vh;
  background: #262626;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #cccccc;
}

/* Header */
.sfw-header {
  height: 38px;
  background: #1f1f1f;
  border-bottom: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

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

.sfw-close {
  background: transparent;
  border: none;
  color: #888888;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.sfw-close:hover {
  background: #c53030;
  color: #ffffff;
}

/* Main Layout */
.sfw-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Center Preview Column */
.sfw-preview-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #181818;
  overflow: hidden;
}

/* View Mode Tabs (Original, Optimized, 2-Up, 4-Up) */
.sfw-tabs-bar {
  height: 34px;
  background: #222222;
  border-bottom: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.sfw-view-tabs {
  display: flex;
  height: 100%;
}

.sfw-view-tab {
  background: transparent;
  border: none;
  color: #888888;
  font-size: 11px;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.sfw-view-tab:hover {
  color: #ffffff;
}

.sfw-view-tab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: #262626;
}

.sfw-zoom-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.sfw-zoom-btn {
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  color: #cccccc;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.sfw-zoom-btn:hover {
  background: #3e3e42;
  color: #ffffff;
}

/* Preview Viewport Grid */
.sfw-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  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;
}

/* Layout Modes */
.sfw-grid-container {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.sfw-grid-4up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.sfw-cell {
  background: #1e1e1e;
  border: 1px solid #333333;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.sfw-cell-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #141414;
}

.sfw-cell-meta {
  background: #252526;
  border-top: 1px solid #333333;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.sfw-meta-title {
  font-weight: 700;
  color: #38bdf8;
}

.sfw-meta-stats {
  color: #aaaaaa;
  font-size: 10px;
}

/* Right Properties Column */
.sfw-sidebar {
  width: 290px;
  background: #222222;
  border-left: 1px solid #333333;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
  gap: 14px;
  font-size: 11px;
}

.sfw-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #333333;
  padding-bottom: 12px;
}

.sfw-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sfw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sfw-label {
  color: #aaaaaa;
  min-width: 80px;
}

.sfw-input, .sfw-select {
  background: #181818;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  color: #ffffff;
  padding: 3px 6px;
  font-size: 11px;
  outline: none;
}

.sfw-input:focus, .sfw-select:focus {
  border-color: #007acc;
}

.sfw-slider {
  flex: 1;
  height: 4px;
  accent-color: #007acc;
  cursor: pointer;
}

/* Color Table */
.sfw-color-table {
  background: #181818;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 1px;
  max-height: 120px;
  overflow-y: auto;
}

.sfw-color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 1px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer */
.sfw-footer {
  height: 44px;
  background: #1f1f1f;
  border-top: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.sfw-footer-info {
  font-size: 11px;
  color: #888888;
}

.sfw-footer-btns {
  display: flex;
  gap: 8px;
}

.sfw-btn {
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.sfw-btn-cancel {
  background: #2d2d30;
  border-color: #3e3e42;
  color: #cccccc;
}

.sfw-btn-cancel:hover {
  background: #3e3e42;
  color: #ffffff;
}

.sfw-btn-save {
  background: #007acc;
  color: #ffffff;
}

.sfw-btn-save:hover {
  background: #0062a3;
}
