/* ゼクト式ふせんfree - style.css */

* {
box-sizing: border-box;
}

body {
margin: 0;
background: #111;
color: #eee;
font-family: sans-serif;
}

header {
background: #222;
padding: 10px;
position: relative;
text-align: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

header h1 {
margin: 0;
font-size: 1.4em;
display: inline-block;
}

header a {
color: #fff;
text-decoration: none;
}

.toolbar {
position: absolute;
top: 8px;
right: 12px;
}

.btn {
color: #F00;
padding: 8px 14px;
margin: 0 4px;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
transition: 0.2s;
}

.btn:hover {
opacity: 0.9;
transform: translateY(-1px);
}

.btn-primary {
background: #4a9eff;
color: white;
}

.btn-secondary {
background: #555;
color: white;
}

.btn-danger {
background: #dc3545;
color: white;
}

.btn-small {
padding: 4px 8px;
font-size: 0.9em;
margin: 0 2px;
}

.empty-state {
text-align: center;
padding: 60px 20px;
color: #666;
}

.empty-state h2 {
margin-bottom: 15px;
color: #888;
}

/* 新パンくず — 左上のメニューログインUI分の余白を確保 */
.breadcrumb {
position: absolute;
left: 260px; /* menu側ログインボタンと重ならないよう右にオフセット */
top: 12px;
font-size: 0.9em;
}

.breadcrumb a {
color: #aaa;
text-decoration: none;
margin: 0 6px;
}

.breadcrumb a:hover {
color: #fff;
text-decoration: underline;
}

/* ノート本体 */
.notes-container {
width: 100vw;
height: calc(100vh - 76px);
position: relative;
overflow: hidden;
background: #1a1a1a;
}

.note-item {
position: absolute;
user-select: none;
pointer-events: auto;
border-radius: 8px;
}

.note-item:not(.folder)::before {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 8px;
background: #3b3b3b;
border-radius: 8px 0 0 8px;
}

.note-item:not(.folder) {
border: 2px solid transparent;
background: rgba(40, 40, 40, 0.95);
min-width: 200px;
min-height: 170px;
}

/* ヘッダー部分 */
.note-header {
position: relative;
padding: 8px 10px 4px;
background: rgba(0, 0, 0, 0.4);
border-radius: 6px 6px 0 0;
}

.drag-handle {
float: left;
cursor: move;
font-size: 1.2em;
margin-right: 6px;
color: #aaa;
touch-action: none;   /* Pointer Events ドラッグ干渉防止 */
user-select: none;
}

.title-input {
background: rgba(0, 0, 0, 0.4);
border: none;
color: #fff;
width: calc(55% - 40px);
font-weight: bold;
padding: 4px;
}

.note-actions {
float: right;
white-space: nowrap;
}

/* 新しい行（タグ・期限・優先度） */
.note-meta {
padding: 4px 10px;
background: rgba(0, 0, 0, 0.25);
font-size: 0.85em;
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
}

.tag-list .tag-badge {
background: #444;
padding: 2px 20px 2px 8px !important;
border-radius: 4px;
margin-right: 4px;
font-size: 0.8em;
cursor: pointer;
position: relative;
display: inline-block;
}

.tag-badge::after {
content: '×';
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
font-weight: bold;
opacity: 0.5;
}

.tag-badge:hover {
filter: brightness(1.2);
}

.tag-badge:hover::after {
opacity: 1;
}

.tag-input {
background: rgba(0, 0, 0, 0.4);
border: none;
color: #fff;
padding: 2px 6px;
border-radius: 4px;
width: 120px;
}

.due-date-input {
background: rgba(0, 0, 0, 0.4);
border: none;
color: #777;
padding: 2px 6px;
border-radius: 4px;
}

.priority-btn {
font-size: 1.3em;
cursor: pointer;
}

.overdue {
color: #ff4444 !important;
}

/* 内容 */
.note-content textarea {
width: 100%;
background: rgba(40, 40, 40, 0.1);
border: none;
color: #eee;
padding: 10px;
resize: none;
font-size: 18px;
padding-top: 4px !important;
padding-left: 18px !important;
}


/* ロック中：他のボタン全部非表示＋アンロックボタンだけ赤く表示 */
.locked {
opacity: 0.6;
pointer-events: none;
cursor: not-allowed !important;
}

/* ロック中はヘッダーの操作ボタン全部消す */
.locked .note-actions>*:not(.lock-btn) {
display: none !important;
}

/* アンロックボタンだけは生きて、目立って、押せる */
.locked .lock-btn {
display: block !important;
/* 強制表示 */
pointer-events: auto !important;
opacity: 1 !important;
background: #dc3545 !important;
color: white !important;
font-weight: bold !important;
padding: 6px 10px !important;
border-radius: 6px !important;
cursor: pointer !important;
box-shadow: 0 0 8px rgba(220, 53, 69, 0.8) !important;
}

/* ロック中はドラッグハンドルも消す */
.locked .drag-handle {
display: none !important;
}



/* フォルダは現状維持 */
.folder {
width: 100px !important;
height: 90px !important;
padding: 0;
}

.folder img {
height: 100px;
width: 100%;
object-fit: contain;
pointer-events: none;
filter: inherit !important;
}

.folder .note-header {
background: rgba(0, 0, 0, 0.3);
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
border-radius: 20px;
padding: 0;
}

.folder .title-input {
background: transparent;
border: none;
color: white;
font-size: 0.95rem;
width: 100%;
text-align: center;
}

/* 色ピッカー */
.color-picker {
position: absolute;
background: #2a2a2a;
padding: 10px;
border-radius: 8px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
z-index: 9999;
display: grid;
grid-template-columns: repeat(1, 1fr);
gap: 6px;
}

.color-option {
width: 160px;
height: 32px;
border-radius: 6px;
cursor: pointer;
border: 2px solid transparent;
font-weight: bold;
}

.color-option:hover {
border: 2px solid white;
}

.color-option span {
color: white;
text-shadow: 1px 1px 3px black;
align-items: center;
justify-content: center;
}

/* オリジナル */
.white {
color: #cfcfcf;
text-decoration: none;
}

a.white:hover {
text-decoration: underline;
}

a.no-underline:hover {
text-decoration: none;
}

.right {
text-align: right;
margin-right: 20px;
}

.cen {
text-align: center;
margin-right: auto;
margin-left: auto;
}

.left {
text-align: left;
margin-left: 20px;
}

/* 1. ドラッグ中・ドロップ可能なフォルダにハイライト（移動先が一目でわかるように） */
.folder.droppable-hover {
filter: brightness(1.1) !important;
transform: scale(1.05);
transition: all 0.2s ease;
box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.6) !important;
z-index: 30 !important;
}


