/* Global variables */
:root {
  --primary-colour: #4e5dff;
  --secondary-colour: #f5f6ff;
  --accent-colour: #6c5dd3;
  --text-colour: #2a2a2a;
  --bg-colour: #ffffff;
  --border-colour: #e0e0e0;
  --shadow-colour: rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --transition: 0.3s ease;
  --gradient: linear-gradient(135deg, var(--primary-colour), var(--accent-colour));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f5f7ff 0%, #f0f2ff 100%);
  color: var(--text-colour);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Enhanced Header styling */
.app-header {
  background: var(--gradient);
  color: #fff;
  padding: 1.5rem 1rem;
  box-shadow: 0 4px 20px rgba(78, 93, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  pointer-events: none;
}

/* Inner header container to control layout */
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

/* Left part of the header contains logo and tagline */
.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Logo container (icon + text) */
.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.logo svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Subtitle under the logo */
.app-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Header reset button placement */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Enhanced Reset button in the header */
.header-reset-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header-reset-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Enhanced Main wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 2rem auto;
  align-items: stretch;
  padding: 0 1rem;
  gap: 2rem;
}

/* Enhanced Canvas area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-colour);
  border: 1px solid var(--border-colour);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  padding: 2rem;
  min-height: 70vh;
  backdrop-filter: blur(10px);
}

/* Enhanced Upload wrapper */
.upload-wrapper {
  width: 100%;
  max-width: 600px;
  text-align: center;
}
.drop-area {
  position: relative;
  border: 3px dashed var(--primary-colour);
  border-radius: var(--radius);
  background: var(--bg-colour);
  padding: 5rem 2rem;
  cursor: pointer;
  transition: all var(--transition);
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(78, 93, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(108, 93, 211, 0.05) 0%, transparent 50%);
}
.drop-area:hover {
  background-color: var(--secondary-colour);
  border-color: var(--accent-colour);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(78, 93, 255, 0.15);
}
.drop-area.drag-over {
  background-color: var(--secondary-colour);
  border-color: var(--primary-colour);
  border-style: solid;
}
.drop-message {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-colour);
  margin-bottom: 1rem;
}
.drop-message svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  fill: var(--primary-colour);
  opacity: 0.8;
}
#file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.tip-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
  background: var(--secondary-colour);
  padding: 0.8rem;
  border-radius: var(--radius);
  display: inline-block;
}

/* Enhanced Preview wrapper */
.preview-wrapper {
  width: 100%;
  max-width: 800px;
  background: var(--bg-colour);
  border: 1px solid var(--border-colour);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 70vh;
  max-height: 70vh;
  backdrop-filter: blur(10px);
}

/* Ensure the SVG scales to fit within the preview container */
.svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(circle at 20% 20%, rgba(78, 93, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(108, 93, 211, 0.05) 0%, transparent 50%);
  border-radius: calc(var(--radius) - 4px);
}
.svg-container svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Enhanced Sidebar */
.sidebar {
  width: 360px;
  background: var(--bg-colour);
  border: 1px solid var(--border-colour);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 2rem 1.5rem;
  gap: 2rem;
  backdrop-filter: blur(10px);
}
.placeholder-message {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  padding: 2rem;
}
.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Enhanced Section titles for sidebar */
.section-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-colour);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--gradient);
  border-radius: 2px;
}

/* Enhanced Item colours section */
.item-colors {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.color-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.color-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background-color var(--transition);
  position: relative;
}
.color-item:hover {
  background: var(--secondary-colour);
}
.color-item:hover .color-tooltip {
  opacity: 1;
  transform: translateY(-5px);
}
/* Enhanced Colour swatch */
.color-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-colour);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.color-swatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, 
      rgba(255,255,255,0.2) 25%, 
      transparent 25%, 
      transparent 75%, 
      rgba(255,255,255,0.2) 75%),
    linear-gradient(45deg, 
      rgba(255,255,255,0.2) 25%, 
      transparent 25%, 
      transparent 75%, 
      rgba(255,255,255,0.2) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  opacity: 0.3;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Color tooltip */
.color-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text-colour);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.color-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-colour);
}

