/* 一時タスク管理（カンバンボード）用CSS */

.temp-task-container {
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.temp-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* セット切り替えタブ */
.set-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.set-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.set-tab {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

.set-tab:hover {
    background: #e0e0e0;
}

.set-tab.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    font-weight: 600;
}

.set-tab-input {
    border: 1px solid #007bff;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.85rem;
    outline: none;
    width: 120px;
}

.set-add-btn {
    background: none;
    border: 1px dashed #aaa;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.set-add-btn:hover {
    background: #e8f0fe;
    color: #007bff;
    border-color: #007bff;
}

.temp-task-title {
    margin: 0;
    font-size: 1.4rem;
}

/* カンバンボード全体 */
.kanban-board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

/* カンバンカラム */
.kanban-column {
    flex: 1;
    min-width: 0;
    background-color: #f4f5f7;
    border-radius: 10px;
    padding: 12px;
    min-height: 300px;
}

/* カラムヘッダー */
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 3px solid transparent;
}

.todo-header {
    border-bottom-color: #6c757d;
}

.doing-header {
    border-bottom-color: #007bff;
}

.done-header {
    border-bottom-color: #28a745;
}

.column-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
}

.task-count {
    background-color: #dee2e6;
    color: #555;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* タスク追加フォーム */
.kanban-add-form {
    margin-bottom: 10px;
}

.kanban-input-group {
    display: flex;
    gap: 6px;
}

.kanban-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    background-color: white;
}

.kanban-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.kanban-add-btn {
    padding: 6px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.kanban-add-btn:hover {
    background-color: #0056b3;
}

/* タスクリストエリア */
.kanban-tasks {
    min-height: 80px;
    transition: background-color 0.2s, outline 0.2s;
    border-radius: 6px;
    padding: 4px 2px;
}

.kanban-tasks.drag-over {
    background-color: #dbeafe;
    outline: 2px dashed #3b82f6;
}

/* タスクカード */
.kanban-task-card {
    position: relative;
    background: white;
    border-radius: 7px;
    padding: 9px 12px;
    margin-bottom: 7px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s, transform 0.15s, opacity 0.15s;
    user-select: none;
    touch-action: none;
    border-left: 3px solid transparent;
    overflow: hidden;
}

#tasks-todo .kanban-task-card {
    border-left-color: #6c757d;
}

#tasks-doing .kanban-task-card {
    border-left-color: #007bff;
}

#tasks-done .kanban-task-card {
    border-left-color: #28a745;
}

.kanban-task-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.kanban-task-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.kanban-task-card:active {
    cursor: grabbing;
}

.kanban-task-text {
    flex: 1;
    word-break: break-word;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #333;
    margin-right: 6px;
}

/* 長押し削除オーバーレイ */
.kanban-task-delete-overlay {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    background: rgba(220, 53, 69, 0.88);
    border: 0;
    border-radius: 7px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    z-index: 10;
}

.kanban-task-delete-overlay:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -3px;
}

.kanban-task-card.delete-pending .kanban-task-delete-overlay {
    display: flex;
    animation: delete-overlay-appear 0.15s ease;
}

@keyframes delete-overlay-appear {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* 未保存インジケーター */
.kanban-task-unsaved-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.kanban-task-card.saving .kanban-task-unsaved-dot {
    background-color: #f0ad4e;
    animation: unsaved-pulse 1.2s ease-in-out infinite;
}

.kanban-task-card.save-error .kanban-task-unsaved-dot {
    background-color: #dc3545;
}

@keyframes unsaved-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* インライン編集インプット */
.kanban-task-edit-input {
    flex: 1;
    min-width: 0;
    padding: 2px 6px;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 0.875rem;
    outline: none;
    background-color: white;
    color: #333;
    margin-right: 6px;
}

/* クローン（タッチドラッグ用） */
.touch-clone {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.75;
    transform: rotate(2deg) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    border-radius: 7px;
}

/* デスクトップ用削除ゾーン（ドラッグ中のみ表示） */
.kanban-delete-zone {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 14px;
    border: 2px dashed #f5c6cb;
    border-radius: 10px;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.04);
    transition: background 0.2s, border-color 0.2s, border-style 0.1s;
    font-size: 0.875rem;
    cursor: default;
}

.kanban-delete-zone.active {
    display: flex;
}

.kanban-delete-zone.drag-over {
    background: rgba(220, 53, 69, 0.12);
    border-color: #dc3545;
    border-style: solid;
}

/* ドラッグオーバーレイ（モバイル用） */
.drag-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    padding: 20px;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    justify-content: center;
}

.drag-overlay.active {
    display: flex;
}

.drag-zones-row {
    display: flex;
    gap: 14px;
    flex: 1;
    max-height: 42vh;
}

.drag-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s;
    color: white;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    user-select: none;
    border: 2px solid transparent;
}

.drag-zone .fas {
    font-size: 2rem;
}

.drag-zone.todo-zone {
    background: rgba(108, 117, 125, 0.8);
    border-color: #6c757d;
}

.drag-zone.doing-zone {
    background: rgba(0, 123, 255, 0.8);
    border-color: #007bff;
}

.drag-zone.done-zone {
    background: rgba(40, 167, 69, 0.8);
    border-color: #28a745;
}

.drag-zone.delete-zone {
    /* 誤タップを減らすため削除ゾーンは小さめにし、ハザード縞で破壊的操作と明示する */
    flex: 0 0 38%;
    background-color: rgba(220, 53, 69, 0.85);
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.14) 0,
        rgba(0, 0, 0, 0.14) 10px,
        transparent 10px,
        transparent 20px
    );
    border-color: #dc3545;
}

.drag-zone.cancel-zone {
    background: rgba(52, 58, 64, 0.8);
    border-color: #343a40;
}

.drag-zone.drag-zone-hover {
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.25);
    border-color: white;
}

/* ヒントテキスト */
.kanban-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .temp-task-container {
        padding: 10px;
    }

    .temp-task-title {
        font-size: 1.2rem;
    }

    .kanban-board {
        flex-direction: column;
        gap: 10px;
    }

    .kanban-column {
        width: 100%;
        min-height: 120px;
    }

    .drag-overlay {
        padding: 12px;
        gap: 10px;
    }

    .drag-zones-row {
        gap: 10px;
        max-height: none;
        flex: 1;
    }

    .drag-zone {
        gap: 6px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .drag-zone .fas {
        font-size: 1.5rem;
    }

    /* モバイルでは削除ゾーンを非表示 */
    .kanban-delete-zone {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .column-title {
        font-size: 0.9rem;
    }

    .kanban-input {
        font-size: 0.8rem;
        padding: 5px 8px;
    }

    .kanban-add-btn {
        padding: 5px 9px;
    }

    .kanban-task-card {
        padding: 8px 10px;
    }

    .kanban-task-text {
        font-size: 0.82rem;
    }
}
