* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', '  Helvetica Neue',
    sans-serif;
  background: linear-gradient(135deg, #AAE2EA 0%, #64E2CD 100%);
  min-height: 100vh;
  color: #333;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.header-content h1 {
  font-size: 36px;
  font-weight: 700;
  color: #667eea;
  margin: 0;
}

.tagline {
  font-size: 16px;
  color: #666;
  font-weight: 300;
  margin: 0;
}

.main-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.content-section {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.preview-section {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.preview-section h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
  align-self: flex-start;
  width: 100%;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.tab-btn:hover {
  color: #667eea;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

/* Form Container */
.form-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
  flex: 1;
}

.tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Labels and Inputs */
label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.input-field {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-field::placeholder {
  color: #bbb;
}

/* File Input */
.file-input-wrapper {
  position: relative;
  display: block;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-label {
  display: block;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  background: #f9f9f9;
  transition: all 0.3s ease;
  cursor: pointer;
  color: #666;
  font-size: 14px;
}

.file-input-wrapper:hover .file-label {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.file-input-wrapper.active .file-label {
  border-color: #667eea;
  color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  width: 100%;
  margin-top: 20px;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Canvas Container */
.canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 300px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
  margin-bottom: 20px;
  flex: 1;
}

#canvas-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

#canvas-holder canvas {
  border-radius: 4px;
  max-width: 100%;
  max-height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-container {
    gap: 30px;
    padding: 0 15px;
  }

  .content-section,
  .preview-section {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
    gap: 20px;
    margin: 20px auto;
    padding: 0 15px;
  }

  .header {
    padding: 30px 20px;
  }

  .header-content h1 {
    font-size: 28px;
  }

  .tagline {
    font-size: 14px;
  }

  .content-section,
  .preview-section {
    padding: 24px;
  }

  .tabs {
    gap: 5px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 13px;
    min-width: 70px;
  }

  .canvas-container {
    min-height: 250px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 20px 15px;
  }

  .header-content h1 {
    font-size: 24px;
  }

  .main-container {
    margin: 15px auto;
    gap: 15px;
    padding: 0 10px;
  }

  .content-section,
  .preview-section {
    padding: 20px;
    border-radius: 8px;
  }

  .tabs {
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
  }

  .tab-btn {
    border-radius: 6px 6px 0 0;
    border-bottom: none;
    margin-bottom: 0;
    background: #f8f9fa;
    min-width: unset;
    flex: none;
  }

  .tab-btn.active {
    background: white;
    border-bottom: 2px solid #667eea;
  }

  .input-field {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    padding: 14px 20px;
    font-size: 14px;
  }

  .canvas-container {
    min-height: 200px;
    margin-bottom: 15px;
  }

  .preview-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
  }
}

@media (max-width: 360px) {
  .content-section,
  .preview-section {
    padding: 15px;
  }

  .header-content h1 {
    font-size: 20px;
  }

  .tabs {
    margin-bottom: 15px;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .input-field {
    padding: 12px 14px;
  }

  .btn {
    padding: 12px 16px;
  }
}