@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: #eff6ff;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  --surface: rgba(255, 255, 255, 0.65);
  --surface-solid: #ffffff;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --border: rgba(255, 255, 255, 0.8);

  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
  --radius-md: 16px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
  font-family:
    "Pretendard",
    -apple-system,
    sans-serif;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  padding: 30px 14px 80px;
  min-height: 100vh;
}

.page-wrap {
  max-width: 1080px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.3) 0%,
    transparent 70%
  );
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.hero p {
  margin: 0;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.hero-badges {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

#registerPanel {
  background: var(--surface-solid);
  margin-top: 40px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-sub {
  color: var(--text-sub);
  font-size: 15px;
  margin-bottom: 24px;
}

.form-control {
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: #f1f5f9;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: none !important;
  transition: all 0.2s ease;
  padding: 0 16px;
}

.form-control:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px var(--primary-soft) !important;
}

label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.btn-main,
.btn-soft {
  border: none;
  border-radius: var(--radius-md);
  height: 52px;
  padding: 0 24px;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-main {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-main:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-soft {
  background: #ffffff;
  color: var(--text-main);
  height: 44px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.btn-soft:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-box .form-control {
  height: 44px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid transparent;
  background: var(--surface-solid);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.chip:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.chip.active {
  background: var(--text-main);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  padding: 4px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 860px;
}

thead th {
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  border: none;
}

tbody tr {
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  border-radius: 16px;
}

tbody tr:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--shadow-md);
  z-index: 2;
  position: relative;
}

tbody td {
  padding: 20px;
  border: none;
  vertical-align: middle;
  font-size: 15px;
  font-weight: 500;
}

tbody td:first-child {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

tbody td:last-child {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.restaurant-name a {
  background: linear-gradient(135deg, #1d4ed8 0%, #0f766e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  padding: 2px 0;
}

.restaurant-name a:hover {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 4px 8px rgba(29, 78, 216, 0.25));
}

.restaurant-name a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, #1d4ed8 0%, #0f766e 100%);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.restaurant-name a:hover::after {
  width: 100%;
}

.menu-badge {
  display: inline-block;
  background: #fff7ed;
  color: #ea580c;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.location-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.hours-text {
  color: var(--text-sub);
}

.delete-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.delete-btn:hover {
  background: #fecaca;
  transform: translateY(-2px);
}

.like-btn {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.like-btn:hover {
  background: #fce7f3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(219, 39, 119, 0.15);
}

.like-btn i {
  font-size: 14px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.status-text {
  font-size: 14px;
  font-weight: 600;
  color: #3b82f6;
}

.summary-box {
  display: flex;
  gap: 10px;
}

.summary-pill {
  background: var(--surface-solid);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.updated-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

.footer-note {
  margin-top: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

/* TOP 버튼 완벽 중앙 정렬 CSS */
.back-to-top {
  display: none; /* JS가 스크롤 시 inline-flex로 바꿔줌 */
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px; /* 가로 크기 고정 */
  height: 56px; /* 세로 크기 고정 */
  background: #0f172a; /* 배경색 */
  color: #fff;
  border-radius: 50%; /* 완벽한 원형 */
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.25);
  z-index: 9999;

  /* 글자와 화살표 정중앙 맞추기 (핵심) */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 0; /* 불필요한 여백 제거 */
}

.back-to-top i {
  font-size: 16px;
  margin-bottom: 2px; /* 아이콘과 글자 사이 간격 */
}

.back-to-top:hover {
  transform: translateY(-4px);
  color: white;
  text-decoration: none;
}

/* 여기서부터 복사해서 맨 아래에 덮어쓰세요 */
@media (max-width: 768px) {
  /* 1. 바디와 패널의 좌우 여백을 완전히 없애 가로폭을 100% 활용합니다 */
  body {
    padding: 0 0 80px 0;
  }

  .hero {
    border-radius: 0 0 20px 20px;
    padding: 32px 16px;
    margin-bottom: 16px;
  }

  .panel {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 24px 16px;
  }

  /* 2. 상단 버튼들도 가로폭을 1/n씩 꽉 차게 나눠 가집니다 */
  .toolbar-left {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .btn-soft {
    flex: 1;
    padding: 0;
    font-size: 13px;
  }

  .search-box {
    width: 100%;
    margin-top: 8px;
  }

  /* 3. 테이블을 꽉 찬 카드 형태로 변환 */
  .table-wrap {
    border: none;
    background: transparent;
    padding: 0;
  }

  table {
    min-width: 100%;
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
  }

  /* 4. 카드 디자인: CSS Grid를 사용해 위치를 바둑판처럼 완벽히 고정합니다 */
  tbody tr {
    display: grid;
    /* 가로를 4칸으로 쪼갭니다: [자동크기] [남는공간전부] [자동크기] [자동크기] */
    grid-template-columns: auto 1fr auto auto;
    padding: 16px 14px;
    margin-bottom: 12px;
    align-items: center;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    row-gap: 12px; /* 1층과 2층 사이 간격 */
    column-gap: 8px; /* 좌우 항목 사이 간격 */
    border: 1px solid #e2e8f0;
  }

  tbody td {
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
  }

  /* [1층] 메뉴와 상호명 (절대 아래로 내려가지 않음) */
  tbody td:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1;
  } /* 메뉴 뱃지 */
  tbody td:nth-child(2) {
    grid-column: 2 / 5;
    grid-row: 1;
    font-size: 17px;
  } /* 상호명 */

  /* [2층] 위치, 시간, 버튼들 (절대 위로 올라가지 않음) */
  tbody td:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2;
  } /* 위치 뱃지 */
  tbody td:nth-child(4) {
    grid-column: 2 / 3;
    grid-row: 2;
    font-size: 13px;
    color: #64748b;
  } /* 영업시간 */
  tbody td:nth-child(5) {
    grid-column: 3 / 4;
    grid-row: 2;
  } /* 추천 하트 */
  tbody td:nth-child(6) {
    grid-column: 4 / 5;
    grid-row: 2;
  } /* 삭제 휴지통 */

  /* 요소 배치 (가로 공간 효율적 분할) */
  tbody td:nth-child(1) {
    width: auto;
  }

  tbody td:nth-child(2) {
    flex: 1 1 50%;
    font-size: 17px;
  }

  tbody td:nth-child(3) {
    width: auto;
  }
  tbody td:nth-child(4) {
    flex: 1;
    font-size: 13px;
    color: #64748b;
  }

  tbody td:nth-child(5) {
    margin-left: auto;
  }
  tbody td:nth-child(6) {
    margin-left: 8px;
  }
}
/* 여기까지 입니다 */

/* 스크롤 안내 문구 (PC에선 숨기고 모바일에서만 표시) */
.mobile-scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  .mobile-scroll-hint {
    display: block;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
    animation: swipeHint 1.5s infinite;
  }
}

@keyframes swipeHint {
  0% {
    transform: translateX(0);
    opacity: 0.7;
  }
  50% {
    transform: translateX(-5px);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 0.7;
  }
}
