/**
 * 승인제 일정 관련 스타일
 * Calendar Approval Styles
 */

/* ===== 토글 스위치 (calendarWrite.php) ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* 승인제 일정 옵션 레이아웃 */
.approval-required-option {
}

.approval-required-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.approval-required-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.approval-required-left .page-con__title {
    margin: 0;
    padding: 0;
}

.approval-required-right {
    flex-shrink: 0;
}

.approval-required-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* 승인제 일정 UI - view.php */
/* 참석 요청중 버튼 스타일 */
.members__apply.type--pending {
    background-color: #f5a623 !important;
    border-color: #f5a623 !important;
    color: #fff !important;
    font-weight: bold;
}

/* 참석 요청중 버튼 활성화 상태 */
.public__selected .members__apply.type--pending {
    background-color: #f5a623 !important;
    border-color: #f5a623 !important;
    color: #fff !important;
}

/* 승인 관리 버튼 스타일 */
.members__apply.type--manage {
    background-color: #4a90d9;
    border-color: #4a90d9;
    position: relative;
}

.members__apply.type--manage .badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff3b30;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.approval-status-text {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

.approval-status-text.rejected {
    color: #ff3b30;
}

.approval-required-notice {
    margin-top: 5px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* 승인 관리 팝업 - approvalList.php */
.approval-list__container {
    padding: 16px;
}

.approval-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.approval-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.approval-item.approved {
    border-color: #4cd964;
    background-color: #f0fff0;
}

.approval-item.rejected {
    border-color: #ff3b30;
    background-color: #fff5f5;
}

.approval-item__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.approval-item__info .thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.approval-item__info .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.approval-item__detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.approval-item__detail .name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.approval-item__detail .date {
    font-size: 12px;
    color: #999;
}

.approval-item__detail .date .by {
    color: #666;
}

.approval-item__detail .message {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.approval-item__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.approval-item__actions .btn-approve,
.approval-item__actions .btn-reject {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.approval-item__actions .btn-approve {
    background-color: #4cd964;
    color: #fff;
}

.approval-item__actions .btn-reject {
    background-color: #ff3b30;
    color: #fff;
}

.approval-item__status {
    flex-shrink: 0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.approved {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.rejected {
    background-color: #ffebee;
    color: #c62828;
}

.approval-empty {
    padding: 40px 20px;
    text-align: center;
}

.approval-empty__text {
    font-size: 14px;
    color: #999;
}

/* 탭 배지 */
.btn-my__tab .badge-count {
    background-color: #ff3b30;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 4px;
}

.btn-my__tab .count {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

/* 거절 사유 입력 팝업 */
.approval-reject-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.approval-reject-popup.hide {
    display: none;
}

.approval-reject-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.approval-reject-popup__content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 12px;
    z-index: 2;
    overflow: hidden;
}

.approval-reject-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.approval-reject-popup__header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.approval-reject-popup__header .btn-close {
    background: none;
    border: none;
    font-size: 0;
    cursor: pointer;
}

.approval-reject-popup__header .btn-close::before {
    content: '\00D7';
    font-size: 24px;
    color: #999;
}

.approval-reject-popup__body {
    padding: 16px;
}

.approval-reject-popup__body textarea {
    width: 100%;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
}

.approval-reject-popup__body textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

.approval-reject-popup__body .char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.approval-reject-popup__footer {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #eee;
}

.approval-reject-popup__footer .btn-cancel,
.approval-reject-popup__footer .btn-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.approval-reject-popup__footer .btn-cancel {
    background-color: #f5f5f5;
    color: #666;
}

.approval-reject-popup__footer .btn-confirm {
    background-color: #ff3b30;
    color: #fff;
}

/* 일정 작성 화면 - write.php */
.calendar-write .approval-required-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 캘린더 액션 버튼 내 배지 */
.calendar-action-btn {
    position: relative;
}

.calendar-action-btn .badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff3b30;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* 반응형 */
@media (max-width: 480px) {
    .approval-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .approval-item__actions {
        width: 100%;
    }

    .approval-item__actions .btn-approve,
    .approval-item__actions .btn-reject {
        flex: 1;
    }
}

/* 일정 정보(모임일/시간)의 날짜·시각 표기: 전역 word-break:break-all 때문에 모바일에서 '오전/오후' 등
   단어가 중간에 끊기므로, 이 값들만 keep-all로 되돌려 어절(공백) 단위로만 줄바꿈되게 한다. */
.club__info .con.con--datetime{word-break:keep-all;}
