* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: #f9fafb;
  padding: 0;
}

/* ヘッダー */
.main-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.header-link:hover {
  color: #60a5fa;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.875rem;
  color: #1f2937;
}

h2 {
  font-size: 1.25rem;
  color: #1f2937;
  margin: 0;
  font-weight: 600;
}

.stamp-editor.collapsed h2 {
  font-size: 1rem;
  color: #4b5563;
  font-weight: 500;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-green {
  background: #059669;
  color: white;
}

.btn-green:hover {
  background: #047857;
}

.btn-blue {
  background: #2563eb;
  color: white;
}

.btn-blue:hover {
  background: #1d4ed8;
}

.btn-red {
  background: #dc2626;
  color: white;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
}

.btn-red:hover {
  background: #b91c1c;
}

.preview-box {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

#stampPreview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.stamp-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stamp-image {
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.25rem;
  background: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 120px;
  height: auto;
}

.stamp-image:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stamp-actions {
  display: flex;
  gap: 0.375rem;
}

/* プレビュー内のアクションボタン領域 */
.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
}

.preview-actions .btn {
  height: 40px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.preview-actions .btn span.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  margin-right: 0.25rem;
}

.stamp-action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stamp-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.stamp-action-btn.download {
  color: #059669;
  border-color: #059669;
}

.stamp-action-btn.download:hover {
  background: #059669;
  color: white;
}

.stamp-action-btn.edit {
  color: #2563eb;
  border-color: #2563eb;
}

.stamp-action-btn.edit:hover {
  background: #2563eb;
  color: white;
}

.stamp-action-btn.delete {
  color: #dc2626;
  border-color: #dc2626;
}

.stamp-action-btn.delete:hover {
  background: #dc2626;
  color: white;
}

.stamp-action-btn.copy {
  color: #7c3aed;
  border-color: #7c3aed;
}

.stamp-action-btn.copy:hover {
  background: #7c3aed;
  color: white;
}

.stamp-action-btn.duplicate {
  color: #ea580c;
  border-color: #ea580c;
}

.stamp-action-btn.duplicate:hover {
  background: #ea580c;
  color: white;
}

@keyframes highlight {
  0%, 100% {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
    transform: scale(1.02);
  }
}

.stamp-editor {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.stamp-editor.active {
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 2px solid #2563eb;
}

.stamp-editor.collapsed {
  padding: 0.75rem 1rem;
  background: #f9fafb;
}

.stamp-editor.collapsed:hover {
  background: #f3f4f6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.editor-header.clickable {
  cursor: pointer;
  user-select: none;
}

.editor-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.toggle-icon {
  font-size: 0.875rem;
  color: #6b7280;
  transition: transform 0.3s ease;
  min-width: 1rem;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.editor-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.stamp-editor.collapsed .editor-content {
  display: none;
}

.stamp-editor.active .editor-header {
  margin-bottom: 0;
}

.editor-preview {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  min-width: 200px;
  position: sticky;
  top: 1rem;
}

.editor-form {
  flex: 1;
  min-width: 0;
}

.preview-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.editor-stamp-preview {
  display: block;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

select, input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

input[type="range"] {
  width: 100%;
}

.section-card {
  background: #f9fafb;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.section-delete {
  color: #dc2626;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.section-delete:hover {
  color: #b91c1c;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.top-text-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d1d5db;
}

.info-box {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.5rem;
  padding: 1rem;
}

.info-box h3 {
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
}

.info-box ul {
  list-style: none;
  color: #1e40af;
  font-size: 0.875rem;
}

.info-box li {
  margin-bottom: 0.25rem;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* トースト通知 */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 400px;
  word-wrap: break-word;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-notification.toast-success {
  border-left: 4px solid #059669;
  color: #065f46;
}

.toast-notification.toast-error {
  border-left: 4px solid #dc2626;
  color: #991b1b;
}

.toast-notification.toast-info {
  border-left: 4px solid #2563eb;
  color: #1e40af;
}

/* ドロップゾーン */
.drop-zone {
  border: 2px dashed #3b82f6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background-color: rgba(59, 130, 246, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-zone:hover {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: #2563eb;
}

.drop-zone.drag-over {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: #1e40af;
  transform: scale(1.02);
}

.drop-zone-content {
  pointer-events: none;
}

.file-select-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: white;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  pointer-events: auto;
}

.file-select-btn:hover {
  background: #1d4ed8;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .editor-content {
    flex-direction: column;
    gap: 1rem;
  }

  .editor-preview {
    position: static;
    width: 100%;
    min-width: auto;
  }

  .editor-form {
    width: 100%;
  }
}

