@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700&display=swap');

:root {
  --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Outfit", sans-serif;
  
  --primary-color: #ee6730;
  --primary-hover: #e3252d;
  --primary-accent: #df1c25;
  --secondary-color: #52b35b;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-secondary: #f1f5f9;
  
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.15);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.Header {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: transparent;
}

.Header .Logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.Header .Logo img {
  height: 170px;
  width: auto;
  max-width: 750px;
  object-fit: contain;
}

/* Main Container */
.HomeCompress {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
}

.WrapperBoxed {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .WrapperBoxed {
    grid-template-columns: 1fr;
  }
}

/* Left Side: Upload & Controls */
.Boxed__Left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.BoxUpload {
  background: var(--bg-card);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  height: 500px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.BoxUpload.dragover,
.BoxUpload:hover {
  border-color: var(--primary-color);
  background-color: rgba(238, 103, 48, 0.02);
}

/* Image2Fast Concentric Animated Circles */
.Circle {
  position: absolute;
  border: 1px dashed #cbd5e1;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: all 0.5s ease;
}

.circle-sxmall { width: 90px; height: 90px; }
.circle-small { width: 230px; height: 230px; }
.circle-sxmedium { width: 430px; height: 430px; }
.circle-xmedium { width: 630px; height: 630px; }
.circle-sxlarge { width: 930px; height: 930px; }
.circle-xlarge { width: 1230px; height: 1230px; }

.Circle.animate {
  animation: pulseCircle 4s infinite linear;
}

@keyframes pulseCircle {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.03); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

.GroupConvert {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 92%;
  max-width: 460px;
}

/* Control Options Selector */
.SettingsBox {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: 100%;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.SettingRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.SettingLabel {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

.CustomSelect {
  width: 240px;
  min-width: 240px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  outline: none;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
  transition: border-color 0.2s;
}

.CustomSelect option {
  text-align: center;
}

.CustomSelect:focus {
  border-color: var(--primary-color);
}

/* Big Upload Button */
.BtnClick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--text-dark);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.BtnClick:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(238, 103, 48, 0.35);
}

.BtnClick i {
  background: var(--primary-color);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-style: normal;
}

.BtnClick span {
  color: var(--primary-color);
  text-decoration: underline;
}

.BtnClick:hover span {
  color: #fff;
}

.Desc {
  font-size: 0.85rem;
  color: #002d2e;
  text-align: center;
  line-height: 1.6;
}

.Desc a {
  color: #ff4021;
  text-decoration: underline;
  font-weight: 600;
}

/* Right Side: Process Queue & Results */
.Boxed__Right {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 500px;
}

.GroupOther {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.BtnRemove {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.BtnRemove:hover {
  background: rgba(223, 28, 37, 0.08);
}

.BtnRemove.btn--disabled {
  opacity: 0.4;
  pointer-events: none;
  color: var(--text-muted);
}

.Quality {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.Quality .Number__Image {
  color: var(--primary-color);
}

.GroupItem {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Empty Queue State */
.EmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Item Card */
.Item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all 0.2s;
}

.Item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.Item__Load {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}

.Item__Load img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.Item__Info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.Item__Info .Name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Item__Info .Numeral {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.StatusBadge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  display: inline-block;
}

.StatusBadge.processing {
  background: #fef3c7;
  color: #d97706;
}

.StatusBadge.done {
  background: #dcfce7;
  color: #15803d;
}

.StatusBadge.error {
  background: #fee2e2;
  color: #b91c1c;
}

.ItemActions {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
}

.BtnAction {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.BtnAction.BtnMask {
  background: linear-gradient(135deg, #ee6730, #d9531e);
  color: #ffffff;
}

.BtnAction.BtnMask:hover {
  background: linear-gradient(135deg, #d9531e, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(238, 103, 48, 0.3);
}

.BtnAction.BtnPreview {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.BtnAction.BtnPreview:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.BtnAction.BtnDl {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.BtnAction.BtnDl:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.GroupBtn {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.BtnProcessBatch {
  flex: 1;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.BtnProcessBatch:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.BtnProcessBatch.btn--disabled {
  opacity: 0.4;
  pointer-events: none;
  background: #cbd5e1;
  box-shadow: none;
}

.BtnDownloadAll {
  flex: 1;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(238, 103, 48, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.BtnDownloadAll:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(238, 103, 48, 0.35);
}

.BtnDownloadAll.btn--disabled {
  opacity: 0.4;
  pointer-events: none;
  background: #cbd5e1;
  box-shadow: none;
}

/* Modal Comparison Popup */
.ModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ModalOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ModalCard {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.ModalHeader {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.ModalTitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 60px);
  display: inline-block;
  flex: 1;
  min-width: 0;
}

.CloseBtn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  margin-left: auto;
}

.CloseBtn:hover {
  color: var(--text-dark);
  background: var(--bg-secondary);
}

.ModalBody {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.ComparisonView {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  user-select: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.ComparisonView img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.AfterWrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.AfterWrapper img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: 100%;
}

.SliderHandle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: #ffffff;
  transform: translateX(-50%);
  cursor: ew-resize;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.SliderHandle::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Process Batch Button */
.BtnProcessBatch {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.BtnProcessBatch:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.BtnProcessBatch.btn--disabled {
  opacity: 0.5;
  pointer-events: none;
  background: #cbd5e1;
  box-shadow: none;
}

/* Manual Brush Modal Styles */
.BrushModalCard {
  max-width: 1050px;
  height: 88vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ModalSubtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
  font-weight: 500;
}

.BrushToolbar {
  padding: 12px 24px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  flex-wrap: wrap;
}

.BrushControlGroup {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ToolBtn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ToolBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ToolBtn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(238, 103, 48, 0.4);
}

.SliderWrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.SliderWrapper input[type="range"] {
  width: 120px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.BrushButtonGroup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.BtnBrushAction {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.BtnBrushAction:hover {
  background: rgba(255, 255, 255, 0.22);
}

.BtnBrushSubmit {
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.BtnBrushSubmit.Secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.BtnBrushSubmit.Secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.BtnBrushSubmit.Primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 14px rgba(238, 103, 48, 0.35);
}

.BtnBrushSubmit.Primary:hover {
  background: #d9531e;
  transform: translateY(-1px);
}

.BrushModalBody {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #090d16;
}

.CanvasContainer {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#brushCanvas {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  cursor: crosshair;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.Toast {
  background: var(--text-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
