@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --dark: #1f2937;
  --dark-hover: #111827;
  --light: #f8fafc;
  --border: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background: #ffffff;
  --card-background: #ffffff;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Login/Landing Section Styles */
.login-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.hero-section {
  margin-bottom: 4rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-button {
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 180px;
  justify-content: center;
}

.cta-button.primary {
  background: var(--success);
  color: white;
  box-shadow: var(--shadow-lg);
}

.cta-button.primary:hover {
  background: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.cta-button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.features-section {
  margin-bottom: 4rem;
  width: 100%;
  max-width: 1000px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.feature-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

.demo-preview {
  margin-bottom: 4rem;
  max-width: 800px;
  width: 100%;
}

.demo-gif {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.footer-section {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

.footer-section a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.footer-section a:hover {
  text-decoration: underline;
}

/* Main App Styles */
.main-app {
  display: none;
  min-height: 100vh;
  background: var(--light);
  padding: 2rem;
  width: 100%;
}

.main-app.active {
  display: block;
}

.app-container {
  width: 100%;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  margin-bottom: 3rem;
}

.app-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.app-header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.editor-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.controls-section {
  width: 100%;
  background: var(--card-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  order: 2;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.preview-section {
  width: 100%;
  background: var(--card-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
  order: 1;
}

.controls-panel {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  height: auto;
  max-height: none;
  overflow-y: visible;
}

.preview-panel {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.control-section {
  margin-bottom: 2rem;
}

.control-section:last-child {
  margin-bottom: 0;
}

.control-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-colour 0.2s ease;
}

.input-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

.icon-btn {
  padding: 0.75rem;
  background: var(--light);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--border);
}

.colour-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.colour-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--light);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.colour-input:hover {
  background: #f1f5f9;
}

.colour-input label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.colour-input input[type="color"] {
  width: 80px;
  height: 50px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.size-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.size-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.size-control-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-group input[type="range"] {
  flex: 1;
  appearance: none;
  height: 8px;
  background: linear-gradient(to right, var(--primary), var(--primary-hover));
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.slider-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow);
}

.slider-group span {
  min-width: 50px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--light);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn.secondary:hover {
  background: var(--border);
}

.btn.text {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem;
}

.btn.text:hover {
  color: var(--primary);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-title h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.preview-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
}

.preview-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.2rem;
}

.preview-btn:hover {
  background: var(--light);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.preview-container {
  background: var(--light);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-controls {
  display: flex;
  gap: 0.5rem;
  order: 1;
}

.preview-info {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  order: 2;
}

.zoom-controls {
  display: flex;
  gap: 0.25rem;
  order: 3;
}

.dimensions-info {
  font-weight: 500;
}

.zoom-info {
  color: var(--primary);
  font-weight: 600;
}

.zoom-controls {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: bold;
}

.zoom-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.canvas-container {
  position: relative;
  min-height: 200px;
  overflow-x: auto;
  overflow-y: visible;
}

.canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: white;
  transition: all 0.3s ease;
  overflow: visible;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.canvas-wrapper canvas {
  max-width: 100%;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform-origin: center;
  transition: transform 0.3s ease;
  display: block;
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  z-index: 10;
}

.overlay-message {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.preview-tabs {
  display: flex;
  background: var(--light);
  border-top: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}

.generated-section {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-bottom: 2rem;
}

.generated-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.generated-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.quality-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.quality-selector select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
}

.image-preview-container {
  padding: 1.5rem;
  text-align: center;
}

.image-preview-container img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.image-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

#canvas-wrap {
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2rem;
  text-align: center;
  border: 2px solid var(--border);
}

#preview {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.download-section {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-bottom: 2rem;
}

.download-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.download-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.file-size-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.download-option {
  position: relative;
}

.download-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 100%;
}

.download-card:hover {
  border-color: var(--success);
  background: var(--light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.format-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.format-info {
  flex: 1;
}

.format-info h5 {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: var(--text-primary);
}

.format-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
}

.format-size {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}

.usage-guide {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-bottom: 2rem;
}

.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--light);
}

.guide-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.collapse-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.2s ease;
}

.collapse-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.guide-content {
  padding: 1.5rem;
}

.step-list {
  margin-bottom: 2rem;
}

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.step:last-child {
  margin-bottom: 0;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h5 {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: var(--text-primary);
}

.step-content p {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  text-align: left;
}

.code-snippet {
  background: var(--light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--primary);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.copy-code-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  color: var(--text-secondary);
  transition: colour 0.2s ease;
}

.copy-code-btn:hover {
  color: var(--primary);
}

.pro-tips {
  padding: 1.5rem;
  background: var(--light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.pro-tips h5 {
  margin: 0 0 1rem 0;
  font-weight: 600;
  color: var(--text-primary);
}

.pro-tips ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.pro-tips li {
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-align: left;
}

.pro-tips li:before {
  content: "💡";
  position: absolute;
  left: -1.5rem;
  font-size: 0.9rem;
}

.pro-tips li:last-child {
  margin-bottom: 0;
}

.app-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  border-top: 2px solid var(--border);
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.app-footer a:hover {
  text-decoration: underline;
}

.demo-notice {
  background: linear-gradient(135deg, var(--warning), #f59e0b);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.demo-notice strong {
  font-weight: 600;
}

.heart {
  color: #ef4444;
  font-size: 1.2em;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* colour Presets */
.colour-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.preset-btn {
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-weight: 500;
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.preset-btn:hover,
.preset-btn:active {
  background: var(--light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* User Info Section */
.user-info {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
}

.user-info.active {
  display: flex;
}

.user-avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
}

.logout-btn {
  padding: 0.5rem 1rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

/* GitHub Mark */
.github-mark {
  position: fixed;
  top: 2rem;
  right: 6rem;
  z-index: 999;
  transition: all 0.3s ease;
}

.github-mark:hover {
  transform: scale(1.1);
}

/* Responsive Design - Mobile First */
@media (min-width: 768px) {
  .editor-layout {
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0 2rem;
  }
  
  .controls-section {
    padding: 2rem;
  }
  
  .controls-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .preview-section {
    padding: 2rem;
  }
  
  .colour-presets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .preset-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: auto;
  }
  
  .colour-input {
    padding: 0.5rem;
  }
  
  .colour-input input[type="color"] {
    width: 60px;
    height: 40px;
  }
}

@media (min-width: 1024px) {
  .editor-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
  }
  
  .controls-section {
    order: 2;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  .preview-section {
    order: 1;
  }
}

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .controls-panel {
    max-height: none;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  body {
    background: var(--light);
  }
  
  .login-section {
    padding: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-button {
    width: 100%;
    max-width: 300px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .main-app {
    padding: 1rem;
  }
  
  .app-header h1 {
    font-size: 2rem;
  }
  
  .colour-controls {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .download-buttons {
    flex-direction: column;
  }
  
  .user-info {
    position: static;
    margin-bottom: 2rem;
    background: white;
    border: 2px solid var(--border);
  }
  
  /* Canvas mobile fixes - Force unzoomed state */
  .canvas-wrapper {
    padding: 0.5rem !important;
    overflow-x: auto;
    transform: none !important;
  }
  
  .canvas-wrapper[style*="transform"] {
    transform: none !important;
  }
  
  #canvas-wrap {
    padding: 0.5rem;
    transform: none !important;
  }
  
  #canvas-wrap[style*="transform"] {
    transform: none !important;
  }
  
  #preview {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    transform: none !important;
  }
  
  #preview[style*="transform"] {
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .controls-panel,
  .preview-panel {
    padding: 1rem;
  }
  
  .slider-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .slider-group span {
    align-self: flex-end;
  }
  
  /* Extra small screen canvas fixes */
  .canvas-wrapper {
    padding: 0.25rem !important;
  }
  
  #canvas-wrap {
    padding: 0.25rem;
    margin: 0 -0.25rem;
  }
  
  .preview-container {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: 2rem;
}

.hidden {
  display: none;
}

/* Mobile Preview Mode */
.preview-container.mobile-preview .canvas-wrapper {
  max-width: 375px;
  margin: 0 auto;
  border: 8px solid #000;
  border-radius: 20px;
  background: #000;
  padding: 20px 0;
}

.preview-container.mobile-preview #canvas-wrap {
  border-radius: 0;
  background: white;
}

/* Responsive Mobile Preview Mode */
@media (max-width: 480px) {
  .preview-container.mobile-preview .canvas-wrapper {
    max-width: 95%;
    border-width: 4px;
    padding: 10px 0;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Improved Canvas Wrapper */
#canvas-wrap {
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0;
  text-align: center;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

#preview {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

/* Improved responsive design for preview */
@media (max-width: 768px) {
  .preview-toolbar {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
  }
  
  .preview-controls,
  .zoom-controls {
    justify-content: center;
  }
  
  /* Hide zoom controls on mobile since preview should be unzoomed */
  .zoom-controls {
    display: none;
  }
  
  .preview-info {
    justify-content: center;
    text-align: center;
  }
  
  .zoom-controls {
    justify-content: center;
  }
  
  .preview-tabs {
    flex-direction: column;
  }
  
  .download-grid {
    grid-template-columns: 1fr;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
  }
  
  .step-number {
    align-self: center;
    margin-bottom: 0.5rem;
  }
}

/* Enhanced hover effects */
.download-card:hover .format-icon {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.preview-btn:active {
  transform: translateY(0);
}

.zoom-btn:active {
  transform: scale(0.95);
}

/* Loading states */
.canvas-wrapper.loading {
  opacity: 0.7;
  pointer-events: none;
}

.canvas-wrapper.loading #preview {
  filter: blur(1px);
}

/* Notification styles */
.notification {
  font-weight: 500;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

/* Section Styles for Full Width Layout */
.controls-section {
    width: 100%;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.preview-section {
    width: 100%;
    padding: 1.5rem;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .editor-layout {
        flex-direction: column;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .colour-controls {
        grid-template-columns: 1fr 1fr;
    }
    
    .preview-container {
        padding: 0.75rem;
        overflow-x: auto;
        transform: none !important;
    }
    
    .canvas-wrapper {
        max-width: 100%;
        transform: none !important;
        margin: 0 auto;
        padding: 0.5rem;
        min-width: 100%;
        box-sizing: border-box;
    }
    
    .canvas-wrapper canvas {
        width: 100% !important;
        max-width: 100%;
        height: auto !important;
        min-width: 300px;
        box-sizing: border-box;
        transform: none !important;
    }
    
    .download-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
    }
    
    .controls-section, .preview-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Additional mobile-specific fixes for very small screens */
@media (max-width: 480px) {
    .canvas-wrapper {
        padding: 0.25rem;
        transform: none !important;
    }
    
    .canvas-wrapper canvas {
        min-width: 280px;
        transform: none !important;
    }
    
    .preview-container {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        transform: none !important;
    }
    
    .canvas-container {
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        transform: none !important;
    }
    
    #canvas-wrap {
        transform: none !important;
    }
    
    #preview {
        transform: none !important;
    }
}

/* Pattern Selection Styles */
.pattern-selection {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    justify-items: center;
}

.pattern-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 60px;
}

.pattern-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.pattern-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.pattern-preview {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Pattern Preview Styles */
.solid-pattern {
    background: #3b82f6;
}

.dots-pattern {
    background: #3b82f6;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 6px 6px;
}

.stripes-pattern {
    background: #3b82f6;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.1),
        rgba(255,255,255,0.1) 2px,
        transparent 2px,
        transparent 4px
    );
}

.waves-pattern {
    background: #3b82f6;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.2) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.2) 2px, transparent 2px);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
}

.grid-pattern {
    background: #3b82f6;
    background-image: 
        linear-gradient(rgba(255,255,255,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.2) 1px, transparent 1px);
    background-size: 6px 6px;
}

.hexagon-pattern {
    background: #3b82f6;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 2px, transparent 2px);
    background-size: 10px 8px;
    background-position: 0 0, 5px 4px;
}

.circuit-pattern {
    background: #3b82f6;
    background-image: 
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 4px 4px, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 8px 8px, 8px 8px, 8px 8px;
}

.gradient-pattern {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

@media (max-width: 640px) {
    .pattern-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.375rem;
    }
    
    .pattern-btn {
        min-width: 50px;
        padding: 0.375rem;
        font-size: 0.7rem;
    }
    
    .pattern-preview {
        width: 28px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .pattern-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Pattern Controls Styles */
.pattern-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pattern-selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pattern-selector-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pattern-select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.pattern-select:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.pattern-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
/* Icon Controls Styles */
.icon-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.icon-selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.icon-selector-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.icon-select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.icon-select:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.icon-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
