:root {
  --pink: #FF6B9D;
  --cyan: #00D4FF;
  --dark: #0a0812;
  --card: #13101c;
  --border: rgba(255, 107, 157, 0.15);
}

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

html, body, #root {
  height: 100%;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--dark);
  color: #fff;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

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

.logo-berry {
  font-size: 26px;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  color: var(--cyan);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.header-link:hover { opacity: 1; }

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export {
  background: linear-gradient(135deg, var(--pink), #ff8e53);
  color: #fff;
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.btn-primary {
  background: var(--pink);
  color: #fff;
}

.btn-primary:hover {
  background: #ff8e9d;
}

.btn-full { width: 100%; }

/* Main layout */
.main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: rgba(255, 107, 157, 0.1);
  border-color: var(--pink);
}

.preset-btn.active {
  background: rgba(255, 107, 157, 0.2);
  border-color: var(--pink);
}

.preset-icon { font-size: 20px; }
.preset-name { font-size: 10px; opacity: 0.8; text-align: center; line-height: 1.2; }

.color-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.color-picker label {
  font-size: 13px;
  opacity: 0.7;
}

.color-picker input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

.text-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
}

.text-input:focus {
  outline: none;
  border-color: var(--pink);
}

/* Canvas area */
.canvas-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #08060d;
}

.preview-canvas {
  max-width: 100%;
  max-height: calc(100% - 60px);
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(255, 107, 157, 0.15);
}

.canvas-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.control-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(255, 107, 157, 0.15);
  border-color: var(--pink);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
}

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

.modal-header h2 {
  font-size: 18px;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover { background: var(--pink); }
.modal-close:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.form-group select,
.form-group input[type="text"] {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--pink);
}

.form-group input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  appearance: none;
}

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

.export-info {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 18px;
}

.export-info p {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.7);
  margin: 4px 0;
}

.export-progress {
  padding: 40px 20px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  transition: width 0.2s;
}

.progress-percent {
  font-size: 32px;
  font-weight: 700;
  color: var(--pink);
  font-family: 'JetBrains Mono', monospace;
}

.progress-status {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

.error-msg {
  margin: 16px 20px 0;
  padding: 12px;
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-radius: 8px;
  color: #FF5252;
  font-size: 13px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.hw-badge {
  background: linear-gradient(135deg, var(--cyan), #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

/* Footer */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.footer a {
  color: var(--pink);
  text-decoration: none;
}

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

.badge {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.warning {
  color: #ffa726;
}

.divider {
  color: rgba(255,255,255,0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .main {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .preset-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}