:root {
  --bg-color: #f8f9fa;
  --paper-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #888888;
  --border-color: #e9ecef;
  --primary-color: #4a90e2;
  --sun-color: #e74c3c;
  --sat-color: #3498db;
  --ring-color: #d1d5db;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 15px 35px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px 10px;
}

.app-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* === Top Nav === */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}
.brand-logo { font-size: 24px; font-weight: 700; color: #222; }

.type-tabs {
  display: flex;
  background: #fff;
  border-radius: 30px;
  padding: 5px;
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  background: none; border: none; padding: 8px 24px; font-size: 15px; font-weight: 500;
  border-radius: 25px; cursor: pointer; color: var(--text-muted); transition: 0.2s;
}
.tab-btn.active { background: var(--primary-color); color: #fff; box-shadow: 0 2px 6px rgba(74,144,226,0.3); }

.admin-link {
  font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 8px 12px;
  border: 1px solid var(--border-color); border-radius: 20px; transition: 0.2s;
}
.admin-link:hover { background: #fff; color: var(--text-main); }


/* === Desk Calendar === */
.desk-calendar-container {
  position: relative;
  margin: 0 auto 40px;
  max-width: 800px;
}

/* Binding Rings */
.binding-rings {
  display: flex; justify-content: space-evenly; align-items: center;
  position: absolute; top: -15px; left: 0; right: 0; z-index: 10;
  padding: 0 20px; pointer-events: none;
}
.ring {
  width: 14px; height: 35px; background: linear-gradient(to right, #e0e0e0, #fff, #e0e0e0);
  border: 1px solid #b0b0b0; border-radius: 7px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.1);
}

/* Calendar Paper */
.calendar-paper {
  background: var(--paper-bg);
  border-radius: 8px;
  padding: 40px 30px 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  /* subtle paper texture effect */
  background-image: radial-gradient(#f4f4f4 1px, transparent 1px);
  background-size: 20px 20px;
  border-top: 20px solid #fcfcfc;
}

/* Calendar Header */
.cal-header {
  display: flex; justify-content: center; align-items: center; gap: 30px; margin-bottom: 25px;
}
.month-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; color: #111; }
.nav-btn {
  background: none; border: none; font-size: 24px; color: var(--text-muted);
  cursor: pointer; padding: 5px 15px; border-radius: 5px; transition: 0.2s;
}
.nav-btn:hover { background: #f0f0f0; color: #111; }

/* Calendar Grid */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--border-color); border: 1px solid var(--border-color);
  border-radius: 4px; overflow: hidden;
}
.cal-day-name {
  background: #fafafa; text-align: center; padding: 12px 0; font-size: 14px; font-weight: 500;
}
.cal-day-name.sun { color: var(--sun-color); }
.cal-day-name.sat { color: var(--sat-color); }

.cal-cell {
  background: #fff; min-height: 100px; padding: 8px;
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.cal-cell.other-month { background: #fdfdfd; }
.cal-cell.other-month .date-num { color: #ccc; }
.cal-cell.today .date-num {
  background: var(--primary-color); color: #fff; border-radius: 50%;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
}
.date-num { font-size: 14px; font-weight: 500; margin-bottom: 5px; align-self: flex-start; }
.cal-cell:nth-child(7n+1) .date-num { color: var(--sun-color); } /* Sunday */
.cal-cell:nth-child(7n) .date-num { color: var(--sat-color); } /* Saturday */

/* Deal Items in Calendar */
.deal-item {
  font-size: 11px; padding: 4px 6px; border-radius: 4px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; transition: transform 0.1s;
}
.deal-item:hover { transform: scale(1.02); filter: brightness(0.95); }
.deal-online { background: #e3f2fd; color: #1976d2; border-left: 3px solid #1976d2; }
.deal-offline { background: #fce4ec; color: #c2185b; border-left: 3px solid #c2185b; }


/* === Map Section === */
.map-section {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 20px; margin-bottom: 40px;
}
.map-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.map-header h3 { font-size: 18px; font-weight: 700; color: #222; }
.btn-location {
  background: #fff; border: 1px solid var(--border-color); padding: 8px 16px;
  border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn-location:hover { background: #f8f9fa; }

.kakao-map {
  width: 100%; height: 400px; background: #eef2f5; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative;
}
.map-overlay-msg { color: var(--text-muted); font-size: 14px; }


/* === Modal === */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-backdrop {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.modal-content {
  position: relative; background: #fff; width: 90%; max-width: 400px;
  border-radius: 12px; padding: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  z-index: 1; text-align: center;
}
.btn-close {
  position: absolute; top: 15px; right: 15px; background: none; border: none;
  font-size: 24px; color: var(--text-muted); cursor: pointer;
}
.deal-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  margin-bottom: 15px;
}
.deal-badge.online { background: #e3f2fd; color: #1976d2; }
.deal-badge.offline { background: #fce4ec; color: #c2185b; }

.deal-brand { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: #111; }
.deal-discount { font-size: 18px; font-weight: 700; color: var(--sun-color); margin-bottom: 15px; }
.deal-date { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; }
.deal-details { font-size: 14px; color: #555; margin-bottom: 15px; background: #f9f9f9; padding: 10px; border-radius: 6px;}
.deal-memo { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }

.btn-action {
  display: inline-block; width: 100%; background: var(--primary-color); color: #fff;
  padding: 12px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: 0.2s;
}
.btn-action:hover { background: #3a7bc8; }

/* Map custom overlay */
.custom-overlay-cust {
  background: #fff; border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); color: #333; font-size: 12px; font-weight: 600;
  transform: translate(-50%, -130%); cursor: pointer; display: flex; flex-direction: column; align-items: center;
}
.custom-overlay-cust::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  border-width: 6px 6px 0; border-style: solid; border-color: #fff transparent transparent transparent;
}
.custom-overlay-cust strong { color: var(--sun-color); }


/* === More Button & Day Modal List === */
.deal-more-btn {
  font-size: 11px; color: var(--primary-color); font-weight: 700;
  cursor: pointer; text-align: center; margin-top: 2px; padding: 2px;
  background: #f0f7ff; border-radius: 4px;
}
.deal-more-btn:hover { background: #e0f0ff; }

.day-deal-item {
  padding: 12px; border: 1px solid var(--border-color); border-radius: 6px;
  cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; gap: 4px;
}
.day-deal-item:hover { background: #f8f9fa; border-color: #d0d0d0; transform: translateY(-1px); }
.day-deal-item .day-brand { font-weight: 700; color: #111; font-size: 15px; }
.day-deal-item .day-discount { color: var(--sun-color); font-size: 14px; font-weight: 600; }

@media (max-width: 768px) {
  .cal-cell { min-height: 80px; padding: 4px; }
  .deal-item { font-size: 10px; padding: 2px 4px; }
  .top-nav { flex-direction: column; }
  .calendar-paper { padding: 30px 15px 15px; }
  .binding-rings { padding: 0 10px; }
  .ring { height: 25px; width: 10px; }
}
