body {
  margin: 0;
  font-family: Arial, sans-serif;
}

#app-header {
  position: relative;
  height: auto;
  background: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sidebar {
  width: 340px;
  background: #f4f4f4;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  z-index: 1000;
}

#sidebar.closed {
  transform: translateX(-100%);
}

#sidebar-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(0,0,0,0.09);
  z-index: 1200;
}

#sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 0;
  width: 32px;
  height: 32px;
  background: #f4f4f4;
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  border: 1px solid #ddd;
}

#sidebar-toggle-icon {
  font-size: 24px;
  color: #333;
  user-select: none;
}

#sidebar-title {
  margin: 60px 0 20px 0;
  padding: 0 0 0 18px;
  font-size: 1.25em;
  font-weight: bold;
  color: #333;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-addall-btn {
  width: 22px;
  height: 22px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-addall-btn:hover {
  background: #0056b3;
}

.sidebar-clear-btn {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  margin-left: 4px;
  padding: 2px 8px;
  cursor: pointer;
}
.sidebar-clear-btn:hover {
  background: #a94442;
}

#sidebar-layers {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.photo-layer {
  display: flex;
  align-items: center;
  margin: 8px 10px;
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: grab;
  user-select: none;
  position: relative;
}

.photo-layer.dragging {
  opacity: 0.4;
}

.layer-count {
  width: 22px;
  text-align: center;
  font-weight: bold;
  color: #aaa;
  margin-right: 4px;
}

.add-to-canvas {
  width: 22px;
  height: 22px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 4px;
}

.add-to-canvas:hover {
  background: #0056b3;
}

.photo-layer img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-right: 8px;
}

.layer-name {
  flex: 1;
  margin-left: 6px;
  font-size: 1em;
  color: #333;
}

/* Sidebar draw section */
.sidebar-section {
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 50px 0 8px 0;
}

.sidebar-title-label {
  font-size: 1.1em;
  font-weight: bold;
  color: #000;
  letter-spacing: 1px;
}

/* Draw layers list */
.sidebar-draw-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 12px;
}

.sidebar-draw-layer {
  display: flex;
  align-items: center;
  background: #f8f8f8;
  border-radius: 5px;
  padding: 4px 8px;
  gap: 8px;
  font-size: 0.98em;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.sidebar-draw-layer.active {
  border-color: #007bff;
  background: #e8f0ff;
}

.sidebar-draw-layer .layer-rank {
  width: 24px;
  text-align: center;
  font-weight: bold;
  color: #007bff;
}

.sidebar-draw-layer .layer-name {
  flex: 1;
  color: #333;
}

.sidebar-draw-layer .layer-delete-btn {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 1em;
  width: 22px;
  height: 22px;
  cursor: pointer;
  margin-left: 2px;
}
.sidebar-draw-layer .layer-delete-btn:hover {
  background: #a94442;
}

/* Draw layer canvases */
.draw-layer-canvas {
  position: absolute;
  top: 60px;
  left: 340px; /* Match sidebar width */
  width: calc(100vw - 340px - 60px); /* Sidebar + draw panel */
  height: calc(100vh - 60px);
  pointer-events: auto;
  background: transparent;
  z-index: 1000;
  border: none;
  transition: width 0.3s ease, left 0.3s ease;
}

.draw-layer-canvas.active {
  box-shadow: 0 0 0 2px #007bff00;
}

#sidebar.closed ~ #canvas .draw-layer-canvas {
  left: 0;
  width: calc(100vw - 60px);
}


#canvas {
  background: #fff;
  min-height: 100vh;
  position: relative;
  margin-left: 340px; /* Match sidebar width */
  width: calc(100vw - 340px - 20px);
  transition: margin-left 0.3s ease;
  overflow: hidden;
}

/* Canvas area sits beside sidebar, leaves space for draw panel on right */
.canvas-area {
  position: relative;
  margin-top: 60px;
  margin-right: 60px; /* Space for draw panel */
  width: calc(100vw - 340px - 60px); /* Sidebar + draw panel */
  height: calc(100vh - 60px);
  min-height: 500px;
  background: #555;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: auto;
  z-index: 1;
  transition: width 0.3s ease, margin-left 0.3s ease;
}

#sidebar.closed ~ #canvas {
  margin-left: 0;
}

#sidebar.closed ~ #canvas .canvas-area {
  width: calc(100vw - 60px); /* Full width minus draw panel */
}


/* Photoshop-like vertical drawing control panel, right of canvas */
#draw-control-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 58px;
  height: calc(100vh - 60px);
  background: rgba(245,245,245,0.97);
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 10px 2px;
  z-index: 1200;
}

#draw-control-panel button,
#draw-control-panel input[type="color"],
#draw-control-panel input[type="number"] {
  font-size: 1.6em;
  width: 44px;
  min-width: 0;
  margin: 0;
  padding: 6px 0;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #efefef;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#draw-control-panel button[data-tool].active {
  background: #007bff;
  color: #fff;
}

#draw-control-panel .material-icons {
  font-size: 1.4em;
  pointer-events: none;
}

#draw-clear {
  background: #d9534f;
  color: #fff;
  border: none;
  padding: 6px 0;
  width: 44px;
}

#draw-clear:hover {
  background: #a94442;
}

/* Canvas draw layer */
#draw-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: auto;
  background: transparent;
}

#control-panel {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #eee;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.canvas-photo {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 2px solid transparent;
  cursor: move;
  transition: border-color 0.2s;
  pointer-events: auto;
}

.canvas-photo.selected {
  border-color: #007bff;
  z-index: 2;
  box-shadow: 0 0 0 3px #bcdfff;
}
.canvas-photo.active {
  outline: 2px solid #44aaff;
}

