/*
 * KPKP-折りたたみカード作成アプリ スタイルシート
 * 
 * Copyright (c) 2025 RE:SML
 * All Rights Reserved.
 */

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

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.header-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 32px;
  margin-bottom: 24px;
}

h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 8px;
}

.subtitle {
  color: #666;
  margin-bottom: 24px;
  line-height: 1.6;
}

.preset-section {
  background: #f0f4ff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.preset-section h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
}

.preset-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.preset-controls input[type="text"] {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

.preset-controls select {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.preset-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.preset-btn-save {
  background: #4CAF50;
  color: white;
}

.preset-btn-save:hover {
  background: #45a049;
}

.preset-btn-load {
  background: #2196F3;
  color: white;
}

.preset-btn-load:hover {
  background: #0b7dda;
}

.preset-btn-delete {
  background: #f44336;
  color: white;
}

.preset-btn-delete:hover {
  background: #da190b;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.option-group {
  padding: 16px;
  background: #f5f5f5;
  border-radius: 8px;
}

.option-group h3 {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.option-item input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.option-item label {
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  color: #555;
}

.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 968px) {
  .content {
    grid-template-columns: 1fr;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
}

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

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #ec407a;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.color-picker {
  display: flex;
  gap: 8px;
}

.color-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: #333;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #333;
}

.image-upload-area {
  width: 100%;
  padding: 48px 24px;
  border: 3px dashed #e0e0e0;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
}

.image-upload-area:hover {
  border-color: #ec407a;
  background: #fce4ec;
}

.image-upload-area.has-image {
  padding: 0;
  border: none;
  background: none;
  cursor: default;
}

.image-preview {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remove-image {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.3s;
}

.remove-image:hover {
  background: #d32f2f;
}

.upload-icon {
  font-size: 32px;
  color: #999;
  margin-bottom: 8px;
}

.upload-text {
  color: #666;
}

.slider-group {
  margin-top: 8px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #ec407a;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #d81b60;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #ec407a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #d81b60;
}

.slider-value {
  min-width: 50px;
  text-align: right;
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

.slider-value-input {
  width: 70px;
  padding: 4px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  text-align: right;
}

.slider-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.align-group {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.align-btn {
  flex: 1;
  padding: 6px 12px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.align-btn:hover {
  border-color: #ec407a;
}

.align-btn.active {
  background: #ec407a;
  color: white;
  border-color: #ec407a;
}

.download-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ec407a, #ab47bc);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(236, 64, 122, 0.3);
}

.download-btn:hover {
  background: linear-gradient(135deg, #d81b60, #8e24aa);
  box-shadow: 0 6px 16px rgba(236, 64, 122, 0.4);
  transform: translateY(-2px);
}

.preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 20px;
}

.preview-container {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.preview-wrapper {
  background: white;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

#cardCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-info {
  margin-top: 16px;
  text-align: center;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.instructions {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 32px;
}

.instructions h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #333;
}

.instructions h3 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #555;
  font-weight: 600;
}

.instructions ol {
  padding-left: 20px;
  color: #555;
  line-height: 1.8;
}

.instructions ol li {
  margin-bottom: 8px;
}

.note {
  margin-top: 16px;
  padding: 12px;
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  border-radius: 4px;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

input[type="file"] {
  display: none;
}

.section-divider {
  margin: 24px 0;
  padding: 12px;
  background: #e3f2fd;
  border-radius: 8px;
  font-weight: 600;
  color: #1976d2;
  text-align: center;
}

/* タブスタイル */
.main-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
}

.main-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s;
}

.main-tab:hover {
  color: #ec407a;
}

.main-tab.active {
  color: #ec407a;
  border-bottom-color: #ec407a;
}

.main-tab-content {
  display: none;
}

.main-tab-content.active {
  display: block;
}

/* 一括作成用のスタイル */
.batch-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.batch-section h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 16px;
}

.drop-zone {
  border: 3px dashed #e0e0e0;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  background: #fafafa;
  transition: all 0.3s;
  cursor: pointer;
  margin-bottom: 16px;
}

.drop-zone:hover {
  border-color: #ec407a;
  background: #fff5f8;
}

.drop-zone.dragover {
  border-color: #ec407a;
  background: #fff5f8;
  transform: scale(1.02);
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.drop-zone-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
}

.drop-zone-subtext {
  font-size: 14px;
  color: #999;
}

.uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.uploaded-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f4ff;
  border-radius: 8px;
  font-size: 14px;
}

.uploaded-file-name {
  color: #333;
}

.remove-file-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.remove-file-btn:hover {
  background: #cc0000;
}

.batch-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.batch-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  flex: 1;
  min-width: 200px;
}

.batch-btn-primary {
  background: #ec407a;
  color: white;
}

.batch-btn-primary:hover {
  background: #d81b60;
}

.batch-btn-secondary {
  background: #4CAF50;
  color: white;
}

.batch-btn-secondary:hover {
  background: #45a049;
}

.batch-btn-tertiary {
  background: #2196F3;
  color: white;
}

.batch-btn-tertiary:hover {
  background: #0b7dda;
}

.batch-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.preview-card-item {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s;
}

.preview-card-item:hover {
  border-color: #ec407a;
  box-shadow: 0 4px 12px rgba(236, 64, 122, 0.2);
}

.preview-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-card-canvas {
  width: 100%;
  border-radius: 4px;
}

.progress-container {
  margin-top: 24px;
  display: none;
}

.progress-bar-wrapper {
  width: 100%;
  height: 32px;
  background: #f0f0f0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ec407a, #f48fb1);
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.progress-text {
  text-align: center;
  color: #666;
  font-size: 14px;
}