@charset "utf-8";


/* =========================================================
   GLASSMORPHISM VARIABLES
========================================================= */
:root{
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}


/* =========================================================
   DIARY WRITE (ONLY)
   - 전역 금지 (body 등 X)
   - .diary-write 아래로만
   ========================================================= */

.diary-write{
  background: var(--container-bg-color);
  overflow: visible; /* 또는 */
  max-width: 800px;
  margin: 0 auto;
  padding: 50px 50px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.diary-write::before{
  z-index: 0;
}
.diary-write > *{
  position: relative;
  z-index: 1;
}


/* header */
.diary-write-header{
  text-align:center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: var(--shadow);
}
.diary-write-header h2{
  margin:0 0 8px 0;
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size: 28px;
  font-weight: 900;
  color: var(--content-font-color);
}
.diary-write-header .write-date{
  font-size: 13px;
  color: var(--form-text-color);
}

/* section */
.diary-write .write-section{ margin-bottom: 22px; }
.diary-write .write-label{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--form-bg-color);
}

/* inputs */
.diary-write .frm_input,
.diary-write input[type="text"],
.diary-write select{
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border-color);
  background: var(--form-bg-color);
  color: var(--form-text-color);
  outline:none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.diary-write .frm_input::placeholder{ color: rgba(255,255,255,.55); }
.diary-write .frm_input:focus,
.diary-write input:focus,
.diary-write select:focus{
  background: var(--container-bg-color);
  border-color: rgba(255,255,255,.28);
  box-shadow: var(--shadow);
}

/* subject + autosave */
.diary-write .subject-input{ position: relative; }
.diary-write .subject-input input.frm_input{ padding-right: 160px; }

.diary-write .btn-autosave{
  position:absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;

  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
  color: var(--content-font-color);

  font-size: 12px;
  font-weight: 900;
  cursor:pointer;
  white-space: nowrap;
}
.diary-write .btn-autosave:hover{
  background: var(--container-bg-color);
  border-color: rgba(255,255,255,.30);
  transform: translateY(-50%) translateY(-1px);
}

.diary-write #autosave_pop{
  position:absolute;
  right:0;
  top:100%;
  margin-top:10px;
  min-width: 320px;
  max-width: 420px;

  padding: 18px;
  border-radius: 16px;

  background: var(--container-bg-color);
  border: 1px solid var(--card-border-color);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);

  color: var(--content-font-color);
  z-index: 1000;
}

/* =========================================================
   MOOD / WEATHER (MINIMAL CHIP)
   ========================================================= */
