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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f9fafb;
  color: #1f2937;
  line-height: 1.5;
}

/* 상단 안내 배너 */
.info-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
}

.info-icon {
  font-size: 1.25rem;
}

.app {
  display: flex;
  height: calc(100vh - 48px); /* 배너 높이만큼 빼기 */
  overflow: hidden;
}

/* 왼쪽 모듈 패널 */
.module-panel {
  width: auto;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 1rem;
  overflow-y: auto;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

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

/* 모듈 카드 */
.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: white;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  min-height: 70px;
}

.module-card:active {
  cursor: grabbing;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.module-card.dragging {
  opacity: 0.5;
}

.module-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.module-name {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* 오른쪽 기능 영역 */
.drop-zone-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

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

.btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn .icon {
  font-size: 1rem;
}

.btn-blue {
  background-color: #3b82f6;
}

.btn-blue:hover {
  background-color: #2563eb;
}

.btn-green {
  background-color: #10b981;
}

.btn-green:hover {
  background-color: #059669;
}

.btn-red {
  background-color: #ef4444;
}

.btn-red:hover {
  background-color: #dc2626;
}

.btn-fff {
  background-color: #6d3d69;
}

.btn-fff:hover {
  background-color: #522e5a;
}

.pockets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 포켓 존 */
.pocket-zone {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.pocket-header {
  background: #f9fafb;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pocket-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.pocket-title-input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  outline: none;
}

.pocket-title-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pocket-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-btn {
  padding: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: #e5e7eb;
}

.icon-btn.delete:hover {
  background: #fee2e2;
}

.icon-btn.save:hover {
  background: #d1fae5;
}

.icon-btn.cancel:hover {
  background: #fee2e2;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.pocket-drop-area {
  min-height: 300px;
  padding: 1rem;
  transition: background-color 0.2s;
}

.pocket-drop-area.drag-over {
  background-color: #eff6ff;
}

.pocket-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  font-size: 0.875rem;
}

.pocket-modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.pocket-module {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: white;
  font-size: 0.875rem;
}

.pocket-module .module-icon {
  font-size: 1rem;
  margin-bottom: 0;
}

.pocket-module .module-name {
  font-size: 0.875rem;
}

.remove-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pocket-module:hover .remove-btn {
  opacity: 1;
}

.remove-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.remove-btn svg {
  width: 0.75rem;
  height: 0.75rem;
  color: white;
}

/* 모달 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-icon {
  font-size: 2rem;
}

.modal-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-content p {
  color: #6b7280;
  margin-bottom: 1rem;
}

.features-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

#modal-features {
  list-style: none;
  padding: 0;
}

#modal-features li {
  padding: 0.5rem;
  background: #f9fafb;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
  color: #374151;
  font-size: 0.875rem;
}

/* 색상 클래스 */
.bg-blue-500 { background-color: #3b82f6; }
.bg-green-500 { background-color: #10b981; }
.bg-teal-500 { background-color: #14b8a6; }
.bg-purple-500 { background-color: #a855f7; }
.bg-red-500 { background-color: #ef4444; }
.bg-orange-500 { background-color: #f97316; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-pink-500 { background-color: #ec4899; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-cyan-500 { background-color: #06b6d4; }
.bg-lime-500 { background-color: #84cc16; }
.bg-emerald-500 { background-color: #10b981; }
.bg-sky-500 { background-color: #0ea5e9; }
.bg-violet-500 { background-color: #8b5cf6; }
.bg-fuchsia-500 { background-color: #d946ef; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-yellow-500 { background-color: #eab308; }
.bg-blue-600 { background-color: #2563eb; }
.bg-gray-500 { background-color: #6b7280; }

/* 반응형 */
@media (max-width: 1024px) {
  .pockets-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .module-panel {
    width: 100%;
    max-height: 40vh;
  }

  .pockets-grid {
    grid-template-columns: 1fr;
  }
}