/* 2. textarea を縦100%に拡張（横は既に100%なので縦だけ） */
.note-item:not(.folder) {
display: flex !important;
/* 追加: 親全体をflex化 */
flex-direction: column !important;
/* 追加: 縦並び固定 */
}

.note-header,
.note-meta {
flex: none;
/* 追加: ヘッダー/メタは縮まない */
}

.note-content {
flex: 1 1 auto !important;
/* 変更: 成長+自動調整 */
display: flex;
padding: 0 !important;
}

.note-content textarea {
flex: 1 1 auto !important;
/* 変更: 親の全高さを占める */
height: 100% !important;
min-height: 80px;
/* 変更: 小さめ最小値 */
padding: 12px;
font-size: 17px;
line-height: 1.5;
border: none;
resize: none;
background: transparent;
}




/* 3. レスポンシブ表示制御（付箋幅に応じて要素を非表示） */
.note-item.small {

/* 横499px未満（タグ/ボタン全隠し） */
.note-actions>*:not(.lock-btn):not(.drag-handle) {
display: none !important;
}

.note-meta>*:not(.lock-btn):not(.drag-handle),
.note-meta>*:not(.priority-btn) {
display: none !important;
}
}

.note-item.medium {

/* 横500-649px（日付/重要度表示、タグ/ボタン隠し） */
.due-date-input,
.priority-btn {
display: inline-flex !important;
}

.tag-list,
.note-actions>.color-btn,
.note-actions>label,
.note-actions>.delete-btn {
display: none !important;
}
}

