/* ==========================================
   13. 表單、輸入框與日期選取 (Forms & Inputs)
   ========================================== */
.date-ui-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-ui-display {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-highlight);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

#reminder-date-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 12px;
}

.reminder-date-range-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
    padding: 2px 0;
}

.reminder-date-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.reminder-date-divider {
    width: 100%;
    height: 1px;
    background: var(--glass-border);
    opacity: 0.35;
    margin: 4px 0;
    flex-shrink: 0;
}

.reminder-date-single {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.reminder-date-single.placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
}

.reminder-date-val {
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.reminder-time-val {
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.reminder-weekday-val {
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.75;
    font-size: 0.92em;
}

.date-ui-display:focus {
    border-color: var(--glass-border);
    box-shadow: none;
}

.custom-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
}

#reminder-form-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
    justify-content: flex-start;
}

#reminder-form-container #reminder-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: auto !important;
    min-height: 120px;
    max-height: none;
    margin-bottom: 0;
    padding: 15px 16px;
    font-size: 17.5px;
    line-height: 1.6;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
}

.reminder-preview-title {
    font-size: 17.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    flex-shrink: 0;
}

.reminder-preview-title.is-placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 500;
    line-height: 1.5;
}

.reminder-preview-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 10px 0;
    flex-shrink: 0;
    width: 100%;
}

.reminder-preview-body {
    flex: 1;
    font-size: 17.5px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-all;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.reminder-preview-body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.reminder-preview-body.is-placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 500;
    line-height: 1.5;
}

#full-reminder-title-input {
    flex: 1;
    height: 44px;
    margin: 0;
    margin-right: 36px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    outline: none !important;
    box-shadow: none !important;
    white-space: nowrap;
}

#full-reminder-title-input::placeholder {
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.7;
}

#full-reminder-title-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

#bookmark-form-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
    justify-content: center;
}

.category-select-display {
    position: relative;
    width: 100%;
    min-height: 52px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    margin-bottom: 12px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-highlight);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

.category-select-display:active {
    transform: scale(0.97) !important;
    transition: transform 0.05s ease-out !important;
}

.category-display-text {
    font-family: inherit;
    font-size: 17.5px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.category-display-text.placeholder {
    font-family: inherit;
    font-size: 17.5px;
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.5;
}

.category-tag-placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
}

#bookmark-form-container:not(.mode-note) #bookmark-category-select-display {
    order: 1;
    margin-bottom: 12px;
}

#bookmark-form-container:not(.mode-note) #bookmark-title {
    order: 2;
    margin-bottom: 12px;
}

#bookmark-form-container:not(.mode-note) #bookmark-url-row {
    order: 3;
    margin-bottom: 12px;
}

#bookmark-form-container:not(.mode-note) #bookmark-desc {
    order: 4;
    margin-bottom: 0;
}

#bookmark-form-container.mode-note {
    justify-content: flex-start;
}

#bookmark-form-container.mode-note #bookmark-title {
    display: none !important;
}

#bookmark-form-container.mode-note #bookmark-url-row {
    display: none !important;
}

#bookmark-form-container.mode-note #bookmark-category-select-display {
    order: 1;
    margin-bottom: 12px;
}

#bookmark-form-container.mode-note #bookmark-content {
    order: 2;
    display: flex !important;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: auto !important;
    min-height: 120px;
    max-height: none;
    margin-bottom: 12px;
    padding: 15px 16px;
    font-size: 16px;
    line-height: 1.6;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
}

#bookmark-form-container.mode-note #bookmark-desc {
    order: 3;
    margin-bottom: 0;
}

#bookmark-form-container:not(.mode-note) #bookmark-content {
    display: none !important;
}

#reminder-content:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    line-height: 1.6;
    font-size: 16px;
    display: block;
    transition: opacity 0.12s ease, color 0.12s ease;
}

input[type="text"].custom-input,
input[type="url"].custom-input,
div.custom-input {
    width: 100%;
    height: 52px;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-highlight);
    border-radius: 14px;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 17.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.5;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input[type="text"].custom-input:focus,
input[type="url"].custom-input:focus,
div.custom-input:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1.5px var(--primary) !important;
}

#bookmark-desc {
    display: block;
    white-space: nowrap;
    overflow-y: hidden;
    overflow-x: auto;
    user-select: text;
    -webkit-user-select: text;
}

#bookmark-desc:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    display: inline-block;
    transition: opacity 0.12s ease, color 0.12s ease;
}

#bookmark-desc:focus:before {
    opacity: 0 !important;
    color: transparent !important;
    pointer-events: none !important;
    transition: opacity 0.12s ease, color 0.12s ease;
}

/* 徹底覆蓋瀏覽器原生 Autofill 注入樣式，維持自訂背景透明度與文字主色 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-transition: background-color 50000s ease-in-out 0s, color 50000s ease-in-out 0s;
    transition: background-color 50000s ease-in-out 0s, color 50000s ease-in-out 0s;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--primary) !important;
}

/* 關閉 Chrome 原生表單自動填入鑰匙、歷史建議與個人聯絡資訊懸浮小圖示 */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
}

textarea,
#bookmark-content,
#reminder-content {
    width: 100%;
    height: 200px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-highlight);
    border-radius: 14px;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 14pt;
    background: var(--input-bg);
    color: var(--text);
    resize: none;
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-all;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    -webkit-touch-callout: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#bookmark-content,
#reminder-content {
    flex: none;
    width: 100%;
    height: 212px !important;
    min-height: 212px;
    max-height: 212px;
    cursor: pointer;
    padding: 15px 16px;
    font-size: 15.5pt;
    line-height: 1.6;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#bookmark-content:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    line-height: 1.6;
    font-size: 15.5pt;
    display: block;
    transition: opacity 0.12s ease, color 0.12s ease;
}

#bookmark-content:focus {
    border-color: var(--glass-border);
    box-shadow: var(--glass-inner-highlight);
    outline: none;
}

textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary) !important;
}

#full-note-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 6px 0;
}

#full-note-content h3 * {
    font-size: inherit !important;
    font-weight: inherit !important;
}

.action-delete-btn {
    background: transparent;
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    transform: translateZ(0);
    transform-origin: center center !important;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.action-delete-btn:active {
    transform: scale(0.85) translateZ(0) !important;
    transition: transform 0.04s ease-out !important;
}

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

.input-row .custom-input {
    margin-bottom: 0;
}

.right-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
    width: auto;
}