.canvas-layer-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #007bff;
  color: #fff;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  z-index: 20;
  pointer-events: none;
  font-family: Arial, sans-serif;
  font-weight: bold;
  opacity: 0.95;
}

.canvas-photo.rotate-dot {
  background: #ffe600;
  border: 2px solid #007bff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  position: absolute;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
  cursor: grab;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-photo.resize-dot {
  background: #007bff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  position: absolute;
  right: -10px;
  bottom: -10px;
  cursor: nwse-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.focus-dashbox {
  position: absolute;
  border: 2px dashed #007bff;
  z-index: 101;
  pointer-events: auto;
  background: rgba(255,255,255,0.01);
}

.focus-mask {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  pointer-events: none;
}

.sidebar-logo-container {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.draw-logo {
  width: 128px;
  height: auto;
  display: inline-block;
  opacity: 0.85;
}

/* === Notes Layer Fix === */
#canvas-notes-layer {
  position: absolute;
  top: 60px;
  left: 220px;
  right: 60px;
  bottom: 0;
  pointer-events: none;
  z-index: 1100; /* Above draw layer and mask */
}

.text-note {
  position: absolute;
  min-width: 120px;
  min-height: 40px;
  background: #ffffcc;
  border: 1px solid #ffd700;
  border-radius: 6px;
  padding: 6px 28px 6px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 1101; /* Above everything else */
  cursor: move;
  font-size: 1em;
  pointer-events: auto;
}

.text-note.dragging {
  opacity: 0.7;
}

.note-content {
  outline: none;
  min-height: 24px;
  padding-right: 18px;
  word-break: break-word;
}

.note-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  color: #d9534f;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.note-delete:hover {
  color: #a94442;
}

/* Screenshot Box Overlay */
.screenshot-box {
  position: absolute;
  border: 2px dashed #999;
  /* background: rgba(200, 200, 200, 0.3); */
  width: 480px;
  height: 270px; /* 16:9 default */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1500;
  box-sizing: border-box;
  pointer-events: auto;
}

.screenshot-box.hidden {
  display: none;
}

.screenshot-drag-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: move;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  padding: 6px;
  z-index: 2;
}

.screenshot-drag-handle .material-icons {
  font-size: 20px;
  color: #333;
}

.screenshot-resize-dot {
  position: absolute;
  right: -28px;
  bottom: -0px;
  width: 24px;
  height: 24px;
  background: #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: nwse-resize;
  z-index: 2;
}

.screenshot-resize-dot .material-icons {
  font-size: 18px;
  color: #fff;
}

.screenshot-watermark .watermark {
  margin-top: 8px;
  margin-left: 8px;
  font-size: 18px;
  color: #ccc;
}

.screenshot-controls {
  position: absolute;
  bottom: -40px;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

#screenshot-ratio {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 0.9em;
}

#screenshot-capture-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screenshot-capture-btn:hover {
  background: #0056b3;
}

#screenshot-cancel-btn {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screenshot-cancel-btn:hover {
  background: #a94442;
}

/* Branding and cropping images */
.sidebar-brand {
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
  margin-top: 4px;
  margin-bottom: 12px;
  font-family: 'Inter', Arial, sans-serif;
}

.crop-photo {
  width: 22px;
  height: 22px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 4px;
}

.crop-photo:hover {
  background: #218838;
}

/* Crop Modal */
#crop-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.crop-modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.crop-modal-content {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  z-index: 10001;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.crop-title {
  margin-top: 0;
  font-size: 1.2em;
  text-align: center;
}

.crop-image-wrapper {
  max-height: 400px;
  overflow: auto;
  text-align: center;
  margin: 10px 0;
}

#crop-image {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid #ccc;
}

.crop-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.crop-btn {
  padding: 8px 16px;
  font-size: 0.9em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.crop-btn.confirm {
  background-color: #007bff;
  color: white;
}

.crop-btn.cancel {
  background-color: #ccc;
}

/* SLOGAN STATEMENT */
.slogan-banner {
  width: calc(100vw - 340px - 20px);
  text-align: center;
  font-size: 1.1em;
  font-weight: 500;
  color: #444;
  padding: 8px 0;
  font-family: 'Inter', sans-serif;
  background-color: #f0f4f8;
  border-top: 1px solid #ddd;
}


/* WELCOME CARD */
.flash-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.flash-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  max-width: 700px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  text-align: center;
}

.flash-media {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 10px;
  justify-content: center;
  align-items: center;
}

.flash-image {
  max-width: 200px;
  height: auto;
  border-radius: 8px;
}

.flash-video {
  flex: 1;
  min-width: 300px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}

.flash-content {
  padding: 20px;
}

.flash-content h2 {
  margin: 0 0 10px;
  font-size: 1.5em;
  color: #007bff;
}

.flash-content p {
  margin: 0 0 20px;
  font-size: 1em;
  color: #555;
}

.flash-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.flash-btn {
  padding: 8px 16px;
  font-size: 0.9em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.flash-btn.access {
  background-color: #007bff;
  color: white;
}

.flash-btn.cancel {
  background-color: #ccc;
  color: #333;
}

/* FOOTER  */
#app-footer {
  width: calc(100vw - 340px - 120px);
  text-align: center;
  padding: 12px 0;
  background-color: #f5f7fa00;
  font-family: 'Inter', sans-serif;
  border-top: 1px solid #dddddd00;
}

.footer-content {
  width: 100%;
  text-align: right;
  font-size: 0.85em;
  color: #999;
}


/* END */