.note-item.large {

/* 横650px以上（全表示） */
.due-date-input,
.priority-btn,
.tag-list,
.note-actions>* {
display: inline-flex !important;
}
}

/* 選択付箋の最上部・最下部移動 */
.note-item.selected {
z-index: 50 !important;
/* 選択中は常に最上位 */
box-shadow: 0 0 0 3px #4a9eff !important;
/* 青い選択枠 */
}

.note-item.to-bottom {
z-index: 5 !important;
/* 最下部時はフォルダより下 */
}

/* 日付右クリックメニュー */
.date-context-menu {
position: absolute;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 6px;
padding: 6px 0;
z-index: 10000;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.date-context-menu div {
padding: 8px 16px;
cursor: pointer;
color: #eee;
}

.date-context-menu div:hover {
background: #4a9eff;
}

/* オートリサイズ時の最低高さ確保（約7行分） */
.note-item.auto-resize-active .note-content textarea {
min-height: 200px !important;
}

@keyframes highlight-pulse {
0% { box-shadow: 0 0 0 0 rgba(255,215,0,0.8); }
50% { box-shadow: 0 0 20px 6px rgba(255,215,0,0.4); }
100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); }
}
.highlight-flash {
animation: highlight-pulse 0.7s ease 3;
}

.note-item {
transition: box-shadow 0.2s;
}

/* ---- ライトモード ---- */
body.light-theme { background:#f0ebe5 !important; color:#323232 !important; }
body.light-theme header { background:rgba(240,235,228,.95) !important; box-shadow:0 2px 8px rgba(0,0,0,.1) !important; }
body.light-theme header a { color:#323232 !important; }
body.light-theme .breadcrumb a { color:#b06030 !important; }
body.light-theme .breadcrumb a:hover { color:#d04020 !important; }
body.light-theme .notes-container { background:#e8e3dd !important; }
body.light-theme .note-item:not(.folder) { background:rgba(255,255,255,.9) !important; }
body.light-theme .note-header { background:rgba(0,0,0,.06) !important; }
body.light-theme .title-input { background:rgba(0,0,0,.05) !important; color:#323232 !important; }
body.light-theme .note-content textarea { background:rgba(0,0,0,.02) !important; color:#323232 !important; }
body.light-theme .note-meta { background:rgba(0,0,0,.04) !important; }
body.light-theme .tag-badge { background:rgba(0,0,0,.08) !important; color:#555 !important; }
body.light-theme .tag-input { background:rgba(0,0,0,.05) !important; color:#323232 !important; }
body.light-theme .due-date-input { background:rgba(0,0,0,.05) !important; color:#666 !important; }
body.light-theme .drag-handle { color:#aaa !important; }
body.light-theme .btn { color:#555 !important; }
body.light-theme .btn-primary { background:rgba(180,120,50,.7) !important; color:#fff !important; }
body.light-theme .btn-secondary { background:rgba(0,0,0,.1) !important; color:#555 !important; }
body.light-theme .btn-danger { background:rgba(220,50,50,.7) !important; color:#fff !important; }
body.light-theme .color-picker { background:rgba(245,240,235,.98) !important; box-shadow:0 8px 24px rgba(0,0,0,.15) !important; }
body.light-theme .note-item:not(.folder)::before { background:rgba(0,0,0,.08) !important; }
body.light-theme #footer { background:rgba(240,235,228,.97) !important; border-top-color:rgba(0,0,0,.1) !important; }
body.light-theme .footer-item { background:rgba(0,0,0,.05) !important; color:#555 !important; }
body.light-theme .footer-item:hover { background:rgba(0,0,0,.1) !important; color:#323232 !important; }
body.light-theme .sort-btn.active { background:#b06030 !important; color:#fff !important; }
body.light-theme .child-count { background:rgba(0,0,0,.6) !important; }
body.light-theme .empty-state { color:#999 !important; }
body.light-theme .empty-state h2 { color:#aaa !important; }