/*!
 * OHMYGIRL COMMUNITY
 * https://ohmygirl.cc
 *
 * 오마이걸 커뮤니티 전용 코드
 *
 * Version  : 0.1
 * Released : 2026-03-23
 *
 * Author   : OHMYGIRL COMMUNITY
 * License  : Exclusive License - OHMYGIRL COMMUNITY Only
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=DM+Serif+Display&display=swap');

  :root {
    --bg: #faf9f7;
    --surface: #ffffff;
    --border: #ebebeb;
    --text: #1a1a1a;
    --text-sub: #888;
    --accent: #d4568a;
    --radius: 14px;
  }

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

  body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
  }

  .header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1;
  }
  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
  }
  .month-title {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
  }
  .month-title:hover { color: var(--accent); }
  .month-title .fa-chevron-down {
    font-size: 13px;
    color: var(--text-sub);
    transition: color .15s;
  }
  .month-title:hover .fa-chevron-down { color: var(--accent); }
  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    color: var(--text-sub);
    font-size: 18px;
    border-radius: 8px;
    transition: background .15s;
    line-height: 1;
  }
  .nav-btn:hover { background: var(--border); }

  .today-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 8px;
    color: var(--text-sub);
    font-size: 14px;
    transition: all .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .today-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fdf0f6;
  }

  .toggle-view-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 8px;
    color: var(--text-sub);
    transition: all .18s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .toggle-view-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fdf0f6;
  }
  .toggle-view-btn.cal-mode {
    border-color: var(--accent);
    color: var(--accent);
    background: #fdf0f6;
  }

  .labels-row {
    display: flex;
    gap: 8px;
    padding-bottom: 14px;
    flex-wrap: wrap;
  }
  .label-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s;
    color: var(--text);
    white-space: nowrap;
  }
  .label-chip:hover { border-color: #ccc; }
  .label-chip.active.chip-all {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
  }
  .label-chip.active:not(.chip-all) {
    border-color: transparent;
    color: #333;
  }
  .label-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 5px 5px;
  }

  .list-day + .list-day .day-header { border-top: 1px solid var(--border); }
  .day-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 18px 0 10px;
  }
  .day-num {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--text);
    min-width: 36px;
    line-height: 1;
  }
  .day-num.today { color: var(--accent); }
  .day-week {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 400;
    letter-spacing: 0.5px;
  }
  .day-week.sun { color: #e05555; }
  .day-week.sat { color: #4a7fc1; }

  .event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 6px;
  }
  .event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform .12s, box-shadow .12s;
  }
  .event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  .event-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
  }
  .event-info { flex: 1; min-width: 0; }
  .event-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .event-meta {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
  }
  .event-label-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
  }

  .cal-view { display: none; }
  .cal-view.show { display: block; }
  .list-view.hide { display: none; }

  .cal-grid {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
  }
  .cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
  }
  .cal-wd {
    padding: 10px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
  }
  .cal-wd:first-child { color: #e05555; }
  .cal-wd:last-child  { color: #4a7fc1; }

  .cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); }
  .cal-cell {
    height: 120px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .cal-cell:nth-child(7n) { border-right: none; }
  .cal-cell.other-month { background: #fafafa; }
  .cal-cell.today-cell  { background: #fff8fb; }

  .cal-day-num {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
    padding-right: 4px;
    flex-shrink: 0;
  }
  .cal-cell:nth-child(7n+1) .cal-day-num { color: #e05555; }
  .cal-cell:nth-child(7n)   .cal-day-num { color: #4a7fc1; }
  .cal-cell.other-month .cal-day-num { color: #ccc; }
  .cal-cell.today-cell .cal-day-num {
    padding-right: 2px;
  }
  .cal-cell.today-cell .cal-day-num span {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
  }

  .cal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; flex: 1; min-height: 0; }
  .cal-event-dot {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    font-weight: 500;
    line-height: 1.5;
    flex-shrink: 0;
  }
  .cal-more-btn {
    font-size: 10px;
    color: var(--text-sub);
    padding: 1px 6px;
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    background: none;
    text-align: left;
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.5;
  }
  .cal-more-btn:hover { color: var(--accent); }

  .empty-state, .loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-sub);
    font-size: 14px;
  }
  .spinner {
    width: 28px; height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 14px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  @media (max-width: 520px) {
    .main { padding: 15px 5px 5px; }
    .header { padding: 0 12px; }
    .month-title { font-size: 19px; }

    .cal-grid {
      border-radius: 10px;
    }

    .cal-cell {
      min-height: 70px;
      height: 62px;
      padding: 5px 3px;
    }

    .cal-day-num {
      font-size: 11px;
      font-weight: 400;
      justify-content: flex-start;
      padding-right: 0;
      padding-left: 3px;
      margin-bottom: 4px;
      line-height: 1;
    }

    .cal-cell.today-cell .cal-day-num {
      padding-right: 0;
      padding-left: 2px;
      align-items: center;
      flex-direction: row;
      gap: 1px;
    }

    .cal-cell.today-cell .cal-day-num span {
      width: 20px;
      height: 20px;
      font-size: 11px;
      line-height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .cal-wd {
      padding: 7px 0;
      font-size: 11px;
    }

    .cal-events {
      gap: 2px;
    }

    .cal-event-dot {
      display: none;
    }

    .cal-event-mobile-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .cal-event-mobile-dots {
      display: flex;
      flex-wrap: wrap;
      gap: 3px;
      padding-left: 2px;
    }
  }

  @media (min-width: 521px) {
    .cal-event-mobile-dot { display: none; }
    .cal-event-mobile-dots { display: none; }
  }

  .month-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,.35);
    align-items: flex-start;
    justify-content: center;
    padding-top: 70px;
  }
  .month-picker-overlay.open { display: flex; }
  .month-picker-modal {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    width: min(90vw, 360px);
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    animation: fadeUp .22s cubic-bezier(.22,1,.36,1) both;
  }
  @keyframes fadeUp {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
  }
  .mp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .mp-year-group {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mp-year-nav {
    background: none; border: none; cursor: pointer;
    font-size: 16px; color: var(--text-sub);
    padding: 4px 10px; border-radius: 8px;
    transition: background .15s;
  }
  .mp-year-nav:hover { background: var(--border); }
  .mp-year-label {
    font-family: 'DM Serif Display', serif;
    font-size: 22px; font-weight: 400;
  }
  .mp-close {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: var(--text-sub);
    padding: 4px 8px; border-radius: 8px;
    transition: background .15s; line-height:1;
  }
  .mp-close:hover { background: var(--border); }
  .mp-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .mp-month-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all .18s;
    color: var(--text-sub);
  }
  .mp-month-btn:hover { border-color: var(--accent); color: var(--accent); }
  .mp-month-btn.has-events { font-weight: 700; color: var(--text); }
  .mp-month-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
  }

  .event-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(0,0,0,.35);
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .event-detail-overlay.open { display: flex; }
  .event-detail-modal {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 20px;
    width: min(90vw, 460px);
    box-shadow: 0 12px 48px rgba(0,0,0,.2);
    animation: fadeUp .22s cubic-bezier(.22,1,.36,1) both;
    position: relative;
  }
  .ed-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: var(--text-sub);
    padding: 4px 8px; border-radius: 8px;
    transition: background .15s; line-height:1;
  }
  .ed-close:hover { background: var(--border); }
  .ed-label-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500;
    padding: 4px 12px; border-radius: 999px;
    margin-bottom: 12px;
  }
  .ed-title {
    font-size: 18px; font-weight: 500;
    color: var(--text); margin-bottom: 16px;
    line-height: 1.4;
  }
  .ed-divider { height:1px; background: var(--border); margin-bottom: 16px; }
  .ed-time { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; }
  .ed-footer {
    display: flex; justify-content: flex-start;
  }
  .ed-share-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-sub);
    transition: all .18s;
    display: flex; align-items: center; justify-content: center;
  }
  .ed-share-btn:hover { border-color: var(--accent); color: var(--accent); background: #fdf0f6; }

  .toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(26,26,26,.9);
    color: #fff;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    padding: 12px 22px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9200;
    white-space: nowrap;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  @media (max-width: 520px) {
    .toast {
      bottom: 80px;
    }
  }

  .cal-event-dot {
    cursor: pointer;
    pointer-events: auto;
  }
  .event-item {
    cursor: pointer;
    pointer-events: auto;
  }