.diary-write .mood-selector,
.diary-write .weather-selector{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

.diary-write .mood-option,
.diary-write .weather-option{
  position: relative;
  cursor: pointer;
}

/* radio hide */
.diary-write .mood-option input,
.diary-write .weather-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* chip */
.diary-write .mood-icon,
.diary-write .weather-icon{
  padding: 10px 14px;
  border-radius: 999px;

  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap: 8px;

  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.diary-write .mood-icon i,
.diary-write .weather-icon i{
  font-size: 16px;
  line-height: 1;
  color: var(--content-font-color);
}

.diary-write .mood-icon span,
.diary-write .weather-icon span{
  font-size: 12px;
  font-weight: 500;
}

.diary-write .mood-option:hover .mood-icon,
.diary-write .weather-option:hover .weather-icon{
  transform: translateY(-1px);
  background: var(--container-bg-color);
}

/* 선택 상태: 각 유형의 고유 색 */
.diary-write .weather-option:has(input[value="urgent"]:checked)      .weather-icon { background:#e05555; border-color:#e05555; }
.diary-write .weather-option:has(input[value="deadline"]:checked)    .weather-icon { background:#9b59b6; border-color:#9b59b6; }
.diary-write .weather-option:has(input[value="appointment"]:checked) .weather-icon { background:#2ecc71; border-color:#2ecc71; }
.diary-write .weather-option:has(input[value="off"]:checked)         .weather-icon { background:#5b9bd5; border-color:#5b9bd5; }
.diary-write .weather-option:has(input[value="commission"]:checked)  .weather-icon { background:#f4a0c0; border-color:#f4a0c0; }
.diary-write .weather-option:has(input[value="plan"]:checked)        .weather-icon { background:#f1c40f; border-color:#f1c40f; }

/* 선택 공통: 위로 살짝 뜨기 */
.diary-write .mood-option input:checked + .mood-icon,
.diary-write .weather-option input:checked + .weather-icon {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* 선택된 아이콘·텍스트 흰색 */
.diary-write .weather-option input:checked + .weather-icon i,
.diary-write .weather-option input:checked + .weather-icon span {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}



/* secret toggle */
.secret-toggle-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap: wrap;
}
.diary-write .secret-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:36px;
  padding:0 10px;
  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
  border-radius:999px;
  color:var(--content-font-color);
  font-size:13px;
  white-space:nowrap;
  cursor:pointer;
  opacity:.75;
  transition: opacity .2s ease, background .2s ease, border-color .2s ease;
}
.diary-write .secret-toggle input{
  position:absolute;
  opacity:0;
  pointer-events:none;
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  width:0;
  height:0;
}
.diary-write .secret-toggle .toggle-ui{
  position:relative;
  width:34px;
  height:18px;
  border-radius:999px;
  background: rgba(255,255,255,.12);
  border:1px solid var(--card-border-color);
  transition: all .2s ease;
}
.diary-write .secret-toggle .toggle-ui::after{
  content:'';
  position:absolute;
  top:1px;
  left:1px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
  transition: all .2s ease;
}
.diary-write .secret-toggle input:checked + .toggle-ui{
  background: var(--btn-secondary-bg);
  border-color: rgba(255,255,255,.45);
}
.diary-write .secret-toggle input:checked + .toggle-ui::after{
  transform: translateX(16px);
}
.diary-write .secret-toggle:has(input:checked){
  opacity:1;
  border-color: rgba(255,255,255,.35);
}
.diary-write .secret-toggle input:checked ~ .toggle-text{
  color:#fff;
}
.secret-pass{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  min-width: 260px;
  flex:1;
}
.secret-pass-input{ width:100%; }

/* =========================================================
   EDITOR SAFETY (CKEditor/Cheditor)
   ========================================================= */
.diary-write .write-section > *,
.diary-write .write-section .cke,
.diary-write .write-section .cke_chrome,
.diary-write .write-section .cheditor,
.diary-write .write-section iframe{
  max-width: 100% !important;
  box-sizing: border-box;
}

.diary-write .cke_chrome{
  border-radius: 14px !important;
  overflow:hidden;
  border: 1px solid var(--card-border-color) !important;
  background: var(--container-bg-color) !important;
}
.diary-write .cke_top{
  background: var(--container-bg-color) !important;
  border-bottom: 1px solid var(--card-border-color) !important;
}
.diary-write .cke_contents{
  background: #ffffff !important;
}
/* 에디터 내부 글자색 — 흰 배경 위에서 잘 보이도록 어둡게 고정 */
.diary-write .cke_wysiwyg_div,
.diary-write .cke_editable {
  background: #ffffff !important;
  color: #222222 !important;
}

/* file inputs */
.diary-write input[type="file"]{
  width:100%;
  box-sizing:border-box;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--container-bg-color);
  border: 1px solid var(--card-border-color);
  color: rgba(255,255,255,.86);
}

/* write_file.common.php table safety */
.diary-write table{ width:100%; border-collapse: collapse; }
.diary-write td, .diary-write th{ vertical-align: middle; }

/* buttons */
.diary-write .write-buttons{
  display:flex;
  gap: 12px;
  justify-content:center;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.14);
}

.diary-write .btn-cancel,
.diary-write .btn-temp,
.diary-write .btn-submit{
  min-width: 180px;
  height: 46px;
  border-radius: 14px;

  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
  color: var(--content-font-color);
  font-weight: 900;
  font-size: 13px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.diary-write .btn-cancel{ background: rgba(140,140,140,.18); }
.diary-write .btn-temp  { background: rgba(255,193,7,.18); }
.diary-write .btn-submit{ background: rgba(120,170,255,.18); }

.diary-write .btn-cancel:hover,
.diary-write .btn-temp:hover,
.diary-write .btn-submit:hover{
  background: var(--container-bg-color);
  border-color: rgba(255,255,255,.26);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* 썸네일 URL */
.thumb-url-row{
  margin-top: 14px;
  padding: 14px;
  background: var(--container-bg-color);
  border: 1px solid var(--card-border-color);
  border-radius: 12px;
}

.thumb-url-label{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  color: var(--content-font-color);
  font-size: 14px;
}

.thumb-url-row .frm_input{
  width:100%;
  background: var(--container-bg-color);
  border: 1px solid var(--card-border-color);
  color: var(--content-font-color);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}

.thumb-url-actions{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap: wrap;
}

.thumb-btn{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
  color: var(--content-font-color);
  cursor: pointer;
  display:flex;
  align-items:center;
  gap:8px;
}

.thumb-btn:hover{
  background: var(--container-bg-color);
  border-color: var(--card-border-color);
}

.thumb-btn.danger{
  border-color:var(--card-border-color);
  color: var(--content-font-color);
}

.thumb-url-preview{
  margin-top: 12px;
  border-radius: 12px;
  overflow:hidden;
  border: 1px solid var(--card-border-color);
  background: var(--container-bg-color);
}

.thumb-url-preview img{
  width:100%;
  height:auto;
  display:block;
}

.thumb-url-note{
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--content-font-color);
  border-top: 1px solid var(--card-border-color);
}

/* 날짜 선택 스타일 */
.datetime-selector {
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid var(--card-border-color);
}

.datetime-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

.date-input-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--btn-secondary-bg);
    border-radius: 12px;
    border: 2px solid var(--accent-color, #7eb8f7);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 3px rgba(126, 184, 247, 0.15);
}

/* --visible 클래스: write_skin.php에서 명시적으로 사용하는 강조 버전 */
.date-input-label--visible {
    background: var(--btn-secondary-bg);
    border-color: var(--accent-color, #7eb8f7);
}

.date-input-label:hover,
.date-input-label--visible:hover {
    border-color: var(--accent-color, #7eb8f7);
    box-shadow: 0 0 0 4px rgba(126, 184, 247, 0.25);
    transform: translateY(-1px);
}

/* 과거 날짜 선택 시 */
.date-input-label.past-date {
    border-color: rgba(255, 160, 100, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 160, 100, 0.15);
    background: rgba(255, 140, 80, 0.12);
}

.date-input-label i {
  color: var(--content-font-color);
    font-size: 18px;
    min-width: 20px;
}

.date-input-label span {
  color: var(--content-font-color);
    font-size: 14px;
    min-width: 70px;
}

.datetime-input {
    flex: 1;
    background: transparent;
    border: none;
  color: var(--content-font-color);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.datetime-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
}

.datetime-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.btn-reset-date {
    padding: 12px 20px;
    background: var(--container-bg-color);
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    color: var(--content-font-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset-date:hover {
    background: var(--container-bg-color);
    border-color: var(--card-border-color);
    transform: translateY(-1px);
}

.btn-reset-date i {
    font-size: 14px;
}

.datetime-help {
    margin: 0;
    padding: 10px 12px;
    background: var(--container-bg-color);
    border-left: 3px solid var(--card-border-color);
    border-radius: 4px;
    color: var(--content-font-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.datetime-help i {
    color: var(--content-font-color);
}

@media (max-width: 800px) {
    .datetime-input-group {
        flex-direction: column;
    }

    .btn-reset-date {
        width: 100%;
        justify-content: center;
    }
}
/* responsive */
@media (max-width: 800px){
  .diary-write{
    padding: 26px 18px;
    border-radius: 18px;
  }
  .diary-write .subject-input input.frm_input{ padding-right: 16px; }
  .diary-write .btn-autosave{
    position: static;
    transform:none;
    width:100%;
    height: 42px;
    margin-top: 10px;
  }
  .diary-write .btn-cancel,
  .diary-write .btn-temp,
  .diary-write .btn-submit{
    width:100%;
    min-width:0;
  }
  .diary-write #autosave_pop{
    min-width:0;
    max-width:100%;
  }
}


/* ============================================================
   반복 설정 섹션
   ============================================================ */
.repeat-section .write-label {
    gap: 8px;
    flex-wrap: wrap;
}

.repeat-hint {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
    margin-left: 4px;
}

.repeat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.repeat-option {
    cursor: pointer;
}

.repeat-option input {
    display: none;
}

.repeat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--card-border-color, rgba(255,255,255,0.15));
    background: var(--container-bg-color, rgba(255,255,255,0.08));
    color: var(--content-font-color, #e8e8f0);
    font-size: 13px;
    transition: all 0.15s ease;
}

.repeat-option input:checked + .repeat-chip {
    background: var(--btn-secondary-bg, rgba(120,160,255,0.25));
    border-color: var(--accent-color, #7eb8f7);
    box-shadow: 0 0 0 3px rgba(126,184,247,0.15);
}

.repeat-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.repeat-count-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--content-font-color, #e8e8f0);
}

.repeat-count-select {
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--card-border-color, rgba(255,255,255,0.15));
    background: var(--container-bg-color, rgba(255,255,255,0.08));
    color: var(--content-font-color, #e8e8f0);
    font-size: 14px;
    outline: none;
}

.repeat-preview {
    font-size: 12px;
    color: var(--accent-color, #7eb8f7);
    opacity: 0.85;
}
