/* ===============================
   BC Attendance Refined (수정완료)
=============================== */

.bc-att-wrapper {
    background: #fff;
    padding: 20px;
    font-family: 'Malgun Gothic', dotum, sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}

/* --- 상단 타이틀 & 보너스 안내 --- */
.bc-att-header-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.bc-att-header-title .main-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}
.bc-att-header-title .main-title .highlight { color: #e53935; }

/* 시간 강조 */
.bc-att-header-title .current-time-box {
    font-size: 14px;
    color: #444;
}
.bc-att-header-title .time-point {
    font-size: 22px;
    font-weight: 900;
    color: #e53935;
    letter-spacing: -0.5px;
    margin: 0 4px;
}
.bc-att-header-title .date { color: #888; font-size: 14px; margin-left: 2px; }

/* ✅ 개근 보너스 가이드 칩 */
.bc-bonus-guide {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.bc-bonus-guide .guide-label {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}
.bc-bonus-guide .guide-chips {
    display: flex;
    gap: 6px;
}
.bc-bonus-guide .chip {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
}
.bc-bonus-guide .chip.c-10 { background: #4caf50; }
.bc-bonus-guide .chip.c-20 { background: #2196f3; }
.bc-bonus-guide .chip.c-30 { background: #9c27b0; }

.header-divider {
    border: 0;
    border-top: 2px solid #333;
    margin: 0 0 20px 0;
}

/* --- 달력 --- */
.bc-calendar-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 15px;
}
.bc-calendar-header .year { font-size: 20px; font-weight: bold; margin-right: 5px; }
.bc-calendar-header .month { font-size: 28px; font-weight: bold; }

.bc-calendar-wrap { margin-bottom: 20px; }
.bc-calendar {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid #5d6b7a;
    table-layout: fixed; /* 칸 너비 고정 */
}
.bc-calendar th {
    background: #5d6b7a;
    color: #fff;
    padding: 10px 0;
    font-weight: normal;
    font-size: 13px;
    text-align: center;
}
.bc-calendar td {
    height: 80px; 
    border: 1px solid #e5e5e5;
    vertical-align: top;
    padding: 5px;
    width: 14.28%; 
    position: relative;
    box-sizing: border-box;
}
.bc-calendar th.sun, .bc-calendar th.sat { background: #5d6b7a; }
.bc-calendar td.sun .day-num { color: #e53935; }
.bc-calendar td.sat .day-num { color: #1e88e5; }
.bc-calendar td .day-num { font-size: 12px; display: block; margin-bottom: 5px; }

/* 날짜 숫자 위치 */
.bc-calendar td .cnt {
    display: block;
    position: absolute;
    bottom: 5px;
    right: 5px;
    text-align: right;
    color: #e53935;
    font-weight: bold;
    font-size: 14px;
    margin: 0;
}

/* --- 하단 정보 & 버튼 --- */
.bc-att-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.bc-att-footer-info .time-rule { font-weight: bold; font-size: 14px; }
.bc-att-footer-info .footer-btns { display: flex; gap: 10px; }
.bc-att-footer-info .f-btn {
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    background: #fff;
}

.bc-att-divider-red { border-top: 2px solid #e53935; margin-bottom: 20px; }

.bc-att-action-row.center-mode {
    background: #f9f9f9;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #eee;
    margin-bottom: 20px;
    border-radius: 5px;
}
.bc-att-action-row .att-submit-btn {
    background: #666; 
    color: #fff;
    padding: 12px 40px; 
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}
a.att-submit-btn { background: #e53935 !important; }
.bc-att-action-row .att-submit-btn.done { background: #999; cursor: default; }


/* --- 랭킹 (PC 테이블) --- */
.bc-att-rank-table-wrap {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}
.bc-att-rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bc-att-rank-table thead th {
    background: #4a5568; 
    color: #fff;
    padding: 12px;
    font-weight: normal;
    text-align: center;
}
.bc-att-rank-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
    color: #333;
}
.bc-att-rank-table .cell-rank { width: 80px; }
.bc-att-rank-table .cell-nick .nick-wrap {
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 6px; 
}
.bc-lv { height: 18px; vertical-align: middle; }
.bc-att-rank-table .cell-point { font-weight: bold; }
.bc-att-rank-table .cell-streak { color: #666; }
.bc-medal { font-size: 16px; }
.rank-num { color: #666; font-size: 14px; }
.badge-bonus {
    display: inline-block;
    background: #ff9800;
    color: #fff;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}


/* --- 랭킹 (Mobile 카드 리스트) --- */
.bc-mobile-list {
    /* 기본적으로 숨김 처리 (PC에서 안 보이게) */
    display: none; 
}
.m-empty { padding: 20px; text-align: center; color: #888; border: 1px solid #eee; }

.m-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.m-card-left { width: 40px; text-align: center; font-weight: bold; color: #555; }
.m-card-center { flex: 1; padding: 0 10px; }
.m-nick-line { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.bc-lv-m { height: 16px; }
.m-nick { font-weight: bold; font-size: 14px; color: #333; }
.m-time { font-size: 12px; color: #888; }
.m-card-right { text-align: right; }
.m-point { font-weight: bold; color: #111; font-size: 14px; }
.m-streak { font-size: 12px; color: #666; }
.badge-bonus-m { margin-left: 2px; font-size: 12px; }


/* --- 반응형 처리 (Display Toggle) --- */

/* 기본 (PC) */
.pc-only { display: block !important; }
.mobile-only { display: none !important; }

/* 991px 이하 (모바일/태블릿) */
@media (max-width: 991px){
    /* 1. 리스트 중복 해결: PC 테이블 숨기고 모바일 리스트 보이기 */
    .pc-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    .bc-att-wrapper { padding: 10px; }
    
    /* 2. 달력 늘어짐 해결 */
    .bc-calendar td { 
        height: 60px !important; /* 높이 강제 고정 */
        overflow: hidden; 
        padding: 2px !important; /* 여백 축소 */
    } 
    .bc-calendar th { padding: 5px 0; font-size: 12px; }
    .bc-calendar td .day-num { font-size: 11px; margin-bottom: 0; }
    .bc-calendar td .cnt { 
        font-size: 11px; 
        right: 2px; 
        bottom: 2px; 
    }

    /* 버튼 모바일 최적화 */
    .bc-att-action-row { padding: 10px; }
    .bc-att-action-row .att-submit-btn { width: 100%; justify-content: center; }

    /* 하단 정보 줄바꿈 */
    .bc-att-footer-info { flex-direction: column; align-items: flex-start; gap: 5px; }
    
    /* 개근 보너스 칩 작게 */
    .bc-bonus-guide .chip { font-size: 11px; padding: 3px 8px; }
}

/* =========================
   PC에서 내부 세로 스크롤(두번째 스크롤) 제거
   - 테마 래퍼에 height:100vh + overflow-y:auto 걸린 경우를 풀어줌
========================= */
@media (min-width: 992px){
  html, body{
    height: auto !important;
    overflow-y: auto !important;   /* 스크롤은 브라우저(body)로 */
  }

  /* 그누보드/테마에서 흔히 쓰는 래퍼들 */
  #wrapper, #wrap, #container, #content, #main, .container,
  .bc-wrap, .bc-container, .bc-content{
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* 출석부 래퍼도 혹시 몰라서 */
  .bc-att-wrapper{
    overflow: visible !important;
    max-height: none !important;
  }
}

/* =========================
   출석부 페이지: PC 내부 세로스크롤(.bc-body) 제거
========================= */
@media (min-width: 992px){
  .bc-att-page .bc-body{
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
  }

  /* 혹시 상위가 높이 고정이면 같이 풀기 */
  .bc-att-page .bc-wrap{
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

