@charset "utf-8";

/*
 * ============================================================
 *  diary_responsive.css — 일정 모듈 반응형 + 최신 디자인
 *  원본 참조: diary.css (기본 레이아웃)
 *  2차 세션: view.php 카드 UI + 폼 현대화
 * ============================================================
 */


/* ============================================================
   공통 — 컨테이너 고정 해제
   ============================================================ */
#dp_diary_pc_area {
    width: 100% !important;
    max-width: 100%;
    overflow: visible !important;
}


/* ============================================================
   달력 (.dcal) — 최신 디자인 시스템
   ============================================================ */
.dcal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.04);
    overflow: hidden;
    margin-bottom: 24px;
}

/* --- 헤더 --- */
.dcal-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
/* --- 헤더 상단 --- */
.dcal-header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 16px;
}
.dcal-title { text-align: center; }
.dcal-year {
    display: block;
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.dcal-month-row {
    display: flex;
    align-items: center;
    gap: 20px;
}
.dcal-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #999;
    text-decoration: none;
    transition: all .2s;
    border: none;
    background: transparent;
}
.dcal-arrow:hover { background: #f0f4ff; color: #1976d2; }
.dcal-arrow svg { display: block; }
.dcal-month {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -1px;
    min-width: 70px;
    text-align: center;
}

/* --- 헤더 하단 (건수 + 범례) --- */
.dcal-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 18px;
    font-size: 12px;
}
.dcal-count { color: #bbb; font-size: 13px; }
.dcal-count strong { color: #1976d2; font-weight: 700; }

.dcal-legends { display: flex; gap: 14px; }
.dcal-legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
    font-size: 11px;
    font-weight: 500;
}
.dcal-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    font-style: normal;
}
.dcal-dot--past { background: #ddd; }
.dcal-dot--now  { background: #66bb6a; }
.dcal-dot--future { background: #42a5f5; }

/* --- 요일 헤더 --- */
.dcal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f7f8fa;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #eee;
}
.dcal-weekday {
    padding: 12px 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.dcal-weekday--sun { color: #ef5350; }
.dcal-weekday--sat { color: #42a5f5; }

/* --- 달력 그리드 --- */
.dcal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f0f0f0;
}

/* --- 셀 --- */
.dcal-cell {
    background: #fff;
    min-height: 80px;
    padding: 8px;
    transition: all .15s;
    position: relative;
}
.dcal-cell:hover { background: #f5f8ff; }

.dcal-cell--empty { background: #fcfcfc; min-height: 40px; }
.dcal-cell--empty:hover { background: #fcfcfc; }
.dcal-cell--sun { background: #fffbfa; }
.dcal-cell--sun:hover { background: #fff3ef; }
.dcal-cell--sat { background: #f8faff; }
.dcal-cell--sat:hover { background: #eef3ff; }
.dcal-cell--today {
    background: #fffff0 !important;
    box-shadow: inset 0 0 0 2px #ffca28;
    border-radius: 2px;
}
.dcal-cell--has-event { }

/* --- 셀 링크 --- */
.dcal-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.dcal-link--disabled { cursor: default; opacity: .6; }

/* --- 셀 헤더 (날짜+도트) --- */
.dcal-cell-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}
.dcal-day {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1;
}
.dcal-day--sun { color: #e53935; }
.dcal-day--sat { color: #1976d2; }

/* --- 공휴일/음력 --- */
.dcal-holiday {
    font-size: 10px;
    color: #e53935;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dcal-lunar {
    font-size: 10px;
    color: #bbb;
    display: block;
    margin-bottom: 2px;
}

/* --- 일정 이벤트 --- */
.dcal-events { margin-top: 4px; }
.dcal-event {
    font-size: 10px;
    line-height: 1.3;
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e9 100%);
    color: #1565c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid #42a5f5;
}
.dcal-event-time {
    font-size: 9px;
    color: #90caf9;
    margin-right: 3px;
    font-weight: 600;
}
.dcal-event--more {
    background: transparent;
    color: #aaa;
    font-weight: 600;
    padding-left: 2px;
    border-left: none;
    font-size: 10px;
}
.dcal-event--info {
    background: transparent;
    color: #ccc;
    font-style: italic;
    border-left: none;
}

/* --- 모바일 조정 --- */
@media (max-width: 767px) {
    .dcal { border-radius: 10px; }
    .dcal-header-top { padding: 20px 16px 10px; }
    .dcal-header-bottom { padding: 0 16px 14px; }
    .dcal-month { font-size: 24px; min-width: 56px; }
    .dcal-month-row { gap: 14px; }
    .dcal-arrow { width: 34px; height: 34px; }
    .dcal-cell { min-height: 52px; padding: 4px; }
    .dcal-day { font-size: 12px; }
    .dcal-event { font-size: 9px; padding: 2px 4px; border-left-width: 1.5px; }
    .dcal-holiday { font-size: 9px; }
    .dcal-weekday { padding: 8px 0; font-size: 10px; }
}

/* --- 구 diary.css 오버라이드 (하위 호환) --- */
#dp_diary_pc_area #diary_list { overflow: visible; }
#dp_diary_pc_area #diary_list #disp_date { display: none; }
#dp_diary_pc_area #diary_list #disp_date_array { display: none; }


/* ============================================================
   일정 뷰 (#diary_view) — 최신 카드 UI
   ============================================================ */
#diary_view {
    margin-bottom: 20px;
}

/* --- 날짜 헤더 --- */
.dv-date-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.dv-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: #999;
    text-decoration: none;
    border: none;
    transition: all .2s;
    flex-shrink: 0;
}
.dv-nav-btn:hover { background: #f0f4ff; color: #1976d2; }
.dv-nav-btn svg { display: block; }

.dv-date-center { text-align: center; }
.dv-date-year {
    display: block;
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 2px;
}
.dv-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.dv-date-day {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.dv-weekday {
    font-weight: 400;
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

/* --- 서브 정보 (음력/일정수) --- */
.dv-sub-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}
.dv-lunar { color: #999; }
.dv-count strong { color: #1976d2; font-weight: 700; }

/* --- 일정 카드 --- */
.dv-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
    transition: box-shadow .2s;
}
.dv-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.dv-card-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
    transition: background .15s;
    gap: 10px;
}
.dv-card-header:hover { background: #f8f9ff; }

.dv-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.dv-card-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dv-card-toggle {
    font-size: 12px;
    color: #bbb;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    transition: color .15s;
}

/* --- 카드 본문 --- */
.dv-card-body {
    border-top: 1px solid #f0f0f0;
}

.dv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 12px 16px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.dv-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dv-icon {
    font-style: normal;
    font-size: 14px;
    opacity: .7;
}

.dv-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}
.dv-content p { margin: 0 0 8px; }

/* --- 수정/삭제 액션 버튼 --- */
.dv-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.dv-btn {
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    background: none;
}

.dv-btn-edit {
    background: #f0f4f8;
    border-color: #d0d8e0;
    color: #555;
}
.dv-btn-edit:hover { background: #e3f2fd; border-color: #90caf9; color: #1976d2; }

.dv-btn-del {
    background: #fff5f5;
    border-color: #ffcdd2;
    color: #c62828;
}
.dv-btn-del:hover { background: #ffebee; border-color: #ef9a9a; }


/* ============================================================
   폼 공통 — 등록 / 수정 / 삭제
   ============================================================ */
.dv-form-wrap {
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
    padding: 20px 16px;
}
.dv-form-del { background: #fff8f8; }
.dv-form-reg {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-top: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

.dv-form-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3f2fd;
}
.dv-form-title-del { border-bottom-color: #ffcdd2; }

.dv-req-msg {
    font-size: 12px;
    color: #999;
    margin: 6px 0 16px;
}

/* --- 폼 그룹 (label + input) --- */
/* 모바일: 수직 스택 (라벨 위, 인풋 아래) */
.diary-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 0 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    white-space: nowrap;
}
.form-label em {
    color: #e53935;
    font-style: normal;
    font-weight: 700;
    margin-right: 2px;
}

.form-control-wrap { width: 100%; }

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #dde1e6;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #90caf9;
    box-shadow: 0 0 0 3px rgba(144,202,249,.18);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-select {
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color .15s;
    font-family: inherit;
}
.form-select:focus {
    outline: none;
    border-color: #90caf9;
    box-shadow: 0 0 0 3px rgba(144,202,249,.18);
}

/* --- 날짜/시간 행 (시작 ~ 종료) --- */
/* 모바일: 세로 쌓기 */
.dv-date-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dv-date-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.dv-date-sep {
    color: #999;
    font-size: 14px;
    padding: 0 2px;
}

/* --- 폼 액션 버튼 --- */
.dv-form-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 16px 0 4px;
    flex-wrap: wrap;
}

.dv-btn-primary {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #1976d2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dv-btn-primary:hover { background: #1565c0; box-shadow: 0 2px 8px rgba(25,118,210,.3); }

.dv-btn-secondary {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dv-btn-secondary:hover { background: #e8e8e8; }

.dv-btn-danger {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #e53935;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dv-btn-danger:hover { background: #c62828; box-shadow: 0 2px 8px rgba(229,57,53,.3); }

.dv-btn-outline {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dv-btn-outline:hover { background: #f8f9fa; border-color: #bbb; }

.dv-btn-danger-outline {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #e53935;
    background: #fff;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dv-btn-danger-outline:hover { background: #fff5f5; }


/* --- 동의 영역 --- */
.dv-agree-wrap {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
}

.dv-agree-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 14px;
}

.dv-agree-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.dv-agree-item-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.dv-agree-textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    font-size: 12px;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    background: #fff;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
}

.dv-agree-check {
    text-align: center;
    padding: 10px 0;
}

.dv-agree-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}
.dv-agree-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }


/* --- 빈 일정 --- */
.dv-empty {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 12px;
}

.dv-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.dv-empty p { font-size: 15px; color: #888; margin: 0 0 4px; }
.dv-empty-sub { font-size: 13px; color: #bbb; margin-bottom: 16px !important; }
.dv-empty button { margin: 4px; }


/* --- 하단 액션 --- */
.dv-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px 0 24px;
}


/* ============================================================
   태블릿 (768px ~)
   ============================================================ */
@media (min-width: 768px) {

    /* 달력: 태블릿 — 셀 높이 확대 */
    .dcal-cell { min-height: 100px; padding: 8px; }
    .dcal-day { font-size: 14px; }
    .dcal-event { font-size: 11px; }

    /* 동의 그리드 2열 */
    .dv-agree-grid { grid-template-columns: 1fr 1fr; }

    /* 날짜 헤더 확대 */
    .dv-date-header { padding: 32px 24px; gap: 28px; }
    .dv-date-day { font-size: 30px; }

    /* 폼 패딩 확대 */
    .dv-form-wrap { padding: 24px; }
    .dv-form-reg { padding: 24px; }

    /* 태블릿: 폼 그룹 가로 배치 (라벨 좌 | 인풋 우) */
    .form-group {
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
        padding: 0 0 16px;
    }
    .form-label {
        width: 80px;
        min-width: 80px;
        flex-shrink: 0;
        padding-top: 10px;
        padding-right: 12px;
        text-align: right;
        margin-bottom: 0;
    }
    .form-control-wrap { flex: 1; min-width: 0; }
    .form-group-full { flex-direction: column; }
    .form-group-full .form-label { width: 100%; text-align: left; padding-top: 0; margin-bottom: 6px; }

    /* 태블릿: 날짜/시간 줄바꿈 유지 */
    .dv-date-row { flex-wrap: wrap; gap: 6px; }

    /* 하단 액션 우측 정렬 */
    .dv-bottom-actions { justify-content: flex-end; }
}


/* ============================================================
   데스크탑 (1025px ~)
   ============================================================ */
@media (min-width: 1025px) {

    /* 달력: 데스크톱 — 셀 높이 확대 */
    .dcal-cell { min-height: 120px; padding: 8px 10px; }
    .dcal-event { font-size: 11px; padding: 2px 6px; }

    /* 카드 확대 */
    .dv-card-header { padding: 16px 24px; }
    .dv-meta { padding: 14px 24px; }
    .dv-content { padding: 20px 24px; }

    /* 데스크톱: 폼 라벨 확대 + 정렬 */
    .form-label { width: 100px; min-width: 100px; font-size: 14px; }

    /* 데스크톱: 인풋 크기 제한 */
    .form-input { max-width: 480px; }
    .form-textarea { max-width: 100%; }

    /* 데스크톱: 날짜/시간 한 줄 배치 */
    .dv-date-row { flex-wrap: nowrap; gap: 8px; }
    .dv-date-group { flex-wrap: nowrap; gap: 4px; }
    .dv-date-sep { padding: 0 4px; }
}