/* Hide native colour inputs if any remain */
.color-item input[type="color"] {
  display: none;
}
.color-item.selected {
  outline: 3px solid var(--primary-colour);
  outline-offset: 2px;
  border-radius: var(--radius);
  background: var(--secondary-colour);
}

/* Color Palette Section */
.color-palette-section {
  margin-top: 1rem;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.palette-color {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border-colour);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.palette-color:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border-color: var(--primary-colour);
}

/* PNG Filter Section */
.png-filter-section {
  margin-top: 1rem;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-option {
  padding: 0.6rem 0.4rem;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  background: var(--secondary-colour);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
  color: var(--text-colour);
}

.filter-option:hover {
  background: var(--primary-colour);
  color: #fff;
  border-color: var(--primary-colour);
  transform: translateY(-2px);
}

.filter-option.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(78, 93, 255, 0.4);
}

/* Enhanced Flip controls */
.flip-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.flip-buttons {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.flip-btn {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  background: var(--secondary-colour);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-colour);
  transition: all var(--transition);
  flex: 1;
  min-width: 50px;
}
.flip-btn:hover {
  background: var(--primary-colour);
  color: #fff;
  border-color: var(--primary-colour);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 93, 255, 0.3);
}
.flip-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Use external flip icon SVGs */
.flip-icon-svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.flip-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(78, 93, 255, 0.4);
}

/* Enhanced Background controls */
.background-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.background-options {
  display: flex;
  gap: 0.8rem;
}
.bg-option {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  background: var(--secondary-colour);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-colour);
  transition: all var(--transition);
  flex: 1;
}
.bg-option:hover {
  background: var(--primary-colour);
  color: #fff;
  border-color: var(--primary-colour);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 93, 255, 0.3);
}
.bg-option svg, .bg-option span {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.bg-option.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(78, 93, 255, 0.4);
}

/* Enhanced History controls (undo/redo) */
.history-controls {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}
.history-controls .button {
  flex: 1;
}

/* Enhanced Colour editor preview swatch */
.editor-color-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  border: 3px solid var(--border-colour);
  margin: 1rem auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  background-image: 
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.editor-color-preview-inner {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) - 2px);
}

/* Enhanced Background colour picker control */
.bg-color-control {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--secondary-colour);
  border-radius: var(--radius);
}
.bg-color-control label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-colour);
}

/* Style the background opacity slider */
#bg-opacity-slider {
  width: 100%;
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  background: var(--border-colour);
  outline: none;
}
#bg-color-picker {
  width: 100%;
  height: 50px;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  background: var(--secondary-colour);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ensure SVG transforms around its centre for flips */
.svg-container svg {
  transform-origin: center center;
}

.color-controls,
.palette-controls,
.export-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.color-controls label {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
#color-picker {
  width: 80px;
  height: 50px;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.palettes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.palette-colour {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border-colour);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.palette-colour:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.palette-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Enhanced Button styles */
.button {
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.button:hover::before {
  left: 100%;
}

/* Tertiary buttons (e.g. help tab) */
.button.tertiary {
  background: var(--secondary-colour);
  color: var(--primary-colour);
  border: 2px solid var(--primary-colour);
}
.button.tertiary:hover {
  background: var(--primary-colour);
  color: #fff;
  border-color: var(--primary-colour);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(78, 93, 255, 0.3);
}

/* Help tab wrapper to ensure spacing */
.help-tab-wrapper {
  margin-top: 1rem;
}

/* Make the help tab expand to full width */
.help-tab {
  display: block;
  width: 100%;
}

/* Enhanced Help overlay styles */
.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}
.help-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Enhanced Colour editor overlay styles */
.color-editor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}
.color-editor.open {
  opacity: 1;
  pointer-events: auto;
}
.color-editor-dialog {
  background: var(--bg-colour);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border: 1px solid var(--border-colour);
}

.color-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.color-editor-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.editor-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.editor-preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.editor-inputs-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editor-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-colour);
  display: flex;
  justify-content: between;
  align-items: center;
}

