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

body {
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  background: #111;
  color: #eee;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, #1a1a2e 0%, #111 100%);
  border-bottom: 1px solid #2a2a3e;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

header p {
  margin-top: 8px;
  color: #888;
  font-size: 0.95rem;
}

/* 탭 */
.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px 24px 0;
  background: #111;
  border-bottom: 1px solid #2a2a3e;
}

.tab-btn {
  padding: 10px 28px;
  background: transparent;
  color: #666;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: #aaa;
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: #8b7fe8;
}

.tab-content {
  display: none;
}

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

.load-error {
  color: #888;
  text-align: center;
  padding: 40px 0;
}

/* 지점 탭 */
#branch-map {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #1c1c1c;
  margin-bottom: 24px;
}

#branch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}

#branch-list::-webkit-scrollbar {
  width: 4px;
}

#branch-list::-webkit-scrollbar-track {
  background: transparent;
}

#branch-list::-webkit-scrollbar-thumb {
  background: #3a3a5a;
  border-radius: 4px;
}

.branch-item {
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.branch-item:hover {
  border-color: #4a4a6a;
}

.branch-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.branch-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.branch-address {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #888;
}

.branch-theme-tag {
  padding: 3px 10px;
  background: #1a1a2e;
  color: #aaa;
  border: 1px solid #2a2a4a;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.branch-theme-tag:hover {
  background: #2a2a4e;
  color: #ccc;
  border-color: #4a4a8a;
}

.branch-link {
  display: block;
  margin-top: 10px;
  margin-left: auto;
  padding: 5px 14px;
  background: #1e1a3a;
  color: #8b7fe8;
  border: 1px solid #3a2a6a;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  width: fit-content;
  transition: background 0.2s, border-color 0.2s;
}

.branch-link:hover {
  background: #2a2450;
  border-color: #6a5aaa;
}

.map-info {
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #111;
  line-height: 1.5;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

#theme-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

#theme-search,
#branch-search {
  padding: 6px 14px;
  background: transparent;
  color: #ccc;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  width: 200px;
}

#theme-search {
  margin-left: auto;
}

#theme-search::placeholder,
#branch-search::placeholder {
  color: #444;
}

#theme-search:focus,
#branch-search:focus {
  border-color: #4a4a6a;
}

#branch-filters {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 6px 18px;
  background: transparent;
  color: #444;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  filter: grayscale(1);
}

.filter-btn:hover {
  color: #aaa;
  border-color: #4a4a6a;
}

.filter-btn.active {
  color: #fff;
  background: #1e1a3a;
  border-color: #8b7fe8;
  filter: grayscale(0);
}

#card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* 카드 */
.card {
  background: #1c1c1c;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #4a4a6a;
}

/* 이미지 영역 */
.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #444;
}

.no-image svg {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}

.no-image span {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* 카드 내용 */
.card-body {
  padding: 20px;
  padding-bottom: 52px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.card-branch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-branch {
  font-size: 0.82rem;
  color: #888;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title-row .card-title {
  flex: 1;
}

.card-date {
  font-size: 0.78rem;
  color: #666;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-reserve-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 5px 14px;
  background: #1e1a3a;
  color: #8b7fe8;
  border: 1px solid #3a2a6a;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  width: fit-content;
  transition: background 0.2s, border-color 0.2s;
}

.card-reserve-btn:hover {
  background: #2a2450;
  border-color: #6a5aaa;
}

/* 결과 배지 */
.card-result {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  width: fit-content;
}

.result-성공 {
  background: #1a3a2a;
  color: #4ecb71;
  border: 1px solid #2a5a3a;
}

.result-추천 {
  background: #1e1a3a;
  color: #8b7fe8;
  border: 1px solid #3a2a6a;
}

.result-미정 {
  background: #2a2a2a;
  color: #888;
  border: 1px solid #3a3a3a;
}

/* 테마 상세 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  position: relative;
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #ccc;
  font-size: 1rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.15);
}

.modal-image {
  width: 100%;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-image:not(:has(img)) {
  min-height: 140px;
}

.modal-image .no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #444;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  flex: 1;
}

.modal-result {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.modal-branch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-branch {
  font-size: 0.9rem;
  color: #888;
}

.modal-date {
  font-size: 0.82rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-reserve-btn {
  display: block;
  margin-top: 6px;
  margin-left: auto;
  padding: 8px 20px;
  background: #1e1a3a;
  color: #8b7fe8;
  border: 1px solid #3a2a6a;
  border-radius: 8px;
  font-size: 0.88rem;
  text-decoration: none;
  width: fit-content;
  transition: background 0.2s, border-color 0.2s;
}

.modal-reserve-btn:hover {
  background: #2a2450;
  border-color: #6a5aaa;
}

.modal-reserve-btn[hidden] {
  display: none;
}
