/* 회원 고급 캘린더 */

.wr-cal-toolbar {
    max-width: 900px;
    margin: 0 auto 12px auto;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
}

.wr-cal-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wr-cal-hint {
    font-size: 13px;
    color: var(--text-secondary, #555);
    margin: 0;
    flex: 1 1 220px;
}

.wr-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid var(--border-color, #8b4513);
    background: var(--button-bg, #f4efe6);
    color: var(--button-text, #3d2914);
    cursor: pointer;
    white-space: nowrap;
}

.wr-cal-btn:hover {
    background: var(--link-hover, #e8d9c4);
}

.wr-cal-btn-pro {
    background: #8b4513;
    color: #fff;
    border-color: #6b3410;
}

.wr-cal-btn-pro:hover {
    background: #6b3410;
    color: #fff;
}

.wr-cal-btn-ghost {
    background: transparent;
}

td.wr-cal-clickable {
    cursor: pointer;
}

td.wr-cal-clickable:hover {
    background: var(--bg-secondary, #f7f3ee) !important;
}

.calendar-article.wr-cal-mode-pro .calendar-table tr:has(td.tb) {
    height: 96px;
}

.wr-cal-user {
    margin-top: 4px;
    text-align: left;
    white-space: normal;
    max-width: 100%;
}

.wr-cal-chip {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    padding: 1px 4px;
    margin: 2px 0 0 0;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wr-cal-chip-event {
    background: #efe4d4;
    color: #3d2914;
    border-left: 3px solid #8b4513;
}

.wr-cal-chip-memo {
    background: #eef4ea;
    color: #2f4f2f;
}

.wr-cal-chip-more {
    color: #666;
    font-weight: 600;
}

.wr-cal-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(20, 14, 8, 0.45);
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px;
    overflow: auto;
}

.wr-cal-panel.is-open {
    display: flex;
}

.wr-cal-panel-box {
    width: 100%;
    max-width: 480px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #222);
    border: 1px solid var(--border-color, #cbb89a);
    border-radius: 8px;
    padding: 16px 18px 18px;
    margin: auto;
}

.wr-cal-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.wr-cal-panel-head h3 {
    margin: 0;
    font-size: 18px;
}

.wr-cal-date {
    font-weight: 700;
    color: #8b4513;
}

.wr-cal-field {
    margin: 10px 0;
}

.wr-cal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.wr-cal-field input[type="text"],
.wr-cal-field input[type="time"],
.wr-cal-field input[type="date"],
.wr-cal-field input[type="number"],
.wr-cal-field select,
.wr-cal-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid var(--input-border, #ccc);
    background: var(--input-bg, #fff);
    color: var(--text-primary, #222);
    border-radius: 4px;
}

.wr-cal-field textarea {
    min-height: 64px;
    resize: vertical;
}

.wr-cal-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin: 6px 0;
}

.wr-cal-check input {
    margin: 0;
}

.wr-cal-times {
    display: flex;
    gap: 8px;
}

.wr-cal-times .wr-cal-field {
    flex: 1;
}

.wr-cal-remind-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.wr-cal-remind-head label {
    margin: 0;
}

.wr-cal-btn-plus {
    min-width: 28px;
    padding: 2px 8px;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
}

.wr-cal-btn-plus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wr-cal-remind-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wr-cal-remind-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.wr-cal-remind-row > select.wr-cal-remind-kind {
    flex: 1;
    width: auto;
    min-width: 0;
}

.wr-cal-remind-custom {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-secondary, #f7f7f7);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
}

.wr-cal-remind-row.is-custom .wr-cal-remind-custom {
    display: flex;
}

.wr-cal-remind-custom-rel,
.wr-cal-remind-custom-at {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wr-cal-remind-custom label {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

.wr-cal-remind-custom input,
.wr-cal-remind-custom select {
    width: auto;
}

.wr-cal-remind-num {
    width: 72px;
}

.wr-cal-remind-unit {
    flex: 1;
    min-width: 88px;
}

.wr-cal-remind-date {
    min-width: 132px;
}

.wr-cal-remind-hour,
.wr-cal-remind-minute {
    width: 62px;
    min-width: 62px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 2px;
}

.wr-cal-remind-at-sep {
    font-size: 12px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

.wr-cal-remind-remove {
    min-width: 28px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
}

.wr-cal-remind-remove:hover {
    background: #fdecea;
    border-color: #a93226;
    color: #a93226;
}

.wr-cal-remind-hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: var(--text-secondary, #666);
}

.wr-cal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.wr-cal-section {
    border-top: 1px solid var(--border-color, #eee);
    margin-top: 14px;
    padding-top: 12px;
}

.wr-cal-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

@media (max-width: 640px) {
    .wr-cal-toolbar {
        padding: 8px;
    }

    .calendar-article.wr-cal-mode-pro .calendar-table tr:has(td.tb) {
        height: 84px;
    }
}

@media print {
    .wr-cal-toolbar,
    .wr-cal-panel,
    .wr-cal-btn {
        display: none !important;
    }

    .wr-cal-chip {
        font-size: 9px;
        background: none;
        border-left: 2px solid #333;
        padding: 0 2px;
    }
}