.editor-input-group label span {
  font-weight: 400;
  color: #666;
  margin-left: auto;
}

.hex-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hex-input-wrapper::before {
  content: '#';
  font-weight: 600;
  color: var(--text-colour);
}

.editor-hex-input {
  flex: 1;
  padding: 0.6rem;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.editor-hex-input:focus {
  outline: none;
  border-color: var(--primary-colour);
}

.editor-color-input {
  width: 100%;
  height: 50px;
  border: 2px solid var(--border-colour);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.editor-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-with-value {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-with-value input[type="range"] {
  flex: 1;
}

.slider-value {
  min-width: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-colour);
  text-align: center;
  background: var(--secondary-colour);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

.editor-alpha-slider,
.editor-rgb-slider {
  width: 100%;
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  background: var(--border-colour);
  outline: none;
}

.editor-rgb-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rgb-slider {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rgb-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.rgb-slider-name {
  color: var(--text-colour);
}

.rgb-slider-value {
  color: #666;
  font-family: monospace;
}

/* Color palette in editor */
.editor-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-colour);
}

.editor-palette-title {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-colour);
  margin-bottom: 0.5rem;
}

.palette-color {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border-colour);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.palette-color:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.editor-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-colour);
}

.help-dialog {
  background: var(--bg-colour);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 560px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  border: 1px solid var(--border-colour);
}

.help-dialog h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-colour);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.help-dialog p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.help-dialog ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.help-dialog li {
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--secondary-colour);
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-colour);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.close-btn:hover {
  background: var(--primary-colour);
  color: #fff;
  transform: rotate(90deg);
}
.button.primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(78, 93, 255, 0.4);
}
.button.primary:hover {
  background: var(--accent-colour);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(78, 93, 255, 0.5);
}
.button.secondary {
  background: var(--secondary-colour);
  color: var(--primary-colour);
  border: 2px solid var(--primary-colour);
}
.button.secondary:hover {
  background: var(--primary-colour);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(78, 93, 255, 0.3);
}
.button:active {
  transform: translateY(0);
}

/* Enhanced Footer */
.app-footer {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  background: var(--bg-colour);
  border-top: 1px solid var(--border-colour);
  margin-top: auto;
}

/* Information section styling */
.info-section {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--bg-colour);
  border: 1px solid var(--border-colour);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  line-height: 1.6;
  backdrop-filter: blur(10px);
}
.info-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-colour);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.info-section p {
  margin-bottom: 1rem;
  color: #555;
  font-size: 1rem;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Loading animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success animations */
@keyframes success {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.success {
  animation: success 0.6s ease;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .sidebar {
    width: 320px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 280px;
  }
  
  .main-wrapper {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Header adjustments on small screens */
  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .header-left {
    align-items: center;
  }
  .logo svg {
    width: 36px;
    height: 36px;
  }
  .logo-text {
    font-size: 1.5rem;
  }
  .app-subtitle {
    font-size: 0.9rem;
  }
  .header-reset-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .main-wrapper {
    flex-direction: column;
    margin: 1rem auto;
    gap: 1rem;
  }
  .sidebar {
    width: 100%;
    order: 2;
    margin-top: 1rem;
    padding: 1.5rem 1rem;
  }
  .canvas-area {
    order: 1;
    padding: 1.5rem;
    min-height: 50vh;
  }
  .preview-wrapper,
  .upload-wrapper {
    min-height: 50vh;
  }
  
  .flip-buttons,
  .background-options {
    justify-content: center;
  }
  
  .color-items {
    justify-content: center;
  }

  .editor-controls-grid {
    grid-template-columns: 1fr;
  }

  .editor-palette {
    grid-template-columns: repeat(6, 1fr);
  }

  .palette-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .filter-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 1rem;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .drop-area {
    padding: 3rem 1rem;
  }
  
  .drop-message {
    font-size: 1.2rem;
  }
  
  .sidebar {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .button {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  .editor-palette {
    grid-template-columns: repeat(4, 1fr);
  }

  .palette-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .filter-options {
    grid-template-columns: 1fr;
  